@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
@@ -0,0 +1,46 @@
1
+ h1,
2
+ h2,
3
+ h3,
4
+ h4,
5
+ h5 {
6
+ margin: 0;
7
+ }
8
+ .mfui-breadcrumbs {
9
+ display: -webkit-box;
10
+ display: -ms-flexbox;
11
+ display: flex;
12
+ -ms-flex-wrap: wrap;
13
+ flex-wrap: wrap;
14
+ }
15
+ .mfui-breadcrumbs_color_black .mfui-breadcrumbs__item:before {
16
+ color: #333333;
17
+ }
18
+ .mfui-breadcrumbs_color_white .mfui-breadcrumbs__item:before {
19
+ color: #FFFFFF;
20
+ }
21
+ .mfui-breadcrumbs__icon {
22
+ position: relative;
23
+ width: 14px;
24
+ height: 3px;
25
+ margin-right: 10px;
26
+ }
27
+ .mfui-breadcrumbs__item {
28
+ position: relative;
29
+ margin-right: 10px;
30
+ padding-left: 22px;
31
+ }
32
+ .mfui-breadcrumbs__item:before {
33
+ content: '→';
34
+ position: absolute;
35
+ top: -2px;
36
+ left: 0;
37
+ }
38
+ .mfui-breadcrumbs__item:first-child {
39
+ padding-left: 0;
40
+ }
41
+ .mfui-breadcrumbs__item:first-child:before {
42
+ display: none;
43
+ }
44
+ .mfui-breadcrumbs__item:last-child {
45
+ pointer-events: none;
46
+ }
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import './Breadcrumbs.less';
3
+ declare type ItemType = {
4
+ title: string;
5
+ href?: string;
6
+ };
7
+ export declare const TextColor: {
8
+ readonly BLACK: "black";
9
+ readonly WHITE: "white";
10
+ };
11
+ declare type TextColorType = typeof TextColor[keyof typeof TextColor];
12
+ export declare type Props = {
13
+ className?: string;
14
+ classes?: {
15
+ item?: string;
16
+ };
17
+ items: ItemType[];
18
+ color?: TextColorType;
19
+ };
20
+ declare const Breadcrumbs: React.FC<Props>;
21
+ export default Breadcrumbs;
@@ -0,0 +1,49 @@
1
+ import "core-js/modules/es.array.map";
2
+ import "core-js/modules/es.object.values";
3
+ import React from 'react';
4
+ import { TextLink } from '@megafon/ui-core';
5
+ import { cnCreate } from '@megafon/ui-helpers';
6
+ import PropTypes from 'prop-types';
7
+ import "./Breadcrumbs.css";
8
+ export var TextColor = {
9
+ BLACK: 'black',
10
+ WHITE: 'white'
11
+ };
12
+ var cn = cnCreate('mfui-breadcrumbs');
13
+
14
+ var Breadcrumbs = function Breadcrumbs(_ref) {
15
+ var items = _ref.items,
16
+ _ref$color = _ref.color,
17
+ color = _ref$color === void 0 ? 'black' : _ref$color,
18
+ className = _ref.className,
19
+ _ref$classes = _ref.classes,
20
+ classes = _ref$classes === void 0 ? {} : _ref$classes;
21
+ return /*#__PURE__*/React.createElement("div", {
22
+ className: cn({
23
+ color: color
24
+ }, className)
25
+ }, items.map(function (_ref2) {
26
+ var title = _ref2.title,
27
+ href = _ref2.href;
28
+ return /*#__PURE__*/React.createElement("div", {
29
+ className: cn('item', classes.item),
30
+ key: title
31
+ }, /*#__PURE__*/React.createElement(TextLink, {
32
+ href: href,
33
+ color: color
34
+ }, title));
35
+ }));
36
+ };
37
+
38
+ Breadcrumbs.propTypes = {
39
+ className: PropTypes.string,
40
+ classes: PropTypes.shape({
41
+ item: PropTypes.string
42
+ }),
43
+ items: PropTypes.arrayOf(PropTypes.shape({
44
+ title: PropTypes.string.isRequired,
45
+ href: PropTypes.string
46
+ }).isRequired).isRequired,
47
+ color: PropTypes.oneOf(Object.values(TextColor))
48
+ };
49
+ export default Breadcrumbs;
@@ -0,0 +1,122 @@
1
+ h1,
2
+ h2,
3
+ h3,
4
+ h4,
5
+ h5 {
6
+ margin: 0;
7
+ }
8
+ .mfui-button-banner {
9
+ position: relative;
10
+ border: 1px solid #D8D8D8;
11
+ background-color: #FFFFFF;
12
+ border-radius: 0 8px 8px 0;
13
+ }
14
+ @media screen and (max-width: 767px) {
15
+ .mfui-button-banner {
16
+ border-radius: 0 0 8px 8px;
17
+ }
18
+ }
19
+ .mfui-button-banner:before {
20
+ content: '';
21
+ position: absolute;
22
+ top: 0;
23
+ bottom: 0;
24
+ left: 0;
25
+ width: 12px;
26
+ background-color: #00B956;
27
+ border-radius: 0 12px 12px 0;
28
+ }
29
+ @media screen and (max-width: 767px) {
30
+ .mfui-button-banner:before {
31
+ border-radius: 0 0 12px 12px;
32
+ }
33
+ }
34
+ @media screen and (max-width: 767px) {
35
+ .mfui-button-banner:before {
36
+ right: 0;
37
+ bottom: auto;
38
+ width: auto;
39
+ height: 12px;
40
+ }
41
+ }
42
+ .mfui-button-banner__content {
43
+ -webkit-box-sizing: border-box;
44
+ box-sizing: border-box;
45
+ }
46
+ @media screen and (max-width: 767px) {
47
+ .mfui-button-banner__content {
48
+ padding: 36px 16px 32px;
49
+ text-align: center;
50
+ }
51
+ }
52
+ @media screen and (min-width: 768px) and (max-width: 1023px) {
53
+ .mfui-button-banner__content {
54
+ padding: 32px 0;
55
+ }
56
+ }
57
+ @media screen and (min-width: 1024px) and (max-width: 1279px) {
58
+ .mfui-button-banner__content {
59
+ padding: 40px 0;
60
+ }
61
+ }
62
+ @media screen and (min-width: 1280px) {
63
+ .mfui-button-banner__content {
64
+ padding: 48px 0;
65
+ }
66
+ }
67
+ .mfui-button-banner__media {
68
+ display: -webkit-box;
69
+ display: -ms-flexbox;
70
+ display: flex;
71
+ -webkit-box-align: center;
72
+ -ms-flex-align: center;
73
+ align-items: center;
74
+ -webkit-box-pack: center;
75
+ -ms-flex-pack: center;
76
+ justify-content: center;
77
+ height: 100%;
78
+ padding: 0 20px;
79
+ overflow: hidden;
80
+ background-repeat: no-repeat;
81
+ background-position: center;
82
+ border-radius: 0 8px 8px 0;
83
+ }
84
+ @media screen and (max-width: 767px) {
85
+ .mfui-button-banner__media {
86
+ border-radius: 0 0 8px 8px;
87
+ }
88
+ }
89
+ @media screen and (max-width: 767px) {
90
+ .mfui-button-banner__media {
91
+ height: auto;
92
+ padding: 0 16px 24px;
93
+ }
94
+ }
95
+ .mfui-button-banner_scaling_cover .mfui-button-banner__media {
96
+ background-size: cover;
97
+ }
98
+ .mfui-button-banner_scaling_contain .mfui-button-banner__media {
99
+ background-size: contain;
100
+ }
101
+ .mfui-button-banner__header {
102
+ margin-bottom: 16px;
103
+ }
104
+ .mfui-button-banner__button {
105
+ max-width: 100%;
106
+ }
107
+ .mfui-button-banner__text {
108
+ font-size: 15px;
109
+ line-height: 24px;
110
+ font-weight: 400;
111
+ }
112
+ .mfui-button-banner_image .mfui-button-banner__media {
113
+ padding: 0;
114
+ }
115
+ @media screen and (max-width: 767px) {
116
+ .mfui-button-banner_image .mfui-button-banner__media {
117
+ height: 222px;
118
+ }
119
+ }
120
+ .mfui-button-banner_image .mfui-button-banner__text {
121
+ margin-bottom: 32px;
122
+ }
@@ -0,0 +1,54 @@
1
+ import React, { Ref } from 'react';
2
+ import './ButtonBanner.less';
3
+ export declare const ButtonColor: {
4
+ readonly GREEN: "green";
5
+ readonly PURPLE: "purple";
6
+ };
7
+ declare type ButtonColorType = typeof ButtonColor[keyof typeof ButtonColor];
8
+ export declare const ButtonTarget: {
9
+ readonly SELF: "_self";
10
+ readonly BLANK: "_blank";
11
+ };
12
+ declare type ButtonTargetType = typeof ButtonTarget[keyof typeof ButtonTarget];
13
+ export declare const ImageScaling: {
14
+ readonly COVER: "cover";
15
+ readonly CONTAIN: "contain";
16
+ };
17
+ declare type ImageScalingType = typeof ImageScaling[keyof typeof ImageScaling];
18
+ export interface IButtonBannerProps {
19
+ /** Дата атрибуты для корневого элемента */
20
+ dataAttrs?: {
21
+ [key: string]: string;
22
+ };
23
+ /** Дополнительный css класс для корневого элемента */
24
+ className?: string;
25
+ /** Дополнительный css классы для корневого и внутренних элементов */
26
+ classes?: {
27
+ root?: string;
28
+ button?: string;
29
+ };
30
+ /** Ссылка на корневой элемент */
31
+ rootRef?: Ref<HTMLDivElement>;
32
+ /** Заголовок */
33
+ title: string;
34
+ /** Текст */
35
+ text: string | React.ReactNode | React.ReactNode[];
36
+ /** URL изображения */
37
+ imageUrl?: string;
38
+ /** Текст кнопки */
39
+ buttonText: string;
40
+ /** URL кнопки */
41
+ buttonUrl?: string;
42
+ /** Download - свойство тега <a> */
43
+ buttonDownload?: boolean;
44
+ /** Target - свойство тега <a> */
45
+ buttonTarget?: ButtonTargetType;
46
+ /** Цвет кнопки */
47
+ buttonColor?: ButtonColorType;
48
+ /** Масштабирование изображения */
49
+ imageScaling?: ImageScalingType;
50
+ /** Обработчик клика по кнопке */
51
+ onButtonClick?: (e: React.SyntheticEvent<EventTarget>) => void;
52
+ }
53
+ declare const ButtonBanner: React.FC<IButtonBannerProps>;
54
+ export default ButtonBanner;
@@ -0,0 +1,107 @@
1
+ import "core-js/modules/es.object.values";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import React from 'react';
4
+ import { Button, Grid, GridColumn, Header } from '@megafon/ui-core';
5
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
6
+ import * as PropTypes from 'prop-types';
7
+ import "./ButtonBanner.css";
8
+ export var ButtonColor = {
9
+ GREEN: 'green',
10
+ PURPLE: 'purple'
11
+ };
12
+ export var ButtonTarget = {
13
+ SELF: '_self',
14
+ BLANK: '_blank'
15
+ };
16
+ export var ImageScaling = {
17
+ COVER: 'cover',
18
+ CONTAIN: 'contain'
19
+ };
20
+
21
+ var getMediaStyle = function getMediaStyle(imageUrl) {
22
+ return imageUrl ? {
23
+ backgroundImage: "url(".concat(imageUrl, ")")
24
+ } : undefined;
25
+ };
26
+
27
+ var cn = cnCreate('mfui-button-banner');
28
+
29
+ var ButtonBanner = function ButtonBanner(_ref) {
30
+ var dataAttrs = _ref.dataAttrs,
31
+ className = _ref.className,
32
+ _ref$classes = _ref.classes,
33
+ classes = _ref$classes === void 0 ? {} : _ref$classes,
34
+ rootRef = _ref.rootRef,
35
+ title = _ref.title,
36
+ text = _ref.text,
37
+ _ref$imageUrl = _ref.imageUrl,
38
+ imageUrl = _ref$imageUrl === void 0 ? '' : _ref$imageUrl,
39
+ buttonText = _ref.buttonText,
40
+ buttonUrl = _ref.buttonUrl,
41
+ buttonDownload = _ref.buttonDownload,
42
+ _ref$buttonTarget = _ref.buttonTarget,
43
+ buttonTarget = _ref$buttonTarget === void 0 ? '_self' : _ref$buttonTarget,
44
+ _ref$buttonColor = _ref.buttonColor,
45
+ buttonColor = _ref$buttonColor === void 0 ? 'green' : _ref$buttonColor,
46
+ _ref$imageScaling = _ref.imageScaling,
47
+ imageScaling = _ref$imageScaling === void 0 ? 'cover' : _ref$imageScaling,
48
+ onButtonClick = _ref.onButtonClick;
49
+ var buttonElem = /*#__PURE__*/React.createElement(Button, {
50
+ className: cn('button', [classes.button]),
51
+ href: buttonUrl,
52
+ target: buttonTarget,
53
+ theme: buttonColor,
54
+ onClick: onButtonClick,
55
+ download: buttonDownload
56
+ }, buttonText);
57
+ return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs), {
58
+ className: cn({
59
+ image: !!imageUrl,
60
+ scaling: imageScaling
61
+ }, [className, classes.root]),
62
+ ref: rootRef
63
+ }), /*#__PURE__*/React.createElement(Grid, {
64
+ guttersLeft: "medium"
65
+ }, /*#__PURE__*/React.createElement(GridColumn, {
66
+ all: "6",
67
+ mobile: "12",
68
+ leftOffsetTablet: "1",
69
+ leftOffsetDesktop: "1",
70
+ leftOffsetWide: "1"
71
+ }, /*#__PURE__*/React.createElement("div", {
72
+ className: cn('content')
73
+ }, /*#__PURE__*/React.createElement(Header, {
74
+ className: cn('header'),
75
+ as: "h2"
76
+ }, title), /*#__PURE__*/React.createElement("div", {
77
+ className: cn('text')
78
+ }, text), !!imageUrl && buttonElem)), /*#__PURE__*/React.createElement(GridColumn, {
79
+ all: "5",
80
+ mobile: "12"
81
+ }, /*#__PURE__*/React.createElement("div", {
82
+ className: cn('media'),
83
+ style: getMediaStyle(imageUrl)
84
+ }, !imageUrl && buttonElem))));
85
+ };
86
+
87
+ ButtonBanner.propTypes = {
88
+ dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired),
89
+ className: PropTypes.string,
90
+ classes: PropTypes.shape({
91
+ root: PropTypes.string,
92
+ button: PropTypes.string
93
+ }),
94
+ rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
95
+ current: PropTypes.elementType
96
+ }), PropTypes.any])]),
97
+ title: PropTypes.string.isRequired,
98
+ text: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,
99
+ imageUrl: PropTypes.string,
100
+ buttonText: PropTypes.string.isRequired,
101
+ buttonUrl: PropTypes.string,
102
+ buttonDownload: PropTypes.bool,
103
+ buttonTarget: PropTypes.oneOf(Object.values(ButtonTarget)),
104
+ buttonColor: PropTypes.oneOf(Object.values(ButtonColor)),
105
+ onButtonClick: PropTypes.func
106
+ };
107
+ export default ButtonBanner;
@@ -5,15 +5,15 @@ h4,
5
5
  h5 {
6
6
  margin: 0;
7
7
  }
8
- .mfui-beta-button-link-box {
8
+ .mfui-button-link-box {
9
9
  font-family: inherit;
10
10
  font-size: 15px;
11
11
  line-height: 24px;
12
12
  font-weight: 400;
13
13
  }
14
- .mfui-beta-button-link-box__row:not(:last-child) {
14
+ .mfui-button-link-box__row:not(:last-child) {
15
15
  margin-bottom: 32px;
16
16
  }
17
- .mfui-beta-button-link-box_h-align_center {
17
+ .mfui-button-link-box_h-align_center {
18
18
  text-align: center;
19
19
  }
@@ -1,18 +1,38 @@
1
- import * as React from 'react';
1
+ import React, { Ref } from 'react';
2
2
  import './ButtonLinkBox.less';
3
3
  export interface IButtonLinkBoxProps {
4
+ /** Дата атрибуты для корневого элемента */
5
+ dataAttrs?: {
6
+ [key: string]: string;
7
+ };
4
8
  /** Дополнительный класс корневого элемента */
5
9
  className?: string;
10
+ /** Дополнительные классы для корневого и внутренних элементов */
11
+ classes?: {
12
+ root?: string;
13
+ button?: string;
14
+ link?: string;
15
+ };
16
+ /** Ссылка на корневой элемент */
17
+ rootRef?: Ref<HTMLDivElement>;
6
18
  /** Заголовок кнопки */
7
19
  buttonTitle?: string;
8
20
  /** Ссылка кнопки */
9
21
  buttonUrl?: string;
22
+ /** Добавляет атрибут download для тега <a> компонента Button */
23
+ buttonDownload?: boolean;
10
24
  /** Цвет кнопки */
11
25
  buttonColor?: 'green' | 'purple';
26
+ /** Target свойство кнопки */
27
+ buttonTarget?: '_self' | '_blank' | '_parent' | '_top';
12
28
  /** Заголовок ссылки */
13
29
  linkTitle?: string;
14
- /** Адрес ссылки */
30
+ /** Добавляет атрибут download для тега <a> компонента Button */
15
31
  linkUrl?: string;
32
+ /** Target свойство ссылки */
33
+ linkTarget?: '_self' | '_blank' | '_parent' | '_top';
34
+ /** Добавляет атрибут download к свойству тега <a> */
35
+ linkDownload?: boolean;
16
36
  /** Горизонтальное выравнивание */
17
37
  hAlign?: 'center' | 'left';
18
38
  /** Обработчик клика по кнопке */
@@ -1,46 +1,75 @@
1
- import * as React from 'react';
1
+ import "core-js/modules/es.string.link";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import React from 'react';
4
+ import { Button, TextLink } from '@megafon/ui-core';
5
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
2
6
  import * as PropTypes from 'prop-types';
3
- import { cnCreate, Button, TextLink } from '@megafon/ui-core';
4
7
  import "./ButtonLinkBox.css";
5
- var cn = cnCreate('mfui-beta-button-link-box');
8
+ var cn = cnCreate('mfui-button-link-box');
6
9
 
7
10
  var ButtonLinkBox = function ButtonLinkBox(_ref) {
8
- var buttonTitle = _ref.buttonTitle,
11
+ var dataAttrs = _ref.dataAttrs,
12
+ rootRef = _ref.rootRef,
13
+ buttonTitle = _ref.buttonTitle,
9
14
  buttonUrl = _ref.buttonUrl,
15
+ buttonDownload = _ref.buttonDownload,
10
16
  _ref$buttonColor = _ref.buttonColor,
11
17
  buttonColor = _ref$buttonColor === void 0 ? 'green' : _ref$buttonColor,
12
18
  linkTitle = _ref.linkTitle,
13
19
  linkUrl = _ref.linkUrl,
20
+ linkDownload = _ref.linkDownload,
14
21
  hAlign = _ref.hAlign,
15
22
  className = _ref.className,
23
+ buttonTarget = _ref.buttonTarget,
24
+ linkTarget = _ref.linkTarget,
25
+ _ref$classes = _ref.classes,
26
+ classes = _ref$classes === void 0 ? {} : _ref$classes,
16
27
  onButtonClick = _ref.onButtonClick,
17
28
  onLinkClick = _ref.onLinkClick;
18
- return /*#__PURE__*/React.createElement("div", {
29
+ return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs), {
19
30
  className: cn({
20
31
  'h-align': hAlign
21
- }, className)
22
- }, buttonTitle && /*#__PURE__*/React.createElement("div", {
32
+ }, [className, classes.root]),
33
+ ref: rootRef
34
+ }), buttonTitle && /*#__PURE__*/React.createElement("div", {
23
35
  className: cn('row')
24
36
  }, /*#__PURE__*/React.createElement(Button, {
37
+ className: classes.button,
25
38
  href: buttonUrl,
26
39
  theme: buttonColor,
27
- onClick: onButtonClick
40
+ onClick: onButtonClick,
41
+ target: buttonTarget,
42
+ download: buttonDownload
28
43
  }, buttonTitle)), linkTitle && /*#__PURE__*/React.createElement("div", {
29
44
  className: cn('row')
30
45
  }, /*#__PURE__*/React.createElement(TextLink, {
46
+ className: classes.link,
31
47
  href: linkUrl,
48
+ download: linkDownload,
32
49
  underlineVisibility: "always",
50
+ target: linkTarget,
33
51
  onClick: onLinkClick
34
52
  }, linkTitle)));
35
53
  };
36
54
 
37
55
  ButtonLinkBox.propTypes = {
56
+ dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired),
38
57
  className: PropTypes.string,
58
+ classes: PropTypes.shape({
59
+ root: PropTypes.string,
60
+ button: PropTypes.string,
61
+ link: PropTypes.string
62
+ }),
63
+ rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
64
+ current: PropTypes.elementType
65
+ }), PropTypes.any])]),
39
66
  buttonTitle: PropTypes.string,
40
67
  buttonUrl: PropTypes.string,
68
+ buttonDownload: PropTypes.bool,
41
69
  buttonColor: PropTypes.oneOf(['green', 'purple']),
42
70
  linkTitle: PropTypes.string,
43
71
  linkUrl: PropTypes.string,
72
+ linkDownload: PropTypes.bool,
44
73
  hAlign: PropTypes.oneOf(['center']),
45
74
  onButtonClick: PropTypes.func,
46
75
  onLinkClick: PropTypes.func