@megafon/ui-shared 2.0.0-beta.96 → 2.0.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 (211) hide show
  1. package/CHANGELOG.md +1634 -0
  2. package/README.md +0 -5
  3. package/dist/es/components/AccordionBox/AccordionBox.css +13 -0
  4. package/dist/es/components/AccordionBox/AccordionBox.d.ts +16 -1
  5. package/dist/es/components/AccordionBox/AccordionBox.js +29 -13
  6. package/dist/es/components/BannerBox/BannerBox.js +3 -2
  7. package/dist/es/components/BenefitsIcons/BenefitsIcons.d.ts +13 -2
  8. package/dist/es/components/BenefitsIcons/BenefitsIcons.js +82 -17
  9. package/dist/es/components/BenefitsIcons/BenefitsIconsTile.d.ts +2 -1
  10. package/dist/es/components/BenefitsIcons/BenefitsIconsTile.js +15 -14
  11. package/dist/es/components/BenefitsIcons/style/BenefitsIcons.css +3 -3
  12. package/dist/es/components/BenefitsIcons/style/BenefitsIconsTile.css +19 -12
  13. package/dist/es/components/BenefitsIcons/types.d.ts +7 -2
  14. package/dist/es/components/BenefitsIcons/types.js +4 -0
  15. package/dist/es/components/BenefitsPictures/BenefitsPictures.d.ts +10 -1
  16. package/dist/es/components/BenefitsPictures/BenefitsPictures.js +28 -12
  17. package/dist/es/components/BenefitsPictures/BenfitsPictures.css +4 -4
  18. package/dist/es/components/Breadcrumbs/Breadcrumbs.css +46 -0
  19. package/dist/es/components/Breadcrumbs/Breadcrumbs.d.ts +21 -0
  20. package/dist/es/components/Breadcrumbs/Breadcrumbs.js +49 -0
  21. package/dist/es/components/ButtonBanner/ButtonBanner.css +122 -0
  22. package/dist/es/components/ButtonBanner/ButtonBanner.d.ts +54 -0
  23. package/dist/es/components/ButtonBanner/ButtonBanner.js +107 -0
  24. package/dist/es/components/ButtonLinkBox/ButtonLinkBox.css +3 -3
  25. package/dist/es/components/ButtonLinkBox/ButtonLinkBox.d.ts +22 -2
  26. package/dist/es/components/ButtonLinkBox/ButtonLinkBox.js +37 -8
  27. package/dist/es/components/Card/Card.css +71 -44
  28. package/dist/es/components/Card/Card.d.ts +33 -3
  29. package/dist/es/components/Card/Card.js +103 -42
  30. package/dist/es/components/CardsBox/CardsBox.d.ts +10 -2
  31. package/dist/es/components/CardsBox/CardsBox.js +26 -13
  32. package/dist/es/components/CarouselBox/CarouselBox.js +3 -2
  33. package/dist/es/components/Container/Container.css +1815 -547
  34. package/dist/es/components/Container/Container.d.ts +11 -1
  35. package/dist/es/components/Container/Container.js +28 -6
  36. package/dist/es/components/DownloadLinks/DownloadLink.css +5 -5
  37. package/dist/es/components/DownloadLinks/DownloadLink.d.ts +7 -0
  38. package/dist/es/components/DownloadLinks/DownloadLink.js +28 -6
  39. package/dist/es/components/DownloadLinks/DownloadLinks.css +9 -6
  40. package/dist/es/components/DownloadLinks/DownloadLinks.d.ts +2 -0
  41. package/dist/es/components/DownloadLinks/DownloadLinks.js +18 -3
  42. package/dist/es/components/Instructions/Instructions.css +189 -130
  43. package/dist/es/components/Instructions/Instructions.d.ts +21 -2
  44. package/dist/es/components/Instructions/Instructions.js +115 -74
  45. package/dist/es/components/Instructions/img/iphone12.png +0 -0
  46. package/dist/es/components/PageTitle/PageTitle.css +80 -0
  47. package/dist/es/components/PageTitle/PageTitle.d.ts +23 -0
  48. package/dist/es/components/PageTitle/PageTitle.js +65 -0
  49. package/dist/es/components/Partners/Partners.css +22 -31
  50. package/dist/es/components/Partners/Partners.d.ts +13 -1
  51. package/dist/es/components/Partners/Partners.js +40 -18
  52. package/dist/es/components/PictureWithDescription/PictureWithDescription.css +25 -10
  53. package/dist/es/components/PictureWithDescription/PictureWithDescription.d.ts +13 -0
  54. package/dist/es/components/PictureWithDescription/PictureWithDescription.js +31 -7
  55. package/dist/es/components/Property/Property.css +79 -71
  56. package/dist/es/components/Property/Property.d.ts +21 -2
  57. package/dist/es/components/Property/Property.js +80 -34
  58. package/dist/es/components/Property/PropertyDescription.css +3 -3
  59. package/dist/es/components/Property/PropertyDescription.js +19 -21
  60. package/dist/es/components/Property/types.d.ts +7 -2
  61. package/dist/es/components/Steps/Steps.css +41 -0
  62. package/dist/es/components/Steps/Steps.d.ts +10 -0
  63. package/dist/es/components/Steps/Steps.js +35 -0
  64. package/dist/es/components/Steps/StepsItem.css +37 -0
  65. package/dist/es/components/Steps/StepsItem.d.ts +10 -0
  66. package/dist/es/components/Steps/StepsItem.js +26 -0
  67. package/dist/es/components/StoreBanner/StoreBanner.css +289 -0
  68. package/dist/es/components/StoreBanner/StoreBanner.d.ts +65 -0
  69. package/dist/es/components/StoreBanner/StoreBanner.js +145 -0
  70. package/dist/es/components/StoreBanner/doc/img/new-iphone-screen.png +0 -0
  71. package/dist/es/components/StoreBanner/doc/img/qr-code.png +0 -0
  72. package/dist/es/components/StoreBanner/doc/img/screen.png +0 -0
  73. package/dist/es/components/StoreBanner/img/android.png +0 -0
  74. package/dist/es/components/StoreBanner/img/black-iphone.png +0 -0
  75. package/dist/es/components/StoreBanner/img/new-iphone.png +0 -0
  76. package/dist/es/components/StoreBanner/img/white-iphone.png +0 -0
  77. package/dist/es/components/StoreButton/StoreButton.css +15 -0
  78. package/dist/es/components/StoreButton/StoreButton.d.ts +17 -0
  79. package/dist/es/components/StoreButton/StoreButton.js +37 -0
  80. package/dist/es/components/StoreButton/img/app-store.png +0 -0
  81. package/dist/es/components/StoreButton/img/google-play.png +0 -0
  82. package/dist/es/components/StoreButton/img/huawei-store.png +0 -0
  83. package/dist/es/components/Table/Table.css +67 -67
  84. package/dist/es/components/Table/Table.js +4 -4
  85. package/dist/es/components/Table/TableRow.js +1 -0
  86. package/dist/es/components/TabsBox/TabsBox.d.ts +4 -1
  87. package/dist/es/components/TabsBox/TabsBox.js +24 -3
  88. package/dist/es/components/TextBox/TextBox.css +7 -1
  89. package/dist/es/components/TextBox/TextBox.d.ts +8 -0
  90. package/dist/es/components/TextBox/TextBox.js +37 -5
  91. package/dist/es/components/TextBox/TextBoxPicture.css +24 -0
  92. package/dist/es/components/TextBox/TextBoxPicture.d.ts +17 -0
  93. package/dist/es/components/TextBox/TextBoxPicture.js +32 -0
  94. package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.css +15 -4
  95. package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +8 -2
  96. package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.js +34 -14
  97. package/dist/es/components/VideoBanner/VideoBanner.css +155 -76
  98. package/dist/es/components/VideoBanner/VideoBanner.d.ts +64 -13
  99. package/dist/es/components/VideoBanner/VideoBanner.js +202 -70
  100. package/dist/es/components/VideoBlock/VideoBlock.css +32 -28
  101. package/dist/es/components/VideoBlock/VideoBlock.d.ts +20 -6
  102. package/dist/es/components/VideoBlock/VideoBlock.js +63 -44
  103. package/dist/es/constants/throttleTime.d.ts +4 -0
  104. package/dist/es/constants/throttleTime.js +3 -0
  105. package/dist/es/index.d.ts +8 -0
  106. package/dist/es/index.js +8 -0
  107. package/dist/lib/components/AccordionBox/AccordionBox.css +13 -0
  108. package/dist/lib/components/AccordionBox/AccordionBox.d.ts +16 -1
  109. package/dist/lib/components/AccordionBox/AccordionBox.js +31 -19
  110. package/dist/lib/components/BannerBox/BannerBox.js +3 -5
  111. package/dist/lib/components/BenefitsIcons/BenefitsIcons.d.ts +13 -2
  112. package/dist/lib/components/BenefitsIcons/BenefitsIcons.js +84 -20
  113. package/dist/lib/components/BenefitsIcons/BenefitsIconsTile.d.ts +2 -1
  114. package/dist/lib/components/BenefitsIcons/BenefitsIconsTile.js +15 -16
  115. package/dist/lib/components/BenefitsIcons/style/BenefitsIcons.css +3 -3
  116. package/dist/lib/components/BenefitsIcons/style/BenefitsIconsTile.css +19 -12
  117. package/dist/lib/components/BenefitsIcons/types.d.ts +7 -2
  118. package/dist/lib/components/BenefitsIcons/types.js +7 -2
  119. package/dist/lib/components/BenefitsPictures/BenefitsPictures.d.ts +10 -1
  120. package/dist/lib/components/BenefitsPictures/BenefitsPictures.js +32 -15
  121. package/dist/lib/components/BenefitsPictures/BenfitsPictures.css +4 -4
  122. package/dist/lib/components/Breadcrumbs/Breadcrumbs.css +46 -0
  123. package/dist/lib/components/Breadcrumbs/Breadcrumbs.d.ts +21 -0
  124. package/dist/lib/components/Breadcrumbs/Breadcrumbs.js +65 -0
  125. package/dist/lib/components/ButtonBanner/ButtonBanner.css +122 -0
  126. package/dist/lib/components/ButtonBanner/ButtonBanner.d.ts +54 -0
  127. package/dist/lib/components/ButtonBanner/ButtonBanner.js +133 -0
  128. package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.css +3 -3
  129. package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.d.ts +22 -2
  130. package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.js +45 -11
  131. package/dist/lib/components/Card/Card.css +71 -44
  132. package/dist/lib/components/Card/Card.d.ts +33 -3
  133. package/dist/lib/components/Card/Card.js +118 -59
  134. package/dist/lib/components/CardsBox/CardsBox.d.ts +10 -2
  135. package/dist/lib/components/CardsBox/CardsBox.js +30 -16
  136. package/dist/lib/components/CarouselBox/CarouselBox.js +3 -5
  137. package/dist/lib/components/Container/Container.css +1815 -547
  138. package/dist/lib/components/Container/Container.d.ts +11 -1
  139. package/dist/lib/components/Container/Container.js +32 -11
  140. package/dist/lib/components/DownloadLinks/DownloadLink.css +5 -5
  141. package/dist/lib/components/DownloadLinks/DownloadLink.d.ts +7 -0
  142. package/dist/lib/components/DownloadLinks/DownloadLink.js +32 -11
  143. package/dist/lib/components/DownloadLinks/DownloadLinks.css +9 -6
  144. package/dist/lib/components/DownloadLinks/DownloadLinks.d.ts +2 -0
  145. package/dist/lib/components/DownloadLinks/DownloadLinks.js +20 -6
  146. package/dist/lib/components/Instructions/Instructions.css +189 -130
  147. package/dist/lib/components/Instructions/Instructions.d.ts +21 -2
  148. package/dist/lib/components/Instructions/Instructions.js +148 -104
  149. package/dist/lib/components/Instructions/img/iphone12.png +0 -0
  150. package/dist/lib/components/PageTitle/PageTitle.css +80 -0
  151. package/dist/lib/components/PageTitle/PageTitle.d.ts +23 -0
  152. package/dist/lib/components/PageTitle/PageTitle.js +85 -0
  153. package/dist/lib/components/Partners/Partners.css +22 -31
  154. package/dist/lib/components/Partners/Partners.d.ts +13 -1
  155. package/dist/lib/components/Partners/Partners.js +43 -23
  156. package/dist/lib/components/PictureWithDescription/PictureWithDescription.css +25 -10
  157. package/dist/lib/components/PictureWithDescription/PictureWithDescription.d.ts +13 -0
  158. package/dist/lib/components/PictureWithDescription/PictureWithDescription.js +33 -8
  159. package/dist/lib/components/Property/Property.css +79 -71
  160. package/dist/lib/components/Property/Property.d.ts +21 -2
  161. package/dist/lib/components/Property/Property.js +93 -53
  162. package/dist/lib/components/Property/PropertyDescription.css +3 -3
  163. package/dist/lib/components/Property/PropertyDescription.js +21 -25
  164. package/dist/lib/components/Property/types.d.ts +7 -2
  165. package/dist/lib/components/Steps/Steps.css +41 -0
  166. package/dist/lib/components/Steps/Steps.d.ts +10 -0
  167. package/dist/lib/components/Steps/Steps.js +55 -0
  168. package/dist/lib/components/Steps/StepsItem.css +37 -0
  169. package/dist/lib/components/Steps/StepsItem.d.ts +10 -0
  170. package/dist/lib/components/Steps/StepsItem.js +39 -0
  171. package/dist/lib/components/StoreBanner/StoreBanner.css +289 -0
  172. package/dist/lib/components/StoreBanner/StoreBanner.d.ts +65 -0
  173. package/dist/lib/components/StoreBanner/StoreBanner.js +169 -0
  174. package/dist/lib/components/StoreBanner/doc/img/new-iphone-screen.png +0 -0
  175. package/dist/lib/components/StoreBanner/doc/img/qr-code.png +0 -0
  176. package/dist/lib/components/StoreBanner/doc/img/screen.png +0 -0
  177. package/dist/lib/components/StoreBanner/img/android.png +0 -0
  178. package/dist/lib/components/StoreBanner/img/black-iphone.png +0 -0
  179. package/dist/lib/components/StoreBanner/img/new-iphone.png +0 -0
  180. package/dist/lib/components/StoreBanner/img/white-iphone.png +0 -0
  181. package/dist/lib/components/StoreButton/StoreButton.css +15 -0
  182. package/dist/lib/components/StoreButton/StoreButton.d.ts +17 -0
  183. package/dist/lib/components/StoreButton/StoreButton.js +58 -0
  184. package/dist/lib/components/StoreButton/img/app-store.png +0 -0
  185. package/dist/lib/components/StoreButton/img/google-play.png +0 -0
  186. package/dist/lib/components/StoreButton/img/huawei-store.png +0 -0
  187. package/dist/lib/components/Table/Table.css +67 -67
  188. package/dist/lib/components/Table/Table.js +6 -8
  189. package/dist/lib/components/Table/TableRow.js +1 -0
  190. package/dist/lib/components/TabsBox/TabsBox.d.ts +4 -1
  191. package/dist/lib/components/TabsBox/TabsBox.js +25 -2
  192. package/dist/lib/components/TextBox/TextBox.css +7 -1
  193. package/dist/lib/components/TextBox/TextBox.d.ts +8 -0
  194. package/dist/lib/components/TextBox/TextBox.js +39 -6
  195. package/dist/lib/components/TextBox/TextBoxPicture.css +24 -0
  196. package/dist/lib/components/TextBox/TextBoxPicture.d.ts +17 -0
  197. package/dist/lib/components/TextBox/TextBoxPicture.js +49 -0
  198. package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.css +15 -4
  199. package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +8 -2
  200. package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.js +39 -19
  201. package/dist/lib/components/VideoBanner/VideoBanner.css +155 -76
  202. package/dist/lib/components/VideoBanner/VideoBanner.d.ts +64 -13
  203. package/dist/lib/components/VideoBanner/VideoBanner.js +225 -89
  204. package/dist/lib/components/VideoBlock/VideoBlock.css +32 -28
  205. package/dist/lib/components/VideoBlock/VideoBlock.d.ts +20 -6
  206. package/dist/lib/components/VideoBlock/VideoBlock.js +76 -68
  207. package/dist/lib/constants/throttleTime.d.ts +4 -0
  208. package/dist/lib/constants/throttleTime.js +10 -0
  209. package/dist/lib/index.d.ts +8 -0
  210. package/dist/lib/index.js +64 -0
  211. package/package.json +19 -75
@@ -2,10 +2,6 @@
2
2
 
3
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
4
 
5
- require("core-js/modules/es.array.map");
6
-
7
- require("core-js/modules/es.array.slice");
8
-
9
5
  Object.defineProperty(exports, "__esModule", {
10
6
  value: true
11
7
  });
@@ -15,14 +11,18 @@ require("core-js/modules/es.array.map");
15
11
 
16
12
  require("core-js/modules/es.array.slice");
17
13
 
14
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
+
18
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
19
17
 
20
18
  var React = _interopRequireWildcard(require("react"));
21
19
 
22
- var PropTypes = _interopRequireWildcard(require("prop-types"));
23
-
24
20
  var _uiCore = require("@megafon/ui-core");
25
21
 
22
+ var _uiHelpers = require("@megafon/ui-helpers");
23
+
24
+ var PropTypes = _interopRequireWildcard(require("prop-types"));
25
+
26
26
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
27
27
 
28
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; }
@@ -32,20 +32,26 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
32
32
  var _slidesSettings;
33
33
 
34
34
  var MAX_GRID_ITEMS_LENGTH = 8;
35
- var slidesSettings = (_slidesSettings = {}, (0, _defineProperty2["default"])(_slidesSettings, _uiCore.breakpoints.mobileSmallStart, {
36
- slidesPerView: 'auto',
35
+ var slidesSettings = (_slidesSettings = {}, (0, _defineProperty2["default"])(_slidesSettings, _uiHelpers.breakpoints.MOBILE_SMALL_START, {
36
+ slidesPerView: 2,
37
37
  spaceBetween: 16
38
- }), (0, _defineProperty2["default"])(_slidesSettings, _uiCore.breakpoints.mobileBigStart, {
39
- slidesPerView: 'auto',
38
+ }), (0, _defineProperty2["default"])(_slidesSettings, _uiHelpers.breakpoints.MOBILE_MIDDLE_START, {
39
+ slidesPerView: 3,
40
40
  spaceBetween: 20
41
- }), (0, _defineProperty2["default"])(_slidesSettings, _uiCore.breakpoints.desktopSmallStart, {
41
+ }), (0, _defineProperty2["default"])(_slidesSettings, _uiHelpers.breakpoints.DESKTOP_SMALL_START, {
42
42
  slidesPerView: 4,
43
43
  spaceBetween: 20
44
44
  }), _slidesSettings);
45
- var cn = (0, _uiCore.cnCreate)('mfui-beta-partners');
45
+ var cn = (0, _uiHelpers.cnCreate)('mfui-partners');
46
46
 
47
47
  var Partners = function Partners(_ref) {
48
- var className = _ref.className,
48
+ var rootRef = _ref.rootRef,
49
+ _ref$classes = _ref.classes;
50
+ _ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
51
+ var root = _ref$classes.root,
52
+ itemClass = _ref$classes.itemClass,
53
+ dataAttrs = _ref.dataAttrs,
54
+ className = _ref.className,
49
55
  items = _ref.items,
50
56
  onChange = _ref.onChange,
51
57
  onNextClick = _ref.onNextClick,
@@ -56,19 +62,23 @@ var Partners = function Partners(_ref) {
56
62
  }
57
63
 
58
64
  var src = item.src,
59
- href = item.href;
65
+ href = item.href,
66
+ alt = item.alt;
60
67
  return /*#__PURE__*/React.createElement(_uiCore.Tile, {
61
68
  className: cn('tile'),
62
69
  href: href,
63
70
  shadowLevel: "low",
64
71
  isInteractive: !!href
65
72
  }, /*#__PURE__*/React.createElement("div", {
66
- className: cn('tile-inner')
73
+ className: cn('tile-inner', [itemClass])
74
+ }, /*#__PURE__*/React.createElement("div", {
75
+ className: cn('img-wrapper')
67
76
  }, /*#__PURE__*/React.createElement("img", {
68
77
  src: src,
78
+ alt: alt,
69
79
  className: cn('tile-img')
70
- })));
71
- }, []);
80
+ }))));
81
+ }, [itemClass]);
72
82
  var renderGrid = React.useCallback(function () {
73
83
  return /*#__PURE__*/React.createElement(_uiCore.Grid, {
74
84
  guttersLeft: "medium",
@@ -80,7 +90,7 @@ var Partners = function Partners(_ref) {
80
90
  mobile: "6"
81
91
  }, renderItem(item));
82
92
  }));
83
- }, [items]);
93
+ }, [items, renderItem]);
84
94
  var renderCarousel = React.useCallback(function () {
85
95
  var halfItemsLength = Math.ceil(items.length / 2);
86
96
  var topRow = items.slice(0, halfItemsLength);
@@ -96,17 +106,27 @@ var Partners = function Partners(_ref) {
96
106
  className: cn('slide')
97
107
  }, renderItem(item), renderItem(bottomRow[i]));
98
108
  }));
99
- }, [items]);
100
- return /*#__PURE__*/React.createElement("div", {
101
- className: cn([className])
102
- }, items.length > MAX_GRID_ITEMS_LENGTH ? renderCarousel() : renderGrid());
109
+ }, [items, onChange, onNextClick, onPrevClick, renderItem]);
110
+ return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
111
+ ref: rootRef,
112
+ className: cn([root, className])
113
+ }, (0, _uiHelpers.filterDataAttrs)(dataAttrs)), items.length > MAX_GRID_ITEMS_LENGTH ? renderCarousel() : renderGrid());
103
114
  };
104
115
 
105
116
  Partners.propTypes = {
117
+ rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
118
+ current: PropTypes.elementType
119
+ }), PropTypes.any])]),
120
+ classes: PropTypes.shape({
121
+ root: PropTypes.string,
122
+ itemClass: PropTypes.string
123
+ }),
124
+ dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired),
106
125
  className: PropTypes.string,
107
126
  items: PropTypes.arrayOf(PropTypes.shape({
108
127
  href: PropTypes.string,
109
- src: PropTypes.string.isRequired
128
+ src: PropTypes.string.isRequired,
129
+ alt: PropTypes.string.isRequired
110
130
  }).isRequired).isRequired,
111
131
  onChange: PropTypes.func,
112
132
  onNextClick: PropTypes.func,
@@ -6,7 +6,7 @@ h5 {
6
6
  margin: 0;
7
7
  }
8
8
  @media screen and (min-width: 1024px) {
9
- .mfui-beta-picture-with-description {
9
+ .mfui-picture-with-description {
10
10
  display: -webkit-box;
11
11
  display: -ms-flexbox;
12
12
  display: flex;
@@ -18,48 +18,63 @@ h5 {
18
18
  justify-content: center;
19
19
  }
20
20
  }
21
- .mfui-beta-picture-with-description__picture {
21
+ .mfui-picture-with-description__title {
22
+ margin-bottom: 24px;
23
+ }
24
+ .mfui-picture-with-description__picture {
22
25
  -ms-flex-item-align: start;
23
26
  align-self: flex-start;
24
27
  overflow: hidden;
25
28
  text-align: center;
26
29
  }
27
30
  @media screen and (max-width: 1023px) {
28
- .mfui-beta-picture-with-description__picture {
31
+ .mfui-picture-with-description__picture {
29
32
  margin: 0 auto 32px;
30
33
  }
31
34
  }
32
35
  @media screen and (min-width: 1024px) {
33
- .mfui-beta-picture-with-description__picture {
34
- width: 50%;
36
+ .mfui-picture-with-description__picture {
35
37
  -webkit-box-ordinal-group: 3;
36
38
  -ms-flex-order: 2;
37
39
  order: 2;
40
+ width: 50%;
38
41
  }
39
42
  }
40
43
  @media screen and (min-width: 1024px) {
41
- .mfui-beta-picture-with-description__picture_align_left {
44
+ .mfui-picture-with-description__picture_align_left {
42
45
  -webkit-box-ordinal-group: 1;
43
46
  -ms-flex-order: 0;
44
47
  order: 0;
45
48
  margin-right: 20px;
46
49
  }
47
50
  }
48
- .mfui-beta-picture-with-description__img {
51
+ .mfui-picture-with-description__img {
49
52
  width: 100%;
50
53
  max-width: 550px;
51
54
  height: 100%;
52
55
  }
56
+ .mfui-picture-with-description__content :first-child {
57
+ margin-top: 0 !important;
58
+ }
59
+ .mfui-picture-with-description__content :last-child {
60
+ margin-bottom: 0 !important;
61
+ }
53
62
  @media screen and (min-width: 1024px) {
54
- .mfui-beta-picture-with-description__articles {
55
- width: 50%;
63
+ .mfui-picture-with-description__articles {
56
64
  -webkit-box-ordinal-group: 2;
57
65
  -ms-flex-order: 1;
58
66
  order: 1;
67
+ width: 50%;
68
+ }
69
+ }
70
+ @media screen and (min-width: 1024px) {
71
+ .mfui-picture-with-description__articles_text-top-align {
72
+ -ms-flex-item-align: start;
73
+ align-self: flex-start;
59
74
  }
60
75
  }
61
76
  @media screen and (min-width: 1024px) {
62
- .mfui-beta-picture-with-description__articles_align_right {
77
+ .mfui-picture-with-description__articles_align_right {
63
78
  margin-right: 20px;
64
79
  }
65
80
  }
@@ -6,10 +6,23 @@ export declare const pictureAlignTypes: {
6
6
  };
7
7
  declare type PictureAlignTypesType = typeof pictureAlignTypes[keyof typeof pictureAlignTypes];
8
8
  export interface IPictureWithDescriptionProps {
9
+ /** Ссылка на корневой элемент */
10
+ rootRef?: React.Ref<HTMLDivElement>;
11
+ /** Дополнительный класс для корневого элемента */
12
+ className?: string;
13
+ /** Дополнительные классы для корневого и внутренних элементов */
14
+ classes?: {
15
+ root?: string;
16
+ title?: string;
17
+ };
18
+ /** Заголовок */
19
+ title?: string | React.ReactNode | React.ReactNode[];
9
20
  /** Url изображения */
10
21
  pictureUrl: string;
11
22
  /** Расположение изображения */
12
23
  pictureAlign?: PictureAlignTypesType;
24
+ /** Выравнивание текста по верхнему краю */
25
+ isTextTopAlign?: boolean;
13
26
  }
14
27
  declare const PictureWithDescription: React.FC<IPictureWithDescriptionProps>;
15
28
  export default PictureWithDescription;
@@ -9,10 +9,12 @@ exports["default"] = exports.pictureAlignTypes = void 0;
9
9
 
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
 
12
- var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
12
  var _uiCore = require("@megafon/ui-core");
15
13
 
14
+ var _uiHelpers = require("@megafon/ui-helpers");
15
+
16
+ var _propTypes = _interopRequireDefault(require("prop-types"));
17
+
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
19
 
18
20
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
@@ -24,15 +26,22 @@ var pictureAlignTypes = {
24
26
  RIGHT: 'right'
25
27
  };
26
28
  exports.pictureAlignTypes = pictureAlignTypes;
27
- var cn = (0, _uiCore.cnCreate)('mfui-beta-picture-with-description');
29
+ var cn = (0, _uiHelpers.cnCreate)('mfui-picture-with-description');
28
30
 
29
31
  var PictureWithDescription = function PictureWithDescription(_ref) {
30
- var pictureUrl = _ref.pictureUrl,
32
+ var rootRef = _ref.rootRef,
33
+ className = _ref.className,
34
+ _ref$classes = _ref.classes,
35
+ classes = _ref$classes === void 0 ? {} : _ref$classes,
36
+ title = _ref.title,
37
+ pictureUrl = _ref.pictureUrl,
31
38
  _ref$pictureAlign = _ref.pictureAlign,
32
39
  pictureAlign = _ref$pictureAlign === void 0 ? 'left' : _ref$pictureAlign,
40
+ isTextTopAlign = _ref.isTextTopAlign,
33
41
  children = _ref.children;
34
42
  return /*#__PURE__*/React.createElement("div", {
35
- className: cn()
43
+ className: cn([className, classes.root]),
44
+ ref: rootRef
36
45
  }, /*#__PURE__*/React.createElement("div", {
37
46
  className: cn('picture', {
38
47
  align: pictureAlign
@@ -43,14 +52,30 @@ var PictureWithDescription = function PictureWithDescription(_ref) {
43
52
  alt: ""
44
53
  })), /*#__PURE__*/React.createElement("div", {
45
54
  className: cn('articles', {
46
- align: pictureAlign
55
+ align: pictureAlign,
56
+ 'text-top-align': isTextTopAlign
47
57
  })
48
- }, children));
58
+ }, !!title && /*#__PURE__*/React.createElement(_uiCore.Header, {
59
+ className: cn('title', [classes.title]),
60
+ as: "h2"
61
+ }, title), /*#__PURE__*/React.createElement("div", {
62
+ className: cn('content')
63
+ }, children)));
49
64
  };
50
65
 
51
66
  PictureWithDescription.propTypes = {
67
+ rootRef: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].oneOfType([_propTypes["default"].shape({
68
+ current: _propTypes["default"].elementType
69
+ }), _propTypes["default"].any])]),
70
+ className: _propTypes["default"].string,
71
+ classes: _propTypes["default"].shape({
72
+ root: _propTypes["default"].string,
73
+ title: _propTypes["default"].string
74
+ }),
75
+ title: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node, _propTypes["default"].arrayOf(_propTypes["default"].node)]),
52
76
  pictureUrl: _propTypes["default"].string.isRequired,
53
- pictureAlign: _propTypes["default"].oneOf([pictureAlignTypes.LEFT, pictureAlignTypes.RIGHT])
77
+ pictureAlign: _propTypes["default"].oneOf([pictureAlignTypes.LEFT, pictureAlignTypes.RIGHT]),
78
+ isTextTopAlign: _propTypes["default"].bool
54
79
  };
55
80
  var _default = PictureWithDescription;
56
81
  exports["default"] = _default;
@@ -5,113 +5,121 @@ h4,
5
5
  h5 {
6
6
  margin: 0;
7
7
  }
8
- .mfui-beta-property {
9
- width: 100%;
10
- padding: 26px 24px;
8
+ .mfui-property__wrapper {
9
+ display: -webkit-box;
10
+ display: -ms-flexbox;
11
+ display: flex;
12
+ -webkit-box-orient: vertical;
13
+ -webkit-box-direction: normal;
14
+ -ms-flex-direction: column;
15
+ flex-direction: column;
16
+ padding: 24px 0;
11
17
  border-top: 1px solid #D8D8D8;
12
- position: relative;
13
- }
14
- .mfui-beta-property_border-bottom {
15
- border-bottom: 1px solid #D8D8D8;
16
18
  }
17
- @media screen and (max-width: 767px) {
18
- .mfui-beta-property {
19
- padding: 24px 0;
19
+ @media screen and (min-width: 1280px) {
20
+ .mfui-property__wrapper {
21
+ padding: 26px 0;
20
22
  }
21
23
  }
22
- @media screen and (min-width: 768px) and (max-width: 1023px) {
23
- .mfui-beta-property {
24
- padding: 24px;
25
- }
24
+ .mfui-property_border-bottom .mfui-property__wrapper {
25
+ border-bottom: 1px solid #D8D8D8;
26
26
  }
27
- .mfui-beta-property__item {
27
+ .mfui-property__content {
28
28
  display: -webkit-box;
29
29
  display: -ms-flexbox;
30
30
  display: flex;
31
- -webkit-box-align: baseline;
32
- -ms-flex-align: baseline;
33
- align-items: baseline;
34
31
  }
35
- .mfui-beta-property__item_multirow:first-child {
36
- margin-bottom: 10px;
32
+ .mfui-property__item {
33
+ display: -webkit-box;
34
+ display: -ms-flexbox;
35
+ display: flex;
37
36
  }
38
- .mfui-beta-property__icon {
37
+ .mfui-property__icon {
38
+ display: inline-block;
39
39
  width: 24px;
40
40
  height: 24px;
41
- overflow: hidden;
42
41
  margin-right: 9px;
43
42
  margin-left: 1px;
44
- display: inline-block;
43
+ overflow: hidden;
45
44
  vertical-align: bottom;
46
45
  }
47
- .mfui-beta-property__badge {
48
- border-radius: 2px;
49
- font-size: 12px;
46
+ .mfui-property__badge {
50
47
  padding: 2px 8px;
48
+ border-radius: 2px;
51
49
  color: #FFFFFF;
50
+ font-size: 12px;
52
51
  background: #FFA717;
53
52
  }
54
- .mfui-beta-property__inner {
55
- width: 431px;
56
- margin-right: 115px;
57
- }
58
- @media screen and (max-width: 767px) {
59
- .mfui-beta-property__inner {
60
- width: 165px;
61
- margin-right: 16px;
62
- }
53
+ .mfui-property__inner {
54
+ -webkit-box-flex: 1;
55
+ -ms-flex-positive: 1;
56
+ flex-grow: 1;
57
+ padding-right: 20px;
63
58
  }
64
59
  @media screen and (min-width: 768px) and (max-width: 1023px) {
65
- .mfui-beta-property__inner {
66
- width: 360px;
67
- margin-right: 135px;
60
+ .mfui-property__inner {
61
+ padding-right: 77px;
68
62
  }
69
63
  }
70
- @media screen and (min-width: 1024px) and (max-width: 1279px) {
71
- .mfui-beta-property__inner {
72
- width: 415px;
73
- margin-right: 96px;
64
+ @media screen and (max-width: 767px) {
65
+ .mfui-property__inner {
66
+ padding-right: 8px;
74
67
  }
75
68
  }
76
- .mfui-beta-property__merged-value {
77
- height: calc(100% - 26px * 2);
69
+ .mfui-property__items-wrapper {
70
+ width: 100%;
71
+ }
72
+ .mfui-property__value-wrapper {
78
73
  display: -webkit-box;
79
74
  display: -ms-flexbox;
80
75
  display: flex;
76
+ -ms-flex-negative: 0;
77
+ flex-shrink: 0;
78
+ -webkit-box-align: start;
79
+ -ms-flex-align: start;
80
+ align-items: flex-start;
81
+ -webkit-box-pack: end;
82
+ -ms-flex-pack: end;
83
+ justify-content: flex-end;
84
+ width: 35%;
85
+ }
86
+ @media screen and (max-width: 479px) {
87
+ .mfui-property__value-wrapper {
88
+ width: auto;
89
+ padding-left: 10px;
90
+ }
91
+ }
92
+ .mfui-property__value-wrapper_merged {
81
93
  -webkit-box-align: center;
82
94
  -ms-flex-align: center;
83
95
  align-items: center;
84
- position: absolute;
85
- left: calc(431px + 24px + 20px);
86
- top: 50%;
87
- -webkit-transform: translateY(-50%);
88
- transform: translateY(-50%);
89
96
  border-left: 1px solid #D8D8D8;
90
- padding-left: 94px;
91
97
  }
92
- @media screen and (max-width: 767px) {
93
- .mfui-beta-property__merged-value {
94
- height: calc(100% - 24px * 2);
95
- left: calc(165px + 0 + 8px);
96
- padding-left: 7px;
97
- }
98
+ .mfui-property__desc {
99
+ margin-top: 8px;
98
100
  }
99
- @media screen and (min-width: 768px) and (max-width: 1023px) {
100
- .mfui-beta-property__merged-value {
101
- height: calc(100% - 24px * 2);
102
- left: calc(360px + 24px + 77px);
103
- padding-left: 58px;
104
- }
101
+ .mfui-property__item + .mfui-property__item {
102
+ margin-top: 16px;
105
103
  }
106
- @media screen and (min-width: 1024px) and (max-width: 1279px) {
107
- .mfui-beta-property__merged-value {
108
- left: calc(415px + 24px + 20px);
109
- padding-left: 75px;
104
+ .mfui-property__value {
105
+ max-width: 234px;
106
+ white-space: pre-line;
107
+ text-align: right;
108
+ font-weight: 500;
109
+ font-size: 18px;
110
+ line-height: 24px;
111
+ letter-spacing: 0.5px;
112
+ }
113
+ @media screen and (min-width: 1280px) {
114
+ .mfui-property__value {
115
+ font-size: 20px;
116
+ line-height: 28px;
110
117
  }
111
118
  }
112
- .mfui-beta-property__desc {
113
- margin-top: 8px;
114
- }
115
- .mfui-beta-property__item ~ .mfui-beta-property__item {
116
- margin-top: 16px;
119
+ @media screen and (max-width: 767px) {
120
+ .mfui-property__value {
121
+ font-size: 15px;
122
+ line-height: 24px;
123
+ font-weight: 500;
124
+ }
117
125
  }
@@ -1,14 +1,33 @@
1
- import * as React from 'react';
1
+ import React, { Ref } from 'react';
2
2
  import './Property.less';
3
3
  import { Item } from './types';
4
4
  export interface IProperty {
5
+ /** Ссылка на корневой элемент */
6
+ rootRef?: Ref<HTMLDivElement>;
7
+ /** Массив с данными для строки */
5
8
  items: Item[];
9
+ /** Дополнительный класс для основного контейнера */
6
10
  className?: string;
11
+ /** Текст для бейджа */
7
12
  badge?: string;
13
+ /** Наличие нижней границы */
8
14
  borderBottom?: boolean;
15
+ /** Единое значение для всей строки */
9
16
  mergedValue?: string;
17
+ /** Иконка для строки */
10
18
  icon?: React.ReactNode;
11
- multirow?: boolean;
19
+ /** Растягивание компонента на всю доступную ширину */
20
+ fullWidth?: boolean;
21
+ /** Дата атрибуты для корневого элемента */
22
+ dataAttrs?: {
23
+ [key: string]: string;
24
+ };
25
+ /** Дополнительные классы для внутренних элементов */
26
+ classes?: {
27
+ title?: string;
28
+ openedDescription?: string;
29
+ toggleDescription?: string;
30
+ };
12
31
  }
13
32
  declare const Property: React.FC<IProperty>;
14
33
  export default Property;