@megafon/ui-shared 3.0.0-beta.9 → 3.1.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.
Files changed (95) hide show
  1. package/CHANGELOG.md +48 -67
  2. package/README.md +2 -2
  3. package/dist/es/components/AccordionBox/AccordionBox.d.ts +5 -0
  4. package/dist/es/components/AccordionBox/AccordionBox.js +6 -1
  5. package/dist/es/components/BenefitsIcons/BenefitsIcons.js +1 -1
  6. package/dist/es/components/Breadcrumbs/Breadcrumbs.css +2 -2
  7. package/dist/es/components/Breadcrumbs/Breadcrumbs.d.ts +7 -2
  8. package/dist/es/components/Breadcrumbs/Breadcrumbs.js +48 -18
  9. package/dist/es/components/ButtonBanner/ButtonBanner.d.ts +1 -0
  10. package/dist/es/components/ButtonBanner/ButtonBanner.js +5 -1
  11. package/dist/es/components/ButtonLinkBox/ButtonLinkBox.d.ts +2 -0
  12. package/dist/es/components/ButtonLinkBox/ButtonLinkBox.js +9 -1
  13. package/dist/es/components/Card/Card.d.ts +4 -2
  14. package/dist/es/components/Card/Card.js +16 -6
  15. package/dist/es/components/Container/Container.css +163 -0
  16. package/dist/es/components/DownloadLinks/DownloadLink.css +1 -1
  17. package/dist/es/components/DownloadLinks/DownloadLink.d.ts +5 -0
  18. package/dist/es/components/DownloadLinks/DownloadLink.js +14 -6
  19. package/dist/es/components/Instructions/Instructions.d.ts +7 -0
  20. package/dist/es/components/Instructions/Instructions.js +55 -45
  21. package/dist/es/components/PageTitle/PageTitle.d.ts +6 -0
  22. package/dist/es/components/PageTitle/PageTitle.js +15 -4
  23. package/dist/es/components/Partners/Partners.d.ts +5 -4
  24. package/dist/es/components/Partners/Partners.js +15 -7
  25. package/dist/es/components/Property/Property.d.ts +3 -2
  26. package/dist/es/components/Property/Property.js +9 -3
  27. package/dist/es/components/Property/PropertyDescription.js +11 -5
  28. package/dist/es/components/Property/types.d.ts +3 -0
  29. package/dist/es/components/StoreBanner/StoreBanner.css +21 -22
  30. package/dist/es/components/StoreBanner/StoreBanner.d.ts +4 -0
  31. package/dist/es/components/StoreBanner/StoreBanner.js +19 -4
  32. package/dist/es/components/StoreBanner/doc/img/qr-code.png +0 -0
  33. package/dist/es/components/StoreButton/StoreButton.d.ts +1 -1
  34. package/dist/es/components/StoreButton/StoreButton.js +26 -7
  35. package/dist/es/components/Table/Table.css +1 -1
  36. package/dist/es/components/TextBox/TextBox.css +9 -0
  37. package/dist/es/components/TextWithIcon/TextWithIcon.css +15 -0
  38. package/dist/es/components/TextWithIcon/TextWithIcon.d.ts +19 -0
  39. package/dist/es/components/TextWithIcon/TextWithIcon.js +40 -0
  40. package/dist/es/components/TextWithIcon/TextWithIconItem.css +49 -0
  41. package/dist/es/components/TextWithIcon/TextWithIconItem.d.ts +18 -0
  42. package/dist/es/components/TextWithIcon/TextWithIconItem.js +35 -0
  43. package/dist/es/components/VideoBanner/VideoBanner.d.ts +7 -2
  44. package/dist/es/components/VideoBanner/VideoBanner.js +21 -5
  45. package/dist/es/components/VideoBlock/VideoBlock.d.ts +4 -3
  46. package/dist/es/components/VideoBlock/VideoBlock.js +12 -6
  47. package/dist/es/index.d.ts +2 -0
  48. package/dist/es/index.js +2 -0
  49. package/dist/lib/components/AccordionBox/AccordionBox.d.ts +5 -0
  50. package/dist/lib/components/AccordionBox/AccordionBox.js +6 -1
  51. package/dist/lib/components/BenefitsIcons/BenefitsIcons.js +1 -1
  52. package/dist/lib/components/Breadcrumbs/Breadcrumbs.css +2 -2
  53. package/dist/lib/components/Breadcrumbs/Breadcrumbs.d.ts +7 -2
  54. package/dist/lib/components/Breadcrumbs/Breadcrumbs.js +49 -17
  55. package/dist/lib/components/ButtonBanner/ButtonBanner.d.ts +1 -0
  56. package/dist/lib/components/ButtonBanner/ButtonBanner.js +5 -1
  57. package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.d.ts +2 -0
  58. package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.js +9 -1
  59. package/dist/lib/components/Card/Card.d.ts +4 -2
  60. package/dist/lib/components/Card/Card.js +16 -6
  61. package/dist/lib/components/Container/Container.css +163 -0
  62. package/dist/lib/components/DownloadLinks/DownloadLink.css +1 -1
  63. package/dist/lib/components/DownloadLinks/DownloadLink.d.ts +5 -0
  64. package/dist/lib/components/DownloadLinks/DownloadLink.js +13 -5
  65. package/dist/lib/components/Instructions/Instructions.d.ts +7 -0
  66. package/dist/lib/components/Instructions/Instructions.js +55 -44
  67. package/dist/lib/components/PageTitle/PageTitle.d.ts +6 -0
  68. package/dist/lib/components/PageTitle/PageTitle.js +17 -5
  69. package/dist/lib/components/Partners/Partners.d.ts +5 -4
  70. package/dist/lib/components/Partners/Partners.js +15 -7
  71. package/dist/lib/components/Property/Property.d.ts +3 -2
  72. package/dist/lib/components/Property/Property.js +9 -3
  73. package/dist/lib/components/Property/PropertyDescription.js +11 -4
  74. package/dist/lib/components/Property/types.d.ts +3 -0
  75. package/dist/lib/components/StoreBanner/StoreBanner.css +21 -22
  76. package/dist/lib/components/StoreBanner/StoreBanner.d.ts +4 -0
  77. package/dist/lib/components/StoreBanner/StoreBanner.js +19 -4
  78. package/dist/lib/components/StoreBanner/doc/img/qr-code.png +0 -0
  79. package/dist/lib/components/StoreButton/StoreButton.d.ts +1 -1
  80. package/dist/lib/components/StoreButton/StoreButton.js +30 -9
  81. package/dist/lib/components/Table/Table.css +1 -1
  82. package/dist/lib/components/TextBox/TextBox.css +9 -0
  83. package/dist/lib/components/TextWithIcon/TextWithIcon.css +15 -0
  84. package/dist/lib/components/TextWithIcon/TextWithIcon.d.ts +19 -0
  85. package/dist/lib/components/TextWithIcon/TextWithIcon.js +60 -0
  86. package/dist/lib/components/TextWithIcon/TextWithIconItem.css +49 -0
  87. package/dist/lib/components/TextWithIcon/TextWithIconItem.d.ts +18 -0
  88. package/dist/lib/components/TextWithIcon/TextWithIconItem.js +54 -0
  89. package/dist/lib/components/VideoBanner/VideoBanner.d.ts +7 -2
  90. package/dist/lib/components/VideoBanner/VideoBanner.js +21 -5
  91. package/dist/lib/components/VideoBlock/VideoBlock.d.ts +4 -3
  92. package/dist/lib/components/VideoBlock/VideoBlock.js +12 -6
  93. package/dist/lib/index.d.ts +2 -0
  94. package/dist/lib/index.js +16 -0
  95. package/package.json +5 -5
@@ -7,8 +7,14 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports["default"] = exports.Theme = void 0;
9
9
 
10
+ require("core-js/modules/es.symbol");
11
+
12
+ require("core-js/modules/es.array.index-of");
13
+
10
14
  require("core-js/modules/es.object.values");
11
15
 
16
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
17
+
12
18
  var React = _interopRequireWildcard(require("react"));
13
19
 
14
20
  var _uiCore = require("@megafon/ui-core");
@@ -17,12 +23,25 @@ var _uiHelpers = require("@megafon/ui-helpers");
17
23
 
18
24
  var _propTypes = _interopRequireDefault(require("prop-types"));
19
25
 
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
-
22
26
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
23
27
 
24
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; }
25
29
 
30
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
31
+
32
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
33
+ var t = {};
34
+
35
+ for (var p in s) {
36
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
37
+ }
38
+
39
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
40
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
41
+ }
42
+ return t;
43
+ };
44
+
26
45
  var Theme;
27
46
  exports.Theme = Theme;
28
47
 
@@ -34,18 +53,20 @@ exports.Theme = Theme;
34
53
 
35
54
  var cn = (0, _uiHelpers.cnCreate)('mfui-store-button');
36
55
 
37
- var StoreButton = function StoreButton(_ref) {
38
- var href = _ref.href,
39
- onClick = _ref.onClick,
40
- theme = _ref.theme,
41
- className = _ref.className;
42
- return /*#__PURE__*/React.createElement(_uiCore.Link, {
56
+ var StoreButton = function StoreButton(_a) {
57
+ var href = _a.href,
58
+ onClick = _a.onClick,
59
+ theme = _a.theme,
60
+ className = _a.className,
61
+ rest = __rest(_a, ["href", "onClick", "theme", "className"]);
62
+
63
+ return /*#__PURE__*/React.createElement(_uiCore.Link, (0, _extends2["default"])({}, rest, {
43
64
  href: href,
44
65
  onClick: onClick,
45
66
  className: cn({
46
67
  theme: theme
47
68
  }, className)
48
- });
69
+ }));
49
70
  };
50
71
 
51
72
  StoreButton.propTypes = {
@@ -128,7 +128,7 @@ h5 {
128
128
  line-height: 16px;
129
129
  height: 72px;
130
130
  padding-bottom: 12px;
131
- color: var(--stcBlack5);
131
+ color: var(--spbSky3);
132
132
  vertical-align: bottom;
133
133
  background-color: var(--spbSky0);
134
134
  }
@@ -14,3 +14,12 @@ h5 {
14
14
  .mfui-text-box_text-center {
15
15
  text-align: center;
16
16
  }
17
+ .mfui-text-box .mfui-text-with-icon {
18
+ margin: 24px 0;
19
+ }
20
+ .mfui-text-box .mfui-text-with-icon + .mfui-header {
21
+ margin-top: 32px;
22
+ }
23
+ .mfui-text-box .mfui-text-box-picture + .mfui-text-with-icon {
24
+ margin: 32px 0 24px;
25
+ }
@@ -0,0 +1,15 @@
1
+ h1,
2
+ h2,
3
+ h3,
4
+ h4,
5
+ h5 {
6
+ margin: 0;
7
+ }
8
+ .mfui-text-with-icon__header {
9
+ margin-bottom: 24px;
10
+ }
11
+ @media screen and (max-width: 767px) {
12
+ .mfui-text-with-icon__header {
13
+ text-align: center;
14
+ }
15
+ }
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ import { ITextWithIconItem } from './TextWithIconItem';
3
+ import './TextWithIcon.less';
4
+ export interface ITextWithIconProps {
5
+ /** Заголовок */
6
+ title?: string;
7
+ /** Ссылка на корневой элемент */
8
+ rootRef?: React.Ref<HTMLDivElement>;
9
+ /** Дополнительные data атрибуты к внутренним элементам */
10
+ dataAttrs?: {
11
+ root?: Record<string, string>;
12
+ };
13
+ /** Дополнительный класс для корневого элемента */
14
+ className?: string;
15
+ /** Допустимый дочерний компонент */
16
+ children: React.ReactElement<ITextWithIconItem>[] | React.ReactElement<ITextWithIconItem>;
17
+ }
18
+ declare const TextWithIcon: React.FC<ITextWithIconProps>;
19
+ export default TextWithIcon;
@@ -0,0 +1,60 @@
1
+ "use strict";
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
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
12
+ var React = _interopRequireWildcard(require("react"));
13
+
14
+ var _uiCore = require("@megafon/ui-core");
15
+
16
+ var _uiHelpers = require("@megafon/ui-helpers");
17
+
18
+ var PropTypes = _interopRequireWildcard(require("prop-types"));
19
+
20
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
21
+
22
+ 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; }
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
+
26
+ var cn = (0, _uiHelpers.cnCreate)('mfui-text-with-icon');
27
+
28
+ var TextWithIcon = function TextWithIcon(_ref) {
29
+ var title = _ref.title,
30
+ rootRef = _ref.rootRef,
31
+ dataAttrs = _ref.dataAttrs,
32
+ className = _ref.className,
33
+ children = _ref.children;
34
+ return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
35
+ className: cn([className]),
36
+ ref: rootRef
37
+ }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement(_uiCore.Grid, null, /*#__PURE__*/React.createElement(_uiCore.GridColumn, {
38
+ mobile: '12',
39
+ tablet: '7',
40
+ desktop: '6',
41
+ wide: '6'
42
+ }, title && /*#__PURE__*/React.createElement(_uiCore.Header, {
43
+ className: cn('header'),
44
+ as: "h5"
45
+ }, title), children)));
46
+ };
47
+
48
+ TextWithIcon.propTypes = {
49
+ title: PropTypes.string,
50
+ rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
51
+ current: PropTypes.elementType
52
+ }), PropTypes.any])]),
53
+ dataAttrs: PropTypes.shape({
54
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
55
+ }),
56
+ children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element.isRequired]).isRequired,
57
+ className: PropTypes.string
58
+ };
59
+ var _default = TextWithIcon;
60
+ exports["default"] = _default;
@@ -0,0 +1,49 @@
1
+ h1,
2
+ h2,
3
+ h3,
4
+ h4,
5
+ h5 {
6
+ margin: 0;
7
+ }
8
+ .mfui-text-with-icon-item {
9
+ display: -webkit-box;
10
+ display: -ms-flexbox;
11
+ display: flex;
12
+ -webkit-box-align: center;
13
+ -ms-flex-align: center;
14
+ align-items: center;
15
+ }
16
+ @media screen and (max-width: 767px) {
17
+ .mfui-text-with-icon-item {
18
+ -webkit-box-orient: vertical;
19
+ -webkit-box-direction: normal;
20
+ -ms-flex-direction: column;
21
+ flex-direction: column;
22
+ }
23
+ }
24
+ .mfui-text-with-icon-item:not(:first-of-type) {
25
+ margin-top: 16px;
26
+ }
27
+ @media screen and (max-width: 767px) {
28
+ .mfui-text-with-icon-item:not(:first-of-type) {
29
+ margin-top: 24px;
30
+ }
31
+ }
32
+ .mfui-text-with-icon-item__svg-icon {
33
+ width: 40px;
34
+ min-width: 40px;
35
+ height: 40px;
36
+ min-height: 40px;
37
+ overflow: hidden;
38
+ }
39
+ @media screen and (min-width: 768px) {
40
+ .mfui-text-with-icon-item__svg-icon {
41
+ margin-right: 16px;
42
+ }
43
+ }
44
+ @media screen and (max-width: 767px) {
45
+ .mfui-text-with-icon-item__text {
46
+ margin-top: 12px;
47
+ text-align: center;
48
+ }
49
+ }
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import './TextWithIconItem.less';
3
+ export interface ITextWithIconItem {
4
+ /** Текст */
5
+ text: string | string[];
6
+ /** Иконка */
7
+ icon: React.ReactNode;
8
+ /** Ссылка на корневой элемент */
9
+ rootRef?: React.Ref<HTMLDivElement>;
10
+ /** Дополнительные data атрибуты к внутренним элементам */
11
+ dataAttrs?: {
12
+ root?: Record<string, string>;
13
+ };
14
+ /** Дополнительный класс для корневого элемента */
15
+ className?: string;
16
+ }
17
+ declare const TextWithIconItem: React.FC<ITextWithIconItem>;
18
+ export default TextWithIconItem;
@@ -0,0 +1,54 @@
1
+ "use strict";
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
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
12
+ var React = _interopRequireWildcard(require("react"));
13
+
14
+ var _uiHelpers = require("@megafon/ui-helpers");
15
+
16
+ var PropTypes = _interopRequireWildcard(require("prop-types"));
17
+
18
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
19
+
20
+ 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; }
21
+
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
+
24
+ var cn = (0, _uiHelpers.cnCreate)('mfui-text-with-icon-item');
25
+
26
+ var TextWithIconItem = function TextWithIconItem(_ref) {
27
+ var text = _ref.text,
28
+ icon = _ref.icon,
29
+ rootRef = _ref.rootRef,
30
+ dataAttrs = _ref.dataAttrs,
31
+ className = _ref.className;
32
+ return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
33
+ className: cn([className]),
34
+ ref: rootRef
35
+ }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("div", {
36
+ className: cn('svg-icon')
37
+ }, icon), /*#__PURE__*/React.createElement("div", {
38
+ className: cn('text')
39
+ }, text));
40
+ };
41
+
42
+ TextWithIconItem.propTypes = {
43
+ text: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.arrayOf(PropTypes.string.isRequired)]).isRequired,
44
+ icon: PropTypes.node.isRequired,
45
+ rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
46
+ current: PropTypes.elementType
47
+ }), PropTypes.any])]),
48
+ dataAttrs: PropTypes.shape({
49
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
50
+ }),
51
+ className: PropTypes.string
52
+ };
53
+ var _default = TextWithIconItem;
54
+ exports["default"] = _default;
@@ -52,9 +52,13 @@ export interface IContent {
52
52
  cost?: string;
53
53
  }
54
54
  interface IVideoBannerProps {
55
- /** Дата атрибуты для корневого элемента */
55
+ /** Дополнительные data атрибуты к внутренним элементам */
56
56
  dataAttrs?: {
57
- [key: string]: string;
57
+ root?: Record<string, string>;
58
+ breadcrumbs?: Record<string, string>;
59
+ breadcrumbsLink?: Record<string, string>;
60
+ button?: Record<string, string>;
61
+ link?: Record<string, string>;
58
62
  };
59
63
  /** Дополнительный класс корневого элемента */
60
64
  className?: string;
@@ -64,6 +68,7 @@ interface IVideoBannerProps {
64
68
  button?: string;
65
69
  link?: string;
66
70
  breadcrumbs?: string;
71
+ video?: string;
67
72
  };
68
73
  /** Ссылка на корневой элемент */
69
74
  rootRef?: Ref<HTMLDivElement>;
@@ -155,18 +155,24 @@ var VideoBanner = function VideoBanner(_ref2) {
155
155
  }, (0, _uiHelpers.convert)(cost, typographyConfig))), /*#__PURE__*/_react["default"].createElement("div", {
156
156
  className: cn('btns-wrapper')
157
157
  }, buttonTitle && /*#__PURE__*/_react["default"].createElement(_uiCore.Button, {
158
+ dataAttrs: {
159
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button
160
+ },
158
161
  className: cn(ClassName.BUTTON, [classes.button]),
159
162
  theme: buttonColor,
160
163
  href: buttonHref,
161
164
  onClick: onButtonClick,
162
165
  download: buttonDownload
163
166
  }, buttonTitle), linkTitle && /*#__PURE__*/_react["default"].createElement(_uiCore.TextLink, {
167
+ dataAttrs: {
168
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link
169
+ },
164
170
  className: cn(ClassName.LINK, [classes.link]),
165
171
  href: linkUrl,
166
172
  download: linkDownload,
167
173
  onClick: onLinkClick
168
174
  }, linkTitle)))));
169
- }, [classes.button, classes.link]);
175
+ }, [classes.button, classes.link, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link]);
170
176
 
171
177
  var renderVideo = _react["default"].useCallback(function () {
172
178
  switch (videoType) {
@@ -199,7 +205,7 @@ var VideoBanner = function VideoBanner(_ref2) {
199
205
  /*#__PURE__*/
200
206
  // eslint-disable-next-line jsx-a11y/media-has-caption
201
207
  _react["default"].createElement("video", {
202
- className: cn('video'),
208
+ className: cn('video', [classes.video]),
203
209
  autoPlay: true,
204
210
  loop: true,
205
211
  muted: isMuted
@@ -215,7 +221,7 @@ var VideoBanner = function VideoBanner(_ref2) {
215
221
  return null;
216
222
  }
217
223
  }
218
- }, [videoType, videoSrc, isMuted]);
224
+ }, [videoType, videoSrc, isMuted, classes.video]);
219
225
 
220
226
  _react["default"].useEffect(function () {
221
227
  var getImageSrc = function getImageSrc() {
@@ -249,12 +255,16 @@ var VideoBanner = function VideoBanner(_ref2) {
249
255
  };
250
256
  }, [imageDesktop, imageDesktopWide, imageMobile, imageTablet]);
251
257
 
252
- return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs), {
258
+ return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
253
259
  className: cn([className, classes.root]),
254
260
  ref: rootRef
255
261
  }), /*#__PURE__*/_react["default"].createElement(_uiCore.ContentArea, null, /*#__PURE__*/_react["default"].createElement("div", {
256
262
  className: cn('wrapper')
257
263
  }, !!(breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && /*#__PURE__*/_react["default"].createElement(_Breadcrumbs["default"], {
264
+ dataAttrs: {
265
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.breadcrumbs,
266
+ link: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.breadcrumbsLink
267
+ },
258
268
  className: cn('breadcrumbs'),
259
269
  items: breadcrumbs,
260
270
  color: content === null || content === void 0 ? void 0 : content.textColor,
@@ -270,7 +280,13 @@ var VideoBanner = function VideoBanner(_ref2) {
270
280
  };
271
281
 
272
282
  VideoBanner.propTypes = {
273
- dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired),
283
+ dataAttrs: PropTypes.shape({
284
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
285
+ breadcrumbs: PropTypes.objectOf(PropTypes.string.isRequired),
286
+ breadcrumbsLink: PropTypes.objectOf(PropTypes.string.isRequired),
287
+ button: PropTypes.objectOf(PropTypes.string.isRequired),
288
+ link: PropTypes.objectOf(PropTypes.string.isRequired)
289
+ }),
274
290
  className: PropTypes.string,
275
291
  classes: PropTypes.shape({
276
292
  root: PropTypes.string,
@@ -6,7 +6,7 @@ export interface IContent {
6
6
  /** Текст-описание */
7
7
  description: string | React.ReactNode[] | React.ReactNode;
8
8
  /** Текст кнопки */
9
- buttonTitle: string;
9
+ buttonTitle?: string;
10
10
  /** Добавляет атрибут download для тега <a> компонента Button */
11
11
  buttonDownload?: boolean;
12
12
  /** Ссылка на кнопке */
@@ -20,9 +20,10 @@ export declare const VideoTypes: {
20
20
  };
21
21
  declare type VideoType = typeof VideoTypes[keyof typeof VideoTypes];
22
22
  export interface IVideoBlockProps {
23
- /** Дата атрибуты для корневого элемента */
23
+ /** Дополнительные data атрибуты к внутренним элементам */
24
24
  dataAttrs?: {
25
- [key: string]: string;
25
+ root?: Record<string, string>;
26
+ button?: Record<string, string>;
26
27
  };
27
28
  /** Дополнительный класс корневого элемента */
28
29
  className?: string;
@@ -101,13 +101,16 @@ var VideoBlock = function VideoBlock(_ref) {
101
101
  className: cn('header')
102
102
  }, title), /*#__PURE__*/_react["default"].createElement("div", {
103
103
  className: cn('description', [classes.description])
104
- }, description), /*#__PURE__*/_react["default"].createElement(_uiCore.Button, {
104
+ }, description), buttonTitle && /*#__PURE__*/_react["default"].createElement(_uiCore.Button, {
105
+ dataAttrs: {
106
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button
107
+ },
105
108
  className: cn('button', [classes.button]),
106
109
  href: href,
107
110
  onClick: onButtonClick,
108
111
  download: buttonDownload
109
112
  }, buttonTitle));
110
- }, [classes.button, classes.description]);
113
+ }, [classes.button, classes.description, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button]);
111
114
 
112
115
  var renderGridColumns = _react["default"].useCallback(function () {
113
116
  var columns = [];
@@ -121,7 +124,7 @@ var VideoBlock = function VideoBlock(_ref) {
121
124
  orderTablet: "2",
122
125
  orderMobile: "2",
123
126
  key: "column-content"
124
- }, renderContent && renderContent(content)));
127
+ }, renderContent(content)));
125
128
  }
126
129
 
127
130
  columns.push( /*#__PURE__*/_react["default"].createElement(_uiCore.GridColumn, {
@@ -137,7 +140,7 @@ var VideoBlock = function VideoBlock(_ref) {
137
140
  return columns;
138
141
  }, [renderContent, renderVideo, content]);
139
142
 
140
- return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs), {
143
+ return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
141
144
  className: cn([className, classes.root]),
142
145
  ref: rootRef
143
146
  }), /*#__PURE__*/_react["default"].createElement(_uiCore.Grid, {
@@ -147,7 +150,10 @@ var VideoBlock = function VideoBlock(_ref) {
147
150
  };
148
151
 
149
152
  VideoBlock.propTypes = {
150
- dataAttrs: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
153
+ dataAttrs: _propTypes["default"].shape({
154
+ root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
155
+ button: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
156
+ }),
151
157
  className: _propTypes["default"].string,
152
158
  classes: _propTypes["default"].shape({
153
159
  root: _propTypes["default"].string,
@@ -161,7 +167,7 @@ VideoBlock.propTypes = {
161
167
  title: _propTypes["default"].string.isRequired,
162
168
  description: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node]).isRequired,
163
169
  href: _propTypes["default"].string,
164
- buttonTitle: _propTypes["default"].string.isRequired,
170
+ buttonTitle: _propTypes["default"].string,
165
171
  buttonDownload: _propTypes["default"].bool,
166
172
  onButtonClick: _propTypes["default"].func
167
173
  }),
@@ -29,6 +29,8 @@ export { default as TableRow } from './components/Table/TableRow';
29
29
  export { default as TabsBox } from './components/TabsBox/TabsBox';
30
30
  export { default as TextBox } from './components/TextBox/TextBox';
31
31
  export { default as TextBoxPicture } from './components/TextBox/TextBoxPicture';
32
+ export { default as TextWithIcon } from './components/TextWithIcon/TextWithIcon';
33
+ export { default as TextWithIconItem } from './components/TextWithIcon/TextWithIconItem';
32
34
  export { default as TitleDescriptionBox } from './components/TitleDescriptionBox/TitleDescriptionBox';
33
35
  export { default as VideoBanner } from './components/VideoBanner/VideoBanner';
34
36
  export { default as VideoBlock } from './components/VideoBlock/VideoBlock';
package/dist/lib/index.js CHANGED
@@ -189,6 +189,18 @@ Object.defineProperty(exports, "TextBoxPicture", {
189
189
  return _TextBoxPicture["default"];
190
190
  }
191
191
  });
192
+ Object.defineProperty(exports, "TextWithIcon", {
193
+ enumerable: true,
194
+ get: function get() {
195
+ return _TextWithIcon["default"];
196
+ }
197
+ });
198
+ Object.defineProperty(exports, "TextWithIconItem", {
199
+ enumerable: true,
200
+ get: function get() {
201
+ return _TextWithIconItem["default"];
202
+ }
203
+ });
192
204
  Object.defineProperty(exports, "TitleDescriptionBox", {
193
205
  enumerable: true,
194
206
  get: function get() {
@@ -270,6 +282,10 @@ var _TextBox = _interopRequireDefault(require("./components/TextBox/TextBox"));
270
282
 
271
283
  var _TextBoxPicture = _interopRequireDefault(require("./components/TextBox/TextBoxPicture"));
272
284
 
285
+ var _TextWithIcon = _interopRequireDefault(require("./components/TextWithIcon/TextWithIcon"));
286
+
287
+ var _TextWithIconItem = _interopRequireDefault(require("./components/TextWithIcon/TextWithIconItem"));
288
+
273
289
  var _TitleDescriptionBox = _interopRequireDefault(require("./components/TitleDescriptionBox/TitleDescriptionBox"));
274
290
 
275
291
  var _VideoBanner = _interopRequireDefault(require("./components/VideoBanner/VideoBanner"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-shared",
3
- "version": "3.0.0-beta.9",
3
+ "version": "3.1.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": "^1.0.0-beta.4",
55
+ "@megafon/ui-icons": "^1.0.1",
56
56
  "@svgr/core": "^2.4.1",
57
57
  "@types/enzyme": "^3.10.5",
58
58
  "@types/enzyme-adapter-react-16": "^1.0.6",
@@ -82,13 +82,13 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "@babel/runtime": "^7.8.4",
85
- "@megafon/ui-core": "^3.0.0-beta.9",
86
- "@megafon/ui-helpers": "^2.0.0-beta.4",
85
+ "@megafon/ui-core": "^3.1.0",
86
+ "@megafon/ui-helpers": "^2.0.1",
87
87
  "core-js": "^3.6.4",
88
88
  "htmr": "^0.9.2",
89
89
  "lodash.throttle": "^4.1.1",
90
90
  "prop-types": "^15.7.2",
91
91
  "swiper": "^6.5.6"
92
92
  },
93
- "gitHead": "dd4791f8bc10d6be8435c7f72b933946c1195d94"
93
+ "gitHead": "3b91f6030703838090828a8a77cff3d82cb14c10"
94
94
  }