@megafon/ui-shared 4.6.0 → 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 +15 -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/VideoBanner/VideoBanner.d.ts +2 -0
- package/dist/es/components/VideoBanner/VideoBanner.js +6 -2
- 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/VideoBanner/VideoBanner.d.ts +2 -0
- package/dist/lib/components/VideoBanner/VideoBanner.js +6 -2
- 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,21 @@
|
|
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
|
+
|
6
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)
|
7
22
|
|
8
23
|
|
@@ -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
|
@@ -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;
|
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;
|
@@ -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;
|
@@ -1,9 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
|
+
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
4
6
|
value: true
|
5
7
|
});
|
6
|
-
exports["default"] =
|
8
|
+
exports["default"] = void 0;
|
7
9
|
|
8
10
|
require("core-js/modules/es.array.map");
|
9
11
|
|
@@ -15,28 +17,21 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
15
17
|
|
16
18
|
var _react = _interopRequireDefault(require("react"));
|
17
19
|
|
18
|
-
var _uiCore = require("@megafon/ui-core");
|
19
|
-
|
20
20
|
var _uiHelpers = require("@megafon/ui-helpers");
|
21
21
|
|
22
22
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
23
23
|
|
24
|
-
|
24
|
+
var _BreadcrumbsItem = _interopRequireWildcard(require("./components/BreadcrumbsItem"));
|
25
25
|
|
26
|
-
var
|
27
|
-
DEFAULT: 'default',
|
28
|
-
BLACK: 'black',
|
29
|
-
WHITE: 'white'
|
30
|
-
};
|
31
|
-
exports.TextColor = TextColor;
|
26
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
32
27
|
|
33
|
-
function
|
34
|
-
return !_react["default"].isValidElement(item);
|
35
|
-
}
|
28
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
36
29
|
|
37
|
-
function
|
38
|
-
|
39
|
-
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
31
|
+
|
32
|
+
var isObjectElement = function isObjectElement(item) {
|
33
|
+
return !_react["default"].isValidElement(item);
|
34
|
+
};
|
40
35
|
|
41
36
|
var cn = (0, _uiHelpers.cnCreate)('mfui-breadcrumbs');
|
42
37
|
|
@@ -47,50 +42,65 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
47
42
|
className = _ref.className,
|
48
43
|
_ref$classes = _ref.classes,
|
49
44
|
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
50
|
-
dataAttrs = _ref.dataAttrs
|
51
|
-
|
45
|
+
dataAttrs = _ref.dataAttrs,
|
46
|
+
_ref$hasMicrodata = _ref.hasMicrodata,
|
47
|
+
hasMicrodata = _ref$hasMicrodata === void 0 ? false : _ref$hasMicrodata;
|
48
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
52
49
|
className: cn({
|
53
50
|
color: color
|
54
51
|
}, className)
|
52
|
+
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), hasMicrodata && {
|
53
|
+
itemScope: true,
|
54
|
+
itemType: 'https://schema.org/BreadcrumbList'
|
55
55
|
}), items.map(function (item, i) {
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
dataAttrs:
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
56
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
57
|
+
className: cn('item', classes.item)
|
58
|
+
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
59
|
+
key: i
|
60
|
+
}), isObjectElement(item) ? /*#__PURE__*/_react["default"].createElement(_BreadcrumbsItem["default"], {
|
61
|
+
title: item.title,
|
62
|
+
href: item.href,
|
63
|
+
color: color,
|
64
|
+
index: i,
|
65
|
+
isLastItem: i === items.length - 1,
|
66
|
+
hasMicrodata: hasMicrodata,
|
67
|
+
dataAttrs: {
|
68
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.itemInner,
|
69
|
+
link: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link,
|
70
|
+
itemTitle: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.itemTitle,
|
71
|
+
meta: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.itemMeta
|
72
|
+
},
|
73
|
+
classes: {
|
74
|
+
link: classes === null || classes === void 0 ? void 0 : classes.link,
|
75
|
+
itemTitle: classes === null || classes === void 0 ? void 0 : classes.itemTitle,
|
76
|
+
lastItemTitle: classes === null || classes === void 0 ? void 0 : classes.lastItemTitle
|
77
|
+
}
|
78
|
+
}) : item);
|
77
79
|
}));
|
78
80
|
};
|
79
81
|
|
80
82
|
Breadcrumbs.propTypes = {
|
81
83
|
dataAttrs: _propTypes["default"].shape({
|
82
84
|
root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
85
|
+
item: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
86
|
+
itemInner: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
87
|
+
itemTitle: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
88
|
+
itemMeta: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
83
89
|
link: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
|
84
90
|
}),
|
85
91
|
className: _propTypes["default"].string,
|
86
92
|
classes: _propTypes["default"].shape({
|
87
|
-
item: _propTypes["default"].string
|
93
|
+
item: _propTypes["default"].string,
|
94
|
+
itemTitle: _propTypes["default"].string,
|
95
|
+
lastItemTitle: _propTypes["default"].string,
|
96
|
+
link: _propTypes["default"].string
|
88
97
|
}),
|
89
98
|
items: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].element.isRequired), _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
90
99
|
title: _propTypes["default"].string,
|
91
100
|
href: _propTypes["default"].string
|
92
101
|
}).isRequired)]).isRequired,
|
93
|
-
color: _propTypes["default"].oneOf(Object.values(TextColor))
|
102
|
+
color: _propTypes["default"].oneOf(Object.values(_BreadcrumbsItem.TextColor)),
|
103
|
+
hasMicrodata: _propTypes["default"].bool
|
94
104
|
};
|
95
105
|
var _default = Breadcrumbs;
|
96
106
|
exports["default"] = _default;
|
@@ -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,99 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports["default"] = exports.TextColor = void 0;
|
7
|
+
|
8
|
+
require("core-js/modules/es.object.values");
|
9
|
+
|
10
|
+
require("core-js/modules/es.string.link");
|
11
|
+
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13
|
+
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
15
|
+
|
16
|
+
var _uiCore = require("@megafon/ui-core");
|
17
|
+
|
18
|
+
var _uiHelpers = require("@megafon/ui-helpers");
|
19
|
+
|
20
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
21
|
+
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
23
|
+
|
24
|
+
var TextColor = {
|
25
|
+
DEFAULT: 'default',
|
26
|
+
BLACK: 'black',
|
27
|
+
WHITE: 'white'
|
28
|
+
};
|
29
|
+
exports.TextColor = TextColor;
|
30
|
+
var cn = (0, _uiHelpers.cnCreate)('mfui-breadcrumbs-item');
|
31
|
+
|
32
|
+
var BreadcrumbsItem = function BreadcrumbsItem(_ref) {
|
33
|
+
var title = _ref.title,
|
34
|
+
href = _ref.href,
|
35
|
+
color = _ref.color,
|
36
|
+
_ref$index = _ref.index,
|
37
|
+
index = _ref$index === void 0 ? 0 : _ref$index,
|
38
|
+
_ref$isLastItem = _ref.isLastItem,
|
39
|
+
isLastItem = _ref$isLastItem === void 0 ? false : _ref$isLastItem,
|
40
|
+
_ref$hasMicrodata = _ref.hasMicrodata,
|
41
|
+
hasMicrodata = _ref$hasMicrodata === void 0 ? false : _ref$hasMicrodata,
|
42
|
+
classes = _ref.classes,
|
43
|
+
dataAttrs = _ref.dataAttrs;
|
44
|
+
|
45
|
+
if (isLastItem) {
|
46
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
47
|
+
className: cn({
|
48
|
+
color: color
|
49
|
+
})
|
50
|
+
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root, index + 1)), /*#__PURE__*/_react["default"].createElement("span", (0, _extends2["default"])({
|
51
|
+
className: classes === null || classes === void 0 ? void 0 : classes.lastItemTitle
|
52
|
+
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.itemTitle, index + 1)), title));
|
53
|
+
}
|
54
|
+
|
55
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
56
|
+
className: cn()
|
57
|
+
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root, index + 1), hasMicrodata && {
|
58
|
+
itemScope: true,
|
59
|
+
itemProp: 'itemListElement',
|
60
|
+
itemType: 'https://schema.org/ListItem'
|
61
|
+
}), /*#__PURE__*/_react["default"].createElement(_uiCore.TextLink, {
|
62
|
+
className: classes === null || classes === void 0 ? void 0 : classes.link,
|
63
|
+
href: href,
|
64
|
+
color: color,
|
65
|
+
dataAttrs: {
|
66
|
+
root: (dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link) ? (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link, index + 1)) : undefined
|
67
|
+
},
|
68
|
+
itemProp: hasMicrodata ? 'item' : undefined
|
69
|
+
}, /*#__PURE__*/_react["default"].createElement("span", (0, _extends2["default"])({
|
70
|
+
className: classes === null || classes === void 0 ? void 0 : classes.itemTitle
|
71
|
+
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.itemTitle, index + 1), hasMicrodata && {
|
72
|
+
itemProp: 'name'
|
73
|
+
}), title)), hasMicrodata && /*#__PURE__*/_react["default"].createElement("meta", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.meta, index + 1), {
|
74
|
+
itemProp: "position",
|
75
|
+
content: String(index + 1)
|
76
|
+
})));
|
77
|
+
};
|
78
|
+
|
79
|
+
BreadcrumbsItem.propTypes = {
|
80
|
+
title: _propTypes["default"].string,
|
81
|
+
href: _propTypes["default"].string,
|
82
|
+
color: _propTypes["default"].oneOf(Object.values(TextColor)),
|
83
|
+
index: _propTypes["default"].number,
|
84
|
+
isLastItem: _propTypes["default"].bool,
|
85
|
+
hasMicrodata: _propTypes["default"].bool,
|
86
|
+
classes: _propTypes["default"].shape({
|
87
|
+
link: _propTypes["default"].string,
|
88
|
+
itemTitle: _propTypes["default"].string,
|
89
|
+
lastItemTitle: _propTypes["default"].string
|
90
|
+
}),
|
91
|
+
dataAttrs: _propTypes["default"].shape({
|
92
|
+
root: _propTypes["default"].objectOf(_propTypes["default"].string),
|
93
|
+
link: _propTypes["default"].objectOf(_propTypes["default"].string),
|
94
|
+
itemTitle: _propTypes["default"].objectOf(_propTypes["default"].string),
|
95
|
+
meta: _propTypes["default"].objectOf(_propTypes["default"].string)
|
96
|
+
})
|
97
|
+
};
|
98
|
+
var _default = BreadcrumbsItem;
|
99
|
+
exports["default"] = _default;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports["default"] = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
11
|
+
|
12
|
+
var FaqWrapper = function FaqWrapper(_ref) {
|
13
|
+
var children = _ref.children;
|
14
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
15
|
+
itemScope: true,
|
16
|
+
itemType: "http://schema.org/FAQPage"
|
17
|
+
}, children);
|
18
|
+
};
|
19
|
+
|
20
|
+
var _default = FaqWrapper;
|
21
|
+
exports["default"] = _default;
|
@@ -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
|
/** Дополнительные классы для внутренних элементов */
|
@@ -34,6 +34,8 @@ var PageTitle = function PageTitle(_ref) {
|
|
34
34
|
badge = _ref.badge,
|
35
35
|
_ref$isFullWidth = _ref.isFullWidth,
|
36
36
|
isFullWidth = _ref$isFullWidth === void 0 ? true : _ref$isFullWidth,
|
37
|
+
_ref$hasBreadcrumbsMi = _ref.hasBreadcrumbsMicrodata,
|
38
|
+
hasBreadcrumbsMicrodata = _ref$hasBreadcrumbsMi === void 0 ? false : _ref$hasBreadcrumbsMi,
|
37
39
|
className = _ref.className,
|
38
40
|
_ref$classes = _ref.classes,
|
39
41
|
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
@@ -63,6 +65,7 @@ var PageTitle = function PageTitle(_ref) {
|
|
63
65
|
className: cn([className]),
|
64
66
|
ref: rootRef
|
65
67
|
}), (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && /*#__PURE__*/React.createElement(_Breadcrumbs["default"], {
|
68
|
+
hasMicrodata: hasBreadcrumbsMicrodata,
|
66
69
|
items: breadcrumbs,
|
67
70
|
dataAttrs: {
|
68
71
|
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.breadcrumbs,
|
@@ -85,6 +88,7 @@ PageTitle.propTypes = {
|
|
85
88
|
}).isRequired),
|
86
89
|
badge: _propTypes["default"].string,
|
87
90
|
isFullWidth: _propTypes["default"].bool,
|
91
|
+
hasBreadcrumbsMicrodata: _propTypes["default"].bool,
|
88
92
|
className: _propTypes["default"].string,
|
89
93
|
classes: _propTypes["default"].shape({
|
90
94
|
breadcrumbs: _propTypes["default"].string
|
@@ -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;
|
@@ -97,7 +97,9 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
97
97
|
isMuted = _ref2$isMuted === void 0 ? true : _ref2$isMuted,
|
98
98
|
breadcrumbs = _ref2.breadcrumbs,
|
99
99
|
_ref2$videoMobile = _ref2.videoMobile,
|
100
|
-
videoMobile = _ref2$videoMobile === void 0 ? false : _ref2$videoMobile
|
100
|
+
videoMobile = _ref2$videoMobile === void 0 ? false : _ref2$videoMobile,
|
101
|
+
_ref2$hasBreadcrumbsM = _ref2.hasBreadcrumbsMicrodata,
|
102
|
+
hasBreadcrumbsMicrodata = _ref2$hasBreadcrumbsM === void 0 ? false : _ref2$hasBreadcrumbsM;
|
101
103
|
|
102
104
|
var _React$useState = _react["default"].useState(true),
|
103
105
|
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
@@ -243,6 +245,7 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
243
245
|
}), /*#__PURE__*/_react["default"].createElement(_uiCore.ContentArea, null, /*#__PURE__*/_react["default"].createElement("div", {
|
244
246
|
className: cn('wrapper')
|
245
247
|
}, !!(breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && /*#__PURE__*/_react["default"].createElement(_Breadcrumbs["default"], {
|
248
|
+
hasMicrodata: hasBreadcrumbsMicrodata,
|
246
249
|
dataAttrs: {
|
247
250
|
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.breadcrumbs,
|
248
251
|
link: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.breadcrumbsLink
|
@@ -314,7 +317,8 @@ VideoBanner.propTypes = {
|
|
314
317
|
breadcrumbs: PropTypes.arrayOf(PropTypes.shape({
|
315
318
|
title: PropTypes.string.isRequired,
|
316
319
|
href: PropTypes.string
|
317
|
-
}).isRequired)
|
320
|
+
}).isRequired),
|
321
|
+
hasBreadcrumbsMicrodata: PropTypes.bool
|
318
322
|
};
|
319
323
|
var _default = VideoBanner;
|
320
324
|
exports["default"] = _default;
|
package/dist/lib/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/lib/index.js
CHANGED
@@ -39,6 +39,12 @@ Object.defineProperty(exports, "Breadcrumbs", {
|
|
39
39
|
return _Breadcrumbs["default"];
|
40
40
|
}
|
41
41
|
});
|
42
|
+
Object.defineProperty(exports, "BreadcrumbsItem", {
|
43
|
+
enumerable: true,
|
44
|
+
get: function get() {
|
45
|
+
return _BreadcrumbsItem["default"];
|
46
|
+
}
|
47
|
+
});
|
42
48
|
Object.defineProperty(exports, "ButtonBanner", {
|
43
49
|
enumerable: true,
|
44
50
|
get: function get() {
|
@@ -87,6 +93,12 @@ Object.defineProperty(exports, "DownloadLinks", {
|
|
87
93
|
return _DownloadLinks["default"];
|
88
94
|
}
|
89
95
|
});
|
96
|
+
Object.defineProperty(exports, "FaqWrapper", {
|
97
|
+
enumerable: true,
|
98
|
+
get: function get() {
|
99
|
+
return _FaqWrapper["default"];
|
100
|
+
}
|
101
|
+
});
|
90
102
|
Object.defineProperty(exports, "Instructions", {
|
91
103
|
enumerable: true,
|
92
104
|
get: function get() {
|
@@ -232,6 +244,8 @@ var _BenefitsPictures = _interopRequireDefault(require("./components/BenefitsPic
|
|
232
244
|
|
233
245
|
var _Breadcrumbs = _interopRequireDefault(require("./components/Breadcrumbs/Breadcrumbs"));
|
234
246
|
|
247
|
+
var _BreadcrumbsItem = _interopRequireDefault(require("./components/Breadcrumbs/components/BreadcrumbsItem"));
|
248
|
+
|
235
249
|
var _ButtonBanner = _interopRequireDefault(require("./components/ButtonBanner/ButtonBanner"));
|
236
250
|
|
237
251
|
var _ButtonLinkBox = _interopRequireDefault(require("./components/ButtonLinkBox/ButtonLinkBox"));
|
@@ -248,6 +262,8 @@ var _DownloadLink = _interopRequireDefault(require("./components/DownloadLinks/D
|
|
248
262
|
|
249
263
|
var _DownloadLinks = _interopRequireDefault(require("./components/DownloadLinks/DownloadLinks"));
|
250
264
|
|
265
|
+
var _FaqWrapper = _interopRequireDefault(require("./components/FaqWrapper/FaqWrapper"));
|
266
|
+
|
251
267
|
var _Instructions = _interopRequireDefault(require("./components/Instructions/Instructions"));
|
252
268
|
|
253
269
|
var _PageTitle = _interopRequireDefault(require("./components/PageTitle/PageTitle"));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@megafon/ui-shared",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.7.0",
|
4
4
|
"files": [
|
5
5
|
"dist"
|
6
6
|
],
|
@@ -52,7 +52,7 @@
|
|
52
52
|
"@babel/preset-env": "^7.8.6",
|
53
53
|
"@babel/preset-react": "^7.8.3",
|
54
54
|
"@babel/preset-typescript": "^7.8.3",
|
55
|
-
"@megafon/ui-icons": "^2.4.
|
55
|
+
"@megafon/ui-icons": "^2.4.1",
|
56
56
|
"@svgr/core": "^2.4.1",
|
57
57
|
"@testing-library/jest-dom": "5.16.2",
|
58
58
|
"@testing-library/react": "12.1.2",
|
@@ -85,13 +85,13 @@
|
|
85
85
|
},
|
86
86
|
"dependencies": {
|
87
87
|
"@babel/runtime": "^7.8.4",
|
88
|
-
"@megafon/ui-core": "^4.
|
89
|
-
"@megafon/ui-helpers": "^2.3.
|
88
|
+
"@megafon/ui-core": "^4.10.0",
|
89
|
+
"@megafon/ui-helpers": "^2.3.1",
|
90
90
|
"core-js": "^3.6.4",
|
91
91
|
"htmr": "^0.9.2",
|
92
92
|
"lodash.throttle": "^4.1.1",
|
93
93
|
"prop-types": "^15.7.2",
|
94
94
|
"swiper": "^6.5.6"
|
95
95
|
},
|
96
|
-
"gitHead": "
|
96
|
+
"gitHead": "ac8874d2fae1f64db72d87a5c0352360a70b9a4d"
|
97
97
|
}
|