@megafon/ui-shared 2.0.0-beta.99 → 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 +1610 -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
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React, { Ref } from 'react';
2
2
  import './Container.less';
3
3
  export declare const BackgroundColors: {
4
4
  readonly DEFAULT: "default";
@@ -9,8 +9,18 @@ export declare const BackgroundColors: {
9
9
  };
10
10
  declare type BackgroundColorType = typeof BackgroundColors[keyof typeof BackgroundColors];
11
11
  declare type Props = {
12
+ /** Атрибут корневого тега */
13
+ id?: string;
14
+ /** Ссылка на корневой элемент */
15
+ rootRef?: Ref<HTMLDivElement>;
16
+ /** Дополнительный класс корневого элемента */
17
+ className?: string;
12
18
  /** Цвет фона */
13
19
  backgroundColor?: BackgroundColorType;
20
+ /** Отключить отступ сверху */
21
+ disablePaddingTop?: boolean;
22
+ /** Отключить отступ снизу */
23
+ disablePaddingBottom?: boolean;
14
24
  };
15
25
  declare const Container: React.FC<Props>;
16
26
  export default Container;
@@ -1,19 +1,21 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports["default"] = exports.BackgroundColors = void 0;
9
7
 
10
- var React = _interopRequireWildcard(require("react"));
8
+ require("core-js/modules/es.object.values");
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
11
 
12
12
  var _uiCore = require("@megafon/ui-core");
13
13
 
14
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
14
+ var _uiHelpers = require("@megafon/ui-helpers");
15
15
 
16
- 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; }
16
+ var _propTypes = _interopRequireDefault(require("prop-types"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
19
 
18
20
  var BackgroundColors = {
19
21
  DEFAULT: 'default',
@@ -23,18 +25,37 @@ var BackgroundColors = {
23
25
  PURPLE: 'purple'
24
26
  };
25
27
  exports.BackgroundColors = BackgroundColors;
26
- var cn = (0, _uiCore.cnCreate)('mfui-beta-container');
28
+ var cn = (0, _uiHelpers.cnCreate)('mfui-container');
27
29
 
28
30
  var Container = function Container(_ref) {
29
31
  var _ref$backgroundColor = _ref.backgroundColor,
30
32
  backgroundColor = _ref$backgroundColor === void 0 ? 'default' : _ref$backgroundColor,
31
- children = _ref.children;
32
- return /*#__PURE__*/React.createElement("div", {
33
+ rootRef = _ref.rootRef,
34
+ id = _ref.id,
35
+ className = _ref.className,
36
+ children = _ref.children,
37
+ disablePaddingTop = _ref.disablePaddingTop,
38
+ disablePaddingBottom = _ref.disablePaddingBottom;
39
+ return /*#__PURE__*/_react["default"].createElement("div", {
33
40
  className: cn({
34
- 'bg-color': backgroundColor
35
- })
36
- }, /*#__PURE__*/React.createElement(_uiCore.ContentArea, null, children));
41
+ 'bg-color': backgroundColor,
42
+ 'disable-padding-top': disablePaddingTop,
43
+ 'disable-padding-bottom': disablePaddingBottom
44
+ }, [className]),
45
+ ref: rootRef,
46
+ id: id
47
+ }, /*#__PURE__*/_react["default"].createElement(_uiCore.ContentArea, null, children));
37
48
  };
38
49
 
50
+ Container.propTypes = {
51
+ id: _propTypes["default"].string,
52
+ className: _propTypes["default"].string,
53
+ backgroundColor: _propTypes["default"].oneOf(Object.values(BackgroundColors)),
54
+ rootRef: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].oneOfType([_propTypes["default"].shape({
55
+ current: _propTypes["default"].elementType
56
+ }), _propTypes["default"].any])]),
57
+ disablePaddingTop: _propTypes["default"].bool,
58
+ disablePaddingBottom: _propTypes["default"].bool
59
+ };
39
60
  var _default = Container;
40
61
  exports["default"] = _default;
@@ -5,12 +5,12 @@ h4,
5
5
  h5 {
6
6
  margin: 0;
7
7
  }
8
- .mfui-beta-download-link {
8
+ .mfui-download-link {
9
9
  display: -webkit-box;
10
10
  display: -ms-flexbox;
11
11
  display: flex;
12
12
  }
13
- .mfui-beta-download-link__icon {
13
+ .mfui-download-link__icon {
14
14
  -ms-flex-negative: 0;
15
15
  flex-shrink: 0;
16
16
  width: 40px;
@@ -18,16 +18,16 @@ h5 {
18
18
  margin-right: 22px;
19
19
  }
20
20
  @media screen and (max-width: 1023px) {
21
- .mfui-beta-download-link__icon {
21
+ .mfui-download-link__icon {
22
22
  width: 32px;
23
23
  height: 32px;
24
24
  }
25
25
  }
26
- .mfui-beta-download-link__icon-svg {
26
+ .mfui-download-link__icon-svg {
27
27
  width: inherit;
28
28
  height: inherit;
29
29
  }
30
- .mfui-beta-download-link__info {
30
+ .mfui-download-link__info {
31
31
  margin: 0;
32
32
  font-size: 12px;
33
33
  line-height: 16px;
@@ -1,6 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import './DownloadLink.less';
3
3
  export interface IDownloadLink {
4
+ /** Ссылка на корневой элемент */
5
+ rootRef?: React.Ref<HTMLDivElement>;
4
6
  /** Адресы ссылки */
5
7
  href: string;
6
8
  /** Текст ссылки */
@@ -11,6 +13,11 @@ export interface IDownloadLink {
11
13
  fileSize: string;
12
14
  /** Дополнительный класс для компонента */
13
15
  className?: string;
16
+ /** Дополнительные классы для корневого и внутренних элементов */
17
+ classes?: {
18
+ root?: string;
19
+ link?: string;
20
+ };
14
21
  /** Обработчик клика по ссылке */
15
22
  onClick?: (e: React.SyntheticEvent<EventTarget>) => void;
16
23
  }
@@ -2,8 +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.concat");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
@@ -11,21 +9,33 @@ exports["default"] = void 0;
11
9
 
12
10
  require("core-js/modules/es.array.concat");
13
11
 
14
- var React = _interopRequireWildcard(require("react"));
12
+ require("core-js/modules/es.string.link");
15
13
 
16
- var PropTypes = _interopRequireWildcard(require("prop-types"));
14
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
+
16
+ var React = _interopRequireWildcard(require("react"));
17
17
 
18
18
  var _uiCore = require("@megafon/ui-core");
19
19
 
20
- var _basic32Download_ = _interopRequireDefault(require("@megafon/ui-core/dist/icons/basic-32-download_32"));
20
+ var _uiHelpers = require("@megafon/ui-helpers");
21
21
 
22
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
22
+ var PropTypes = _interopRequireWildcard(require("prop-types"));
23
23
 
24
24
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
25
25
 
26
26
  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; }
27
27
 
28
- var cn = (0, _uiCore.cnCreate)('mfui-beta-download-link');
28
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
+
30
+ var DownloadIcon = function DownloadIcon(props) {
31
+ return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
32
+ viewBox: "0 0 40 40"
33
+ }, props), /*#__PURE__*/React.createElement("path", {
34
+ d: "M21 6v14l2.68-4 1.65 1-4.44 6.74h-1.77L14.68 17l1.65-1L19 20V6zM8 20H6a14 14 0 0028 0h-2a12 12 0 01-24 0z"
35
+ }));
36
+ };
37
+
38
+ var cn = (0, _uiHelpers.cnCreate)('mfui-download-link');
29
39
 
30
40
  var DownloadLink = function DownloadLink(_ref) {
31
41
  var href = _ref.href,
@@ -33,15 +43,19 @@ var DownloadLink = function DownloadLink(_ref) {
33
43
  extension = _ref.extension,
34
44
  fileSize = _ref.fileSize,
35
45
  onClick = _ref.onClick,
36
- className = _ref.className;
46
+ className = _ref.className,
47
+ _ref$classes = _ref.classes,
48
+ classes = _ref$classes === void 0 ? {} : _ref$classes,
49
+ rootRef = _ref.rootRef;
37
50
  return /*#__PURE__*/React.createElement("div", {
38
- className: cn([className])
51
+ className: cn([className, classes.root]),
52
+ ref: rootRef
39
53
  }, /*#__PURE__*/React.createElement("div", {
40
54
  className: cn('icon')
41
- }, /*#__PURE__*/React.createElement(_basic32Download_["default"], {
55
+ }, /*#__PURE__*/React.createElement(DownloadIcon, {
42
56
  className: cn('icon-svg')
43
57
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_uiCore.TextLink, {
44
- className: cn('link'),
58
+ className: cn('link', [classes.link]),
45
59
  href: href,
46
60
  onClick: onClick,
47
61
  download: true
@@ -51,11 +65,18 @@ var DownloadLink = function DownloadLink(_ref) {
51
65
  };
52
66
 
53
67
  DownloadLink.propTypes = {
68
+ rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
69
+ current: PropTypes.elementType
70
+ }), PropTypes.any])]),
54
71
  href: PropTypes.string.isRequired,
55
72
  text: PropTypes.string.isRequired,
56
73
  extension: PropTypes.string.isRequired,
57
74
  fileSize: PropTypes.string.isRequired,
58
75
  className: PropTypes.string,
76
+ classes: PropTypes.shape({
77
+ root: PropTypes.string,
78
+ link: PropTypes.string
79
+ }),
59
80
  onClick: PropTypes.func
60
81
  };
61
82
  var _default = DownloadLink;
@@ -6,28 +6,31 @@ h5 {
6
6
  margin: 0;
7
7
  }
8
8
  @media screen and (min-width: 1024px) {
9
- .mfui-beta-download-links__column:nth-child(n + 4) {
9
+ .mfui-download-links__column:nth-child(n + 4) {
10
10
  margin-top: 24px;
11
11
  }
12
12
  }
13
13
  @media screen and (min-width: 768px) and (max-width: 1023px) {
14
- .mfui-beta-download-links__column:nth-child(n + 3) {
14
+ .mfui-download-links__column:nth-child(n + 3) {
15
15
  margin-top: 24px;
16
16
  }
17
17
  }
18
18
  @media screen and (max-width: 767px) {
19
- .mfui-beta-download-links__column:not(:first-child) {
19
+ .mfui-download-links__column:not(:first-child) {
20
20
  margin-top: 24px;
21
21
  }
22
22
  }
23
23
  @media screen and (min-width: 768px) {
24
- .mfui-beta-download-links_count_2 .mfui-beta-download-links__column:nth-child(n + 2) {
24
+ .mfui-download-links_count_2 .mfui-download-links__column:nth-child(n + 2) {
25
25
  margin-top: 24px;
26
26
  }
27
27
  }
28
28
  @media screen and (min-width: 768px) {
29
- .mfui-beta-download-links_count_3 .mfui-beta-download-links__column:nth-child(n + 3),
30
- .mfui-beta-download-links_count_4 .mfui-beta-download-links__column:nth-child(n + 3) {
29
+ .mfui-download-links_count_3 .mfui-download-links__column:nth-child(n + 3),
30
+ .mfui-download-links_count_4 .mfui-download-links__column:nth-child(n + 3) {
31
31
  margin-top: 24px;
32
32
  }
33
33
  }
34
+ .mfui-download-links__item:not(:first-child) {
35
+ margin-top: 24px;
36
+ }
@@ -2,6 +2,8 @@ import * as React from 'react';
2
2
  import './DownloadLinks.less';
3
3
  import { IDownloadLink } from './DownloadLink';
4
4
  interface IDownloadLinks {
5
+ /** Выстраивать ссылки в одну колонку вне зависимости от количества */
6
+ inOneColumn?: boolean;
5
7
  children: Array<React.ReactElement<IDownloadLink>> | React.ReactElement<IDownloadLink>;
6
8
  }
7
9
  declare const DownloadLinks: React.FC<IDownloadLinks>;
@@ -2,8 +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
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
@@ -15,10 +13,12 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
15
13
 
16
14
  var React = _interopRequireWildcard(require("react"));
17
15
 
18
- var PropTypes = _interopRequireWildcard(require("prop-types"));
19
-
20
16
  var _uiCore = require("@megafon/ui-core");
21
17
 
18
+ var _uiHelpers = require("@megafon/ui-helpers");
19
+
20
+ var PropTypes = _interopRequireWildcard(require("prop-types"));
21
+
22
22
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
23
23
 
24
24
  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; }
@@ -55,10 +55,23 @@ var getColumnConfig = function getColumnConfig(itemsCount) {
55
55
  }
56
56
  };
57
57
 
58
- var cn = (0, _uiCore.cnCreate)('mfui-beta-download-links');
58
+ var cn = (0, _uiHelpers.cnCreate)('mfui-download-links');
59
59
 
60
60
  var DownloadLinks = function DownloadLinks(_ref) {
61
- var children = _ref.children;
61
+ var _ref$inOneColumn = _ref.inOneColumn,
62
+ inOneColumn = _ref$inOneColumn === void 0 ? false : _ref$inOneColumn,
63
+ children = _ref.children;
64
+
65
+ if (inOneColumn) {
66
+ return /*#__PURE__*/React.createElement("div", {
67
+ className: cn()
68
+ }, React.Children.map(children, function (child) {
69
+ return /*#__PURE__*/React.createElement("div", {
70
+ className: cn('item')
71
+ }, child);
72
+ }));
73
+ }
74
+
62
75
  var itemsCount = React.Children.count(children);
63
76
  var columnConfig = getColumnConfig(itemsCount);
64
77
  return /*#__PURE__*/React.createElement("div", {
@@ -75,6 +88,7 @@ var DownloadLinks = function DownloadLinks(_ref) {
75
88
  };
76
89
 
77
90
  DownloadLinks.propTypes = {
91
+ inOneColumn: PropTypes.bool,
78
92
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element]).isRequired
79
93
  };
80
94
  var _default = DownloadLinks;