@megafon/ui-shared 3.0.3 → 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 (74) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/es/components/AccordionBox/AccordionBox.d.ts +5 -0
  3. package/dist/es/components/AccordionBox/AccordionBox.js +6 -1
  4. package/dist/es/components/BenefitsIcons/BenefitsIcons.js +1 -1
  5. package/dist/es/components/Breadcrumbs/Breadcrumbs.css +2 -2
  6. package/dist/es/components/Breadcrumbs/Breadcrumbs.d.ts +7 -2
  7. package/dist/es/components/Breadcrumbs/Breadcrumbs.js +48 -18
  8. package/dist/es/components/ButtonBanner/ButtonBanner.d.ts +1 -0
  9. package/dist/es/components/ButtonBanner/ButtonBanner.js +5 -1
  10. package/dist/es/components/ButtonLinkBox/ButtonLinkBox.d.ts +2 -0
  11. package/dist/es/components/ButtonLinkBox/ButtonLinkBox.js +9 -1
  12. package/dist/es/components/Card/Card.d.ts +4 -2
  13. package/dist/es/components/Card/Card.js +16 -6
  14. package/dist/es/components/DownloadLinks/DownloadLink.css +1 -1
  15. package/dist/es/components/DownloadLinks/DownloadLink.d.ts +5 -0
  16. package/dist/es/components/DownloadLinks/DownloadLink.js +14 -6
  17. package/dist/es/components/Instructions/Instructions.d.ts +7 -0
  18. package/dist/es/components/Instructions/Instructions.js +55 -45
  19. package/dist/es/components/PageTitle/PageTitle.d.ts +6 -0
  20. package/dist/es/components/PageTitle/PageTitle.js +15 -4
  21. package/dist/es/components/Partners/Partners.d.ts +5 -4
  22. package/dist/es/components/Partners/Partners.js +15 -7
  23. package/dist/es/components/Property/Property.d.ts +3 -2
  24. package/dist/es/components/Property/Property.js +9 -3
  25. package/dist/es/components/Property/PropertyDescription.js +11 -5
  26. package/dist/es/components/Property/types.d.ts +3 -0
  27. package/dist/es/components/StoreBanner/StoreBanner.d.ts +4 -0
  28. package/dist/es/components/StoreBanner/StoreBanner.js +19 -4
  29. package/dist/es/components/StoreButton/StoreButton.d.ts +1 -1
  30. package/dist/es/components/StoreButton/StoreButton.js +26 -7
  31. package/dist/es/components/Table/Table.css +1 -1
  32. package/dist/es/components/TextWithIcon/TextWithIconItem.d.ts +1 -1
  33. package/dist/es/components/TextWithIcon/TextWithIconItem.js +1 -1
  34. package/dist/es/components/VideoBanner/VideoBanner.d.ts +7 -2
  35. package/dist/es/components/VideoBanner/VideoBanner.js +21 -5
  36. package/dist/es/components/VideoBlock/VideoBlock.d.ts +3 -2
  37. package/dist/es/components/VideoBlock/VideoBlock.js +9 -3
  38. package/dist/lib/components/AccordionBox/AccordionBox.d.ts +5 -0
  39. package/dist/lib/components/AccordionBox/AccordionBox.js +6 -1
  40. package/dist/lib/components/BenefitsIcons/BenefitsIcons.js +1 -1
  41. package/dist/lib/components/Breadcrumbs/Breadcrumbs.css +2 -2
  42. package/dist/lib/components/Breadcrumbs/Breadcrumbs.d.ts +7 -2
  43. package/dist/lib/components/Breadcrumbs/Breadcrumbs.js +49 -17
  44. package/dist/lib/components/ButtonBanner/ButtonBanner.d.ts +1 -0
  45. package/dist/lib/components/ButtonBanner/ButtonBanner.js +5 -1
  46. package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.d.ts +2 -0
  47. package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.js +9 -1
  48. package/dist/lib/components/Card/Card.d.ts +4 -2
  49. package/dist/lib/components/Card/Card.js +16 -6
  50. package/dist/lib/components/DownloadLinks/DownloadLink.css +1 -1
  51. package/dist/lib/components/DownloadLinks/DownloadLink.d.ts +5 -0
  52. package/dist/lib/components/DownloadLinks/DownloadLink.js +13 -5
  53. package/dist/lib/components/Instructions/Instructions.d.ts +7 -0
  54. package/dist/lib/components/Instructions/Instructions.js +55 -44
  55. package/dist/lib/components/PageTitle/PageTitle.d.ts +6 -0
  56. package/dist/lib/components/PageTitle/PageTitle.js +17 -5
  57. package/dist/lib/components/Partners/Partners.d.ts +5 -4
  58. package/dist/lib/components/Partners/Partners.js +15 -7
  59. package/dist/lib/components/Property/Property.d.ts +3 -2
  60. package/dist/lib/components/Property/Property.js +9 -3
  61. package/dist/lib/components/Property/PropertyDescription.js +11 -4
  62. package/dist/lib/components/Property/types.d.ts +3 -0
  63. package/dist/lib/components/StoreBanner/StoreBanner.d.ts +4 -0
  64. package/dist/lib/components/StoreBanner/StoreBanner.js +19 -4
  65. package/dist/lib/components/StoreButton/StoreButton.d.ts +1 -1
  66. package/dist/lib/components/StoreButton/StoreButton.js +30 -9
  67. package/dist/lib/components/Table/Table.css +1 -1
  68. package/dist/lib/components/TextWithIcon/TextWithIconItem.d.ts +1 -1
  69. package/dist/lib/components/TextWithIcon/TextWithIconItem.js +1 -1
  70. package/dist/lib/components/VideoBanner/VideoBanner.d.ts +7 -2
  71. package/dist/lib/components/VideoBanner/VideoBanner.js +21 -5
  72. package/dist/lib/components/VideoBlock/VideoBlock.d.ts +3 -2
  73. package/dist/lib/components/VideoBlock/VideoBlock.js +9 -3
  74. package/package.json +3 -3
@@ -1,13 +1,15 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import * as React from 'react';
2
3
  import { Header, Grid, GridColumn } from '@megafon/ui-core';
3
- import { cnCreate } from '@megafon/ui-helpers';
4
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
4
5
  import PropTypes from 'prop-types';
5
6
  import "./PageTitle.css";
6
7
  import Breadcrumbs from "../Breadcrumbs/Breadcrumbs";
7
8
  var cn = cnCreate('mfui-page-title');
8
9
 
9
10
  var PageTitle = function PageTitle(_ref) {
10
- var title = _ref.title,
11
+ var dataAttrs = _ref.dataAttrs,
12
+ title = _ref.title,
11
13
  breadcrumbs = _ref.breadcrumbs,
12
14
  badge = _ref.badge,
13
15
  _ref$isFullWidth = _ref.isFullWidth,
@@ -37,16 +39,25 @@ var PageTitle = function PageTitle(_ref) {
37
39
  mobile: "12"
38
40
  }, renderPageTitle()));
39
41
  }, [renderPageTitle]);
40
- return /*#__PURE__*/React.createElement("div", {
42
+ return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
41
43
  className: cn([className]),
42
44
  ref: rootRef
43
- }, (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && /*#__PURE__*/React.createElement(Breadcrumbs, {
45
+ }), (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && /*#__PURE__*/React.createElement(Breadcrumbs, {
44
46
  items: breadcrumbs,
47
+ dataAttrs: {
48
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.breadcrumbs,
49
+ link: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.breadcrumbsLink
50
+ },
45
51
  className: cn('breadcrumbs', [classes.breadcrumbs])
46
52
  }), isFullWidth ? renderPageTitle() : renderPageTitleWithGrid());
47
53
  };
48
54
 
49
55
  PageTitle.propTypes = {
56
+ dataAttrs: PropTypes.shape({
57
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
58
+ breadcrumbs: PropTypes.objectOf(PropTypes.string.isRequired),
59
+ breadcrumbsLink: PropTypes.objectOf(PropTypes.string.isRequired)
60
+ }),
50
61
  title: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,
51
62
  breadcrumbs: PropTypes.arrayOf(PropTypes.shape({
52
63
  title: PropTypes.string.isRequired,
@@ -6,6 +6,11 @@ export declare type ItemType = {
6
6
  alt: string;
7
7
  };
8
8
  export interface IPartnersProps {
9
+ /** Дополнительные data атрибуты к внутренним элементам */
10
+ dataAttrs?: {
11
+ root?: Record<string, string>;
12
+ item?: Record<string, string>;
13
+ };
9
14
  /** Ссылка на корневой элемент */
10
15
  rootRef?: React.Ref<HTMLDivElement>;
11
16
  /** Дополнительные классы для корневого и внутренних элементов */
@@ -13,10 +18,6 @@ export interface IPartnersProps {
13
18
  root?: string;
14
19
  itemClass?: string;
15
20
  };
16
- /** Дата атрибуты для корневого элемента */
17
- dataAttrs?: {
18
- [key: string]: string;
19
- };
20
21
  /** Дополнительный класс корневого элемента */
21
22
  className?: string;
22
23
  /** Список логотипов */
@@ -36,6 +36,8 @@ var Partners = function Partners(_ref) {
36
36
  onNextClick = _ref.onNextClick,
37
37
  onPrevClick = _ref.onPrevClick;
38
38
  var renderItem = React.useCallback(function (item) {
39
+ var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
40
+
39
41
  if (!item) {
40
42
  return null;
41
43
  }
@@ -44,10 +46,13 @@ var Partners = function Partners(_ref) {
44
46
  href = item.href,
45
47
  alt = item.alt;
46
48
  return /*#__PURE__*/React.createElement(Tile, {
47
- className: cn('tile'),
48
49
  href: href,
49
50
  shadowLevel: "low",
50
- isInteractive: !!href
51
+ isInteractive: !!href,
52
+ className: cn('tile'),
53
+ dataAttrs: {
54
+ root: _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, index + 1))
55
+ }
51
56
  }, /*#__PURE__*/React.createElement("div", {
52
57
  className: cn('tile-inner', [itemClass])
53
58
  }, /*#__PURE__*/React.createElement("div", {
@@ -57,7 +62,7 @@ var Partners = function Partners(_ref) {
57
62
  alt: alt,
58
63
  className: cn('tile-img')
59
64
  }))));
60
- }, [itemClass]);
65
+ }, [itemClass, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item]);
61
66
  var renderGrid = React.useCallback(function () {
62
67
  return /*#__PURE__*/React.createElement(Grid, {
63
68
  guttersLeft: "medium",
@@ -67,7 +72,7 @@ var Partners = function Partners(_ref) {
67
72
  key: i + item.src,
68
73
  all: "3",
69
74
  mobile: "6"
70
- }, renderItem(item));
75
+ }, renderItem(item, i));
71
76
  }));
72
77
  }, [items, renderItem]);
73
78
  var renderCarousel = React.useCallback(function () {
@@ -83,13 +88,13 @@ var Partners = function Partners(_ref) {
83
88
  return /*#__PURE__*/React.createElement("div", {
84
89
  key: i + item.src,
85
90
  className: cn('slide')
86
- }, renderItem(item), renderItem(bottomRow[i]));
91
+ }, renderItem(item, i), renderItem(bottomRow[i], i));
87
92
  }));
88
93
  }, [items, onChange, onNextClick, onPrevClick, renderItem]);
89
94
  return /*#__PURE__*/React.createElement("div", _extends({
90
95
  ref: rootRef,
91
96
  className: cn([root, className])
92
- }, filterDataAttrs(dataAttrs)), items.length > MAX_GRID_ITEMS_LENGTH ? renderCarousel() : renderGrid());
97
+ }, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), items.length > MAX_GRID_ITEMS_LENGTH ? renderCarousel() : renderGrid());
93
98
  };
94
99
 
95
100
  Partners.propTypes = {
@@ -100,7 +105,10 @@ Partners.propTypes = {
100
105
  root: PropTypes.string,
101
106
  itemClass: PropTypes.string
102
107
  }),
103
- dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired),
108
+ dataAttrs: PropTypes.shape({
109
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
110
+ item: PropTypes.objectOf(PropTypes.string.isRequired)
111
+ }),
104
112
  className: PropTypes.string,
105
113
  items: PropTypes.arrayOf(PropTypes.shape({
106
114
  href: PropTypes.string,
@@ -18,9 +18,10 @@ export interface IProperty {
18
18
  icon?: React.ReactNode;
19
19
  /** Растягивание компонента на всю доступную ширину */
20
20
  fullWidth?: boolean;
21
- /** Дата атрибуты для корневого элемента */
21
+ /** Дополнительные data атрибуты к внутренним элементам */
22
22
  dataAttrs?: {
23
- [key: string]: string;
23
+ root?: Record<string, string>;
24
+ moreLink?: Record<string, string>;
24
25
  };
25
26
  /** Дополнительные классы для внутренних элементов */
26
27
  classes?: {
@@ -47,13 +47,16 @@ var Property = function Property(_ref) {
47
47
  }, /*#__PURE__*/React.createElement(PropertyDescription, {
48
48
  value: value,
49
49
  isCollapsible: isCollapsible,
50
+ dataAttrs: {
51
+ moreLink: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.moreLink
52
+ },
50
53
  classes: {
51
54
  open: classes.openedDescription,
52
55
  toggle: classes.toggleDescription
53
56
  }
54
57
  }));
55
58
  });
56
- }, [classes.openedDescription, classes.toggleDescription]);
59
+ }, [classes.openedDescription, classes.toggleDescription, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.moreLink]);
57
60
  var getColumnConfig = React.useCallback(function () {
58
61
  return fullWidth ? {
59
62
  all: '12'
@@ -69,7 +72,7 @@ var Property = function Property(_ref) {
69
72
  'border-bottom': borderBottom
70
73
  }, [className]),
71
74
  ref: rootRef
72
- }, filterDataAttrs(dataAttrs)), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(GridColumn, getColumnConfig(), /*#__PURE__*/React.createElement("div", {
75
+ }, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(GridColumn, getColumnConfig(), /*#__PURE__*/React.createElement("div", {
73
76
  className: cn('wrapper')
74
77
  }, badge && /*#__PURE__*/React.createElement("div", {
75
78
  className: cn('badge-wrapper')
@@ -120,7 +123,10 @@ Property.propTypes = {
120
123
  mergedValue: PropTypes.string,
121
124
  icon: PropTypes.node,
122
125
  fullWidth: PropTypes.bool,
123
- dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired),
126
+ dataAttrs: PropTypes.shape({
127
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
128
+ moreLink: PropTypes.objectOf(PropTypes.string.isRequired)
129
+ }),
124
130
  classes: PropTypes.shape({
125
131
  title: PropTypes.string,
126
132
  openedDescription: PropTypes.string,
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
3
 
3
4
  /* eslint-disable jsx-a11y/no-static-element-interactions */
@@ -5,7 +6,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
6
  /* eslint-disable jsx-a11y/click-events-have-key-events */
6
7
  import * as React from 'react';
7
8
  import { Collapse } from '@megafon/ui-core';
8
- import { cnCreate } from '@megafon/ui-helpers';
9
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
9
10
  import PropTypes from 'prop-types';
10
11
  import "./PropertyDescription.css";
11
12
  var cn = cnCreate('mfui-property-description');
@@ -15,7 +16,8 @@ var PropertyDescription = function PropertyDescription(_ref) {
15
16
  _ref$isCollapsible = _ref.isCollapsible,
16
17
  isCollapsible = _ref$isCollapsible === void 0 ? false : _ref$isCollapsible,
17
18
  _ref$classes = _ref.classes,
18
- classes = _ref$classes === void 0 ? {} : _ref$classes;
19
+ classes = _ref$classes === void 0 ? {} : _ref$classes,
20
+ dataAttrs = _ref.dataAttrs;
19
21
 
20
22
  var _React$useState = React.useState(false),
21
23
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -29,10 +31,11 @@ var PropertyDescription = function PropertyDescription(_ref) {
29
31
  if (isCollapsible) {
30
32
  return /*#__PURE__*/React.createElement("div", {
31
33
  className: cn([isOpened ? classes.open : undefined])
32
- }, /*#__PURE__*/React.createElement("span", {
33
- className: cn('collapse', classes.toggle),
34
+ }, /*#__PURE__*/React.createElement("span", _extends({
34
35
  onClick: handleClickDesc
35
- }, isOpened ? 'Скрыть' : 'Подробнее'), /*#__PURE__*/React.createElement(Collapse, {
36
+ }, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.moreLink), {
37
+ className: cn('collapse', classes.toggle)
38
+ }), isOpened ? 'Скрыть' : 'Подробнее'), /*#__PURE__*/React.createElement(Collapse, {
36
39
  className: cn('content'),
37
40
  classNameContainer: cn('content-inner'),
38
41
  isOpened: isOpened
@@ -50,6 +53,9 @@ PropertyDescription.propTypes = {
50
53
  classes: PropTypes.shape({
51
54
  open: PropTypes.string,
52
55
  toggle: PropTypes.string
56
+ }),
57
+ dataAttrs: PropTypes.shape({
58
+ moreLink: PropTypes.objectOf(PropTypes.string.isRequired)
53
59
  })
54
60
  };
55
61
  export default PropertyDescription;
@@ -6,6 +6,9 @@ export declare type Desc = {
6
6
  toggle?: string;
7
7
  open?: string;
8
8
  };
9
+ dataAttrs?: {
10
+ moreLink?: Record<string, string>;
11
+ };
9
12
  };
10
13
  export declare type Item = {
11
14
  title?: string[] | React.ReactNode[];
@@ -59,6 +59,10 @@ export interface IStoreBannerProps {
59
59
  /** Дополнительные data атрибуты к внутренним элементам */
60
60
  dataAttrs?: {
61
61
  root?: Record<string, string>;
62
+ button?: Record<string, string>;
63
+ linkApple?: Record<string, string>;
64
+ linkGoogle?: Record<string, string>;
65
+ linkHuawei?: Record<string, string>;
62
66
  };
63
67
  }
64
68
  declare const StoreBanner: React.FC<IStoreBannerProps>;
@@ -17,7 +17,6 @@ export var DeviceMask = {
17
17
  BLACK_IPHONE: 'black-iphone',
18
18
  WHITE_IPHONE: 'white-iphone'
19
19
  };
20
- var DEFAULT_TEXT_BUTTON = 'Установите приложение';
21
20
  var cn = cnCreate('mfui-store-banner');
22
21
 
23
22
  var StoreBanner = function StoreBanner(_ref) {
@@ -35,11 +34,11 @@ var StoreBanner = function StoreBanner(_ref) {
35
34
  linkHuawei = _ref.linkHuawei,
36
35
  linkButton = _ref.linkButton,
37
36
  _ref$textButton = _ref.textButton,
38
- textButton = _ref$textButton === void 0 ? DEFAULT_TEXT_BUTTON : _ref$textButton,
37
+ textButton = _ref$textButton === void 0 ? 'Установите приложение' : _ref$textButton,
39
38
  qrCode = _ref.qrCode,
40
39
  imageSrc = _ref.imageSrc,
41
40
  _ref$theme = _ref.theme,
42
- theme = _ref$theme === void 0 ? Theme.DEFAULT : _ref$theme,
41
+ theme = _ref$theme === void 0 ? 'default' : _ref$theme,
43
42
  deviceMask = _ref.deviceMask,
44
43
  rootRef = _ref.rootRef,
45
44
  dataAttrs = _ref.dataAttrs,
@@ -81,6 +80,9 @@ var StoreBanner = function StoreBanner(_ref) {
81
80
  }), !linkButton && /*#__PURE__*/React.createElement("div", {
82
81
  className: cn('stores')
83
82
  }, linkApple && /*#__PURE__*/React.createElement(StoreButton, {
83
+ dataAttrs: {
84
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.linkApple
85
+ },
84
86
  theme: StoreButtonTheme.APP_STORE,
85
87
  href: linkApple,
86
88
  onClick: onClickApple,
@@ -88,6 +90,9 @@ var StoreBanner = function StoreBanner(_ref) {
88
90
  'app-store': true
89
91
  }, appleLinkClassName)
90
92
  }), linkGoogle && /*#__PURE__*/React.createElement(StoreButton, {
93
+ dataAttrs: {
94
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.linkGoogle
95
+ },
91
96
  theme: StoreButtonTheme.GOOGLE_PLAY,
92
97
  href: linkGoogle,
93
98
  className: cn('store-link', {
@@ -95,6 +100,9 @@ var StoreBanner = function StoreBanner(_ref) {
95
100
  }, googleLinkClassName),
96
101
  onClick: onClickGoogle
97
102
  }), linkHuawei && /*#__PURE__*/React.createElement(StoreButton, {
103
+ dataAttrs: {
104
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.linkHuawei
105
+ },
98
106
  theme: StoreButtonTheme.HUAWEI_STORE,
99
107
  href: linkHuawei,
100
108
  className: cn('store-link', {
@@ -102,6 +110,9 @@ var StoreBanner = function StoreBanner(_ref) {
102
110
  }, huaweiLinkClassName),
103
111
  onClick: onClickHuawei
104
112
  })), linkButton && /*#__PURE__*/React.createElement(Button, {
113
+ dataAttrs: {
114
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button
115
+ },
105
116
  className: cn('button'),
106
117
  href: linkButton,
107
118
  theme: theme === 'green' ? 'purple' : 'green'
@@ -141,7 +152,11 @@ StoreBanner.propTypes = {
141
152
  }), PropTypes.any])]),
142
153
  theme: PropTypes.oneOf(Object.values(Theme)),
143
154
  dataAttrs: PropTypes.shape({
144
- root: PropTypes.objectOf(PropTypes.string.isRequired)
155
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
156
+ button: PropTypes.objectOf(PropTypes.string.isRequired),
157
+ linkApple: PropTypes.objectOf(PropTypes.string.isRequired),
158
+ linkGoogle: PropTypes.objectOf(PropTypes.string.isRequired),
159
+ linkHuawei: PropTypes.objectOf(PropTypes.string.isRequired)
145
160
  })
146
161
  };
147
162
  export default StoreBanner;
@@ -7,7 +7,7 @@ export declare enum Theme {
7
7
  HUAWEI_STORE = "huawei-store"
8
8
  }
9
9
  declare type LinkPropTypes = React.ComponentProps<typeof Link>;
10
- export declare type Props = Required<Pick<LinkPropTypes, 'href'>> & Pick<LinkPropTypes, 'onClick'> & {
10
+ export declare type Props = Required<Pick<LinkPropTypes, 'href'>> & Pick<LinkPropTypes, 'onClick' | 'dataAttrs'> & {
11
11
  /** Тема кнопки */
12
12
  theme: Theme;
13
13
  /** Дополнительный класс */
@@ -1,4 +1,21 @@
1
+ import "core-js/modules/es.symbol";
2
+ import "core-js/modules/es.array.index-of";
1
3
  import "core-js/modules/es.object.values";
4
+ import _extends from "@babel/runtime/helpers/extends";
5
+
6
+ var __rest = this && this.__rest || function (s, e) {
7
+ var t = {};
8
+
9
+ for (var p in s) {
10
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
11
+ }
12
+
13
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
14
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
15
+ }
16
+ return t;
17
+ };
18
+
2
19
  import * as React from 'react';
3
20
  import { Link } from '@megafon/ui-core';
4
21
  import { cnCreate } from '@megafon/ui-helpers';
@@ -14,18 +31,20 @@ export var Theme;
14
31
 
15
32
  var cn = cnCreate('mfui-store-button');
16
33
 
17
- var StoreButton = function StoreButton(_ref) {
18
- var href = _ref.href,
19
- onClick = _ref.onClick,
20
- theme = _ref.theme,
21
- className = _ref.className;
22
- return /*#__PURE__*/React.createElement(Link, {
34
+ var StoreButton = function StoreButton(_a) {
35
+ var href = _a.href,
36
+ onClick = _a.onClick,
37
+ theme = _a.theme,
38
+ className = _a.className,
39
+ rest = __rest(_a, ["href", "onClick", "theme", "className"]);
40
+
41
+ return /*#__PURE__*/React.createElement(Link, _extends({}, rest, {
23
42
  href: href,
24
43
  onClick: onClick,
25
44
  className: cn({
26
45
  theme: theme
27
46
  }, className)
28
- });
47
+ }));
29
48
  };
30
49
 
31
50
  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
  }
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import './TextWithIconItem.less';
3
3
  export interface ITextWithIconItem {
4
4
  /** Текст */
5
- text: string;
5
+ text: string | string[];
6
6
  /** Иконка */
7
7
  icon: React.ReactNode;
8
8
  /** Ссылка на корневой элемент */
@@ -22,7 +22,7 @@ var TextWithIconItem = function TextWithIconItem(_ref) {
22
22
  };
23
23
 
24
24
  TextWithIconItem.propTypes = {
25
- text: PropTypes.string.isRequired,
25
+ text: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.arrayOf(PropTypes.string.isRequired)]).isRequired,
26
26
  icon: PropTypes.node.isRequired,
27
27
  rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
28
28
  current: PropTypes.elementType
@@ -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>;
@@ -122,18 +122,24 @@ var VideoBanner = function VideoBanner(_ref2) {
122
122
  }, convert(cost, typographyConfig))), /*#__PURE__*/React.createElement("div", {
123
123
  className: cn('btns-wrapper')
124
124
  }, buttonTitle && /*#__PURE__*/React.createElement(Button, {
125
+ dataAttrs: {
126
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button
127
+ },
125
128
  className: cn(ClassName.BUTTON, [classes.button]),
126
129
  theme: buttonColor,
127
130
  href: buttonHref,
128
131
  onClick: onButtonClick,
129
132
  download: buttonDownload
130
133
  }, buttonTitle), linkTitle && /*#__PURE__*/React.createElement(TextLink, {
134
+ dataAttrs: {
135
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link
136
+ },
131
137
  className: cn(ClassName.LINK, [classes.link]),
132
138
  href: linkUrl,
133
139
  download: linkDownload,
134
140
  onClick: onLinkClick
135
141
  }, linkTitle)))));
136
- }, [classes.button, classes.link]);
142
+ }, [classes.button, classes.link, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link]);
137
143
  var renderVideo = React.useCallback(function () {
138
144
  switch (videoType) {
139
145
  case VideoType.YOUTUBE:
@@ -165,7 +171,7 @@ var VideoBanner = function VideoBanner(_ref2) {
165
171
  /*#__PURE__*/
166
172
  // eslint-disable-next-line jsx-a11y/media-has-caption
167
173
  React.createElement("video", {
168
- className: cn('video'),
174
+ className: cn('video', [classes.video]),
169
175
  autoPlay: true,
170
176
  loop: true,
171
177
  muted: isMuted
@@ -181,7 +187,7 @@ var VideoBanner = function VideoBanner(_ref2) {
181
187
  return null;
182
188
  }
183
189
  }
184
- }, [videoType, videoSrc, isMuted]);
190
+ }, [videoType, videoSrc, isMuted, classes.video]);
185
191
  React.useEffect(function () {
186
192
  var getImageSrc = function getImageSrc() {
187
193
  var windowWidth = window.innerWidth;
@@ -213,12 +219,16 @@ var VideoBanner = function VideoBanner(_ref2) {
213
219
  window.removeEventListener('resize', resizeHandlerThrottled);
214
220
  };
215
221
  }, [imageDesktop, imageDesktopWide, imageMobile, imageTablet]);
216
- return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs), {
222
+ return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
217
223
  className: cn([className, classes.root]),
218
224
  ref: rootRef
219
225
  }), /*#__PURE__*/React.createElement(ContentArea, null, /*#__PURE__*/React.createElement("div", {
220
226
  className: cn('wrapper')
221
227
  }, !!(breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && /*#__PURE__*/React.createElement(Breadcrumbs, {
228
+ dataAttrs: {
229
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.breadcrumbs,
230
+ link: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.breadcrumbsLink
231
+ },
222
232
  className: cn('breadcrumbs'),
223
233
  items: breadcrumbs,
224
234
  color: content === null || content === void 0 ? void 0 : content.textColor,
@@ -234,7 +244,13 @@ var VideoBanner = function VideoBanner(_ref2) {
234
244
  };
235
245
 
236
246
  VideoBanner.propTypes = {
237
- dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired),
247
+ dataAttrs: PropTypes.shape({
248
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
249
+ breadcrumbs: PropTypes.objectOf(PropTypes.string.isRequired),
250
+ breadcrumbsLink: PropTypes.objectOf(PropTypes.string.isRequired),
251
+ button: PropTypes.objectOf(PropTypes.string.isRequired),
252
+ link: PropTypes.objectOf(PropTypes.string.isRequired)
253
+ }),
238
254
  className: PropTypes.string,
239
255
  classes: PropTypes.shape({
240
256
  root: PropTypes.string,
@@ -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;
@@ -82,12 +82,15 @@ var VideoBlock = function VideoBlock(_ref) {
82
82
  }, title), /*#__PURE__*/React.createElement("div", {
83
83
  className: cn('description', [classes.description])
84
84
  }, description), buttonTitle && /*#__PURE__*/React.createElement(Button, {
85
+ dataAttrs: {
86
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button
87
+ },
85
88
  className: cn('button', [classes.button]),
86
89
  href: href,
87
90
  onClick: onButtonClick,
88
91
  download: buttonDownload
89
92
  }, buttonTitle));
90
- }, [classes.button, classes.description]);
93
+ }, [classes.button, classes.description, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button]);
91
94
  var renderGridColumns = React.useCallback(function () {
92
95
  var columns = [];
93
96
  var columnWidth = content ? '7' : '10';
@@ -115,7 +118,7 @@ var VideoBlock = function VideoBlock(_ref) {
115
118
  }, renderVideo())));
116
119
  return columns;
117
120
  }, [renderContent, renderVideo, content]);
118
- return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs), {
121
+ return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
119
122
  className: cn([className, classes.root]),
120
123
  ref: rootRef
121
124
  }), /*#__PURE__*/React.createElement(Grid, {
@@ -125,7 +128,10 @@ var VideoBlock = function VideoBlock(_ref) {
125
128
  };
126
129
 
127
130
  VideoBlock.propTypes = {
128
- dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired),
131
+ dataAttrs: PropTypes.shape({
132
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
133
+ button: PropTypes.objectOf(PropTypes.string.isRequired)
134
+ }),
129
135
  className: PropTypes.string,
130
136
  classes: PropTypes.shape({
131
137
  root: PropTypes.string,
@@ -4,6 +4,11 @@ export interface IAccordionBox {
4
4
  /** Дополнительные data атрибуты к внутренним элементам */
5
5
  dataAttrs?: {
6
6
  root?: Record<string, string>;
7
+ header?: Record<string, string>;
8
+ collapse?: Record<string, string>;
9
+ titleWrap?: Record<string, string>;
10
+ arrowUp?: Record<string, string>;
11
+ arrowDown?: Record<string, string>;
7
12
  };
8
13
  /** Ссылка на корневой элемент */
9
14
  rootRef?: React.Ref<HTMLDivElement>;
@@ -59,7 +59,12 @@ var AccordionBox = function AccordionBox(_a) {
59
59
 
60
60
  AccordionBox.propTypes = {
61
61
  dataAttrs: PropTypes.shape({
62
- root: PropTypes.objectOf(PropTypes.string.isRequired)
62
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
63
+ header: PropTypes.objectOf(PropTypes.string.isRequired),
64
+ collapse: PropTypes.objectOf(PropTypes.string.isRequired),
65
+ titleWrap: PropTypes.objectOf(PropTypes.string.isRequired),
66
+ arrowUp: PropTypes.objectOf(PropTypes.string.isRequired),
67
+ arrowDown: PropTypes.objectOf(PropTypes.string.isRequired)
63
68
  }),
64
69
  rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
65
70
  current: PropTypes.elementType
@@ -153,7 +153,7 @@ var cn = (0, _uiHelpers.cnCreate)('mfui-benefits-icons');
153
153
  var BenefitsIcons = function BenefitsIcons(_ref) {
154
154
  var rootRef = _ref.rootRef,
155
155
  _ref$iconPosition = _ref.iconPosition,
156
- iconPosition = _ref$iconPosition === void 0 ? _types.IconPositionEnum.LEFT_TOP : _ref$iconPosition,
156
+ iconPosition = _ref$iconPosition === void 0 ? 'left-top' : _ref$iconPosition,
157
157
  _ref$inOneColumn = _ref.inOneColumn,
158
158
  inOneColumn = _ref$inOneColumn === void 0 ? false : _ref$inOneColumn,
159
159
  items = _ref.items,
@@ -30,12 +30,12 @@ h5 {
30
30
  .mfui-breadcrumbs__item {
31
31
  position: relative;
32
32
  margin-right: 10px;
33
- padding-left: 22px;
33
+ padding-left: 26px;
34
34
  }
35
35
  .mfui-breadcrumbs__item:before {
36
36
  content: '→';
37
37
  position: absolute;
38
- top: -2px;
38
+ top: -1px;
39
39
  left: 0;
40
40
  }
41
41
  .mfui-breadcrumbs__item:first-child {