@megafon/ui-shared 9.0.0-alpha.8 → 9.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 (177) hide show
  1. package/dist/es/components/BenefitCards/BenefitCard/BenefitCard.css +1 -0
  2. package/dist/es/components/BenefitCards/BenefitCard/BenefitCard.d.ts +13 -0
  3. package/dist/es/components/BenefitCards/BenefitCard/BenefitCard.js +59 -0
  4. package/dist/es/components/BenefitCards/BenefitCards.css +1 -0
  5. package/dist/es/components/BenefitCards/BenefitCards.d.ts +27 -0
  6. package/dist/es/components/BenefitCards/BenefitCards.js +35 -0
  7. package/dist/es/components/BenefitCards/helpers.d.ts +1 -0
  8. package/dist/es/components/BenefitCards/helpers.js +19 -0
  9. package/dist/es/components/BenefitCards/types.d.ts +24 -0
  10. package/dist/es/components/BenefitCards/types.js +1 -0
  11. package/dist/es/components/BlogBox/components/BlogBoxTile.css +1 -1
  12. package/dist/es/components/Breadcrumbs/Breadcrumbs.d.ts +2 -0
  13. package/dist/es/components/Breadcrumbs/Breadcrumbs.js +3 -0
  14. package/dist/es/components/Breadcrumbs/components/BreadcrumbsItem.d.ts +1 -0
  15. package/dist/es/components/Breadcrumbs/components/BreadcrumbsItem.js +18 -13
  16. package/dist/es/components/Card/Card.css +1 -1
  17. package/dist/es/components/Card/Card.d.ts +2 -1
  18. package/dist/es/components/Card/Card.js +23 -16
  19. package/dist/es/components/Card/types.d.ts +3 -5
  20. package/dist/es/components/CardsOnBackground/CardsOnBackground.css +1 -0
  21. package/dist/es/components/CardsOnBackground/CardsOnBackground.d.ts +37 -0
  22. package/dist/es/components/CardsOnBackground/CardsOnBackground.js +98 -0
  23. package/dist/es/components/CardsOnBackground/components/CardOnBackground.css +1 -0
  24. package/dist/es/components/CardsOnBackground/components/CardOnBackground.d.ts +22 -0
  25. package/dist/es/components/CardsOnBackground/components/CardOnBackground.js +94 -0
  26. package/dist/es/components/CardsOnBackground/types.d.ts +47 -0
  27. package/dist/es/components/CardsOnBackground/types.js +10 -0
  28. package/dist/es/components/CardsOnBackground/useUniformHeights.d.ts +9 -0
  29. package/dist/es/components/CardsOnBackground/useUniformHeights.js +88 -0
  30. package/dist/es/components/Container/Container.css +1 -1
  31. package/dist/es/components/Container/Container.d.ts +4 -0
  32. package/dist/es/components/Container/Container.js +4 -1
  33. package/dist/es/components/DarkGradientCards/components/DarkGradientCard.css +1 -1
  34. package/dist/es/components/DownloadLinks/DownloadLink.css +1 -1
  35. package/dist/es/components/DownloadLinks/DownloadLink.js +3 -1
  36. package/dist/es/components/ImageBanner/ImageBanner.d.ts +3 -0
  37. package/dist/es/components/ImageBanner/ImageBanner.js +3 -1
  38. package/dist/es/components/InfoCards/components/InfoCard/InfoCard.css +1 -1
  39. package/dist/es/components/InfoCards/components/InfoCard/InfoCard.js +4 -2
  40. package/dist/es/components/Instructions/Instructions.css +1 -1
  41. package/dist/es/components/Instructions/Instructions.d.ts +23 -7
  42. package/dist/es/components/Instructions/Instructions.js +46 -30
  43. package/dist/es/components/Instructions/img/android.png +0 -0
  44. package/dist/es/components/Instructions/img/laptop.png +0 -0
  45. package/dist/es/components/Instructions/img/logo-base.png +0 -0
  46. package/dist/es/components/Instructions/img/logo-cropped-base-with-opacity.png +0 -0
  47. package/dist/es/components/Instructions/img/logo-cropped-spb-sky-3.png +0 -0
  48. package/dist/es/components/Instructions/img/logo-spb-sky-0.png +0 -0
  49. package/dist/es/components/Partners/Partners.css +1 -1
  50. package/dist/es/components/Partners/Partners.d.ts +3 -8
  51. package/dist/es/components/Partners/Partners.js +20 -31
  52. package/dist/es/components/Partners/components/PartnersItem/PartnersItem.css +1 -0
  53. package/dist/es/components/Partners/components/PartnersItem/PartnersItem.d.ts +12 -0
  54. package/dist/es/components/Partners/components/PartnersItem/PartnersItem.js +33 -0
  55. package/dist/es/components/Partners/types.d.ts +7 -0
  56. package/dist/es/components/Partners/types.js +1 -0
  57. package/dist/es/components/PictureBox/PictureBox.d.ts +1 -0
  58. package/dist/es/components/PictureBox/PictureBox.js +2 -0
  59. package/dist/es/components/PromoBanner/components/PromoBannerSlide/PromoBannerSlide.d.ts +2 -0
  60. package/dist/es/components/PromoBanner/components/PromoBannerSlide/PromoBannerSlide.js +2 -0
  61. package/dist/es/components/PromoCards/components/PromoCard/PromoCard.css +1 -1
  62. package/dist/es/components/ServiceCards/components/ServiceCard/ServiceCard.css +1 -1
  63. package/dist/es/components/ServiceCards/components/ServiceCard/ServiceCard.js +1 -1
  64. package/dist/es/components/StepperBox/StepperBox.d.ts +11 -0
  65. package/dist/es/components/StepperBox/StepperBox.js +36 -0
  66. package/dist/es/components/StoreButton/StoreButton.css +1 -1
  67. package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.css +1 -1
  68. package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +27 -1
  69. package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.js +31 -24
  70. package/dist/es/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
  71. package/dist/es/hooks/useIsomorphicLayoutEffect.js +6 -0
  72. package/dist/es/index.d.ts +7 -2
  73. package/dist/es/index.js +7 -2
  74. package/dist/lib/components/BenefitCards/BenefitCard/BenefitCard.css +1 -0
  75. package/dist/lib/components/BenefitCards/BenefitCard/BenefitCard.d.ts +13 -0
  76. package/dist/lib/components/BenefitCards/BenefitCard/BenefitCard.js +68 -0
  77. package/dist/lib/components/BenefitCards/BenefitCards.css +1 -0
  78. package/dist/lib/components/BenefitCards/BenefitCards.d.ts +27 -0
  79. package/dist/lib/components/BenefitCards/BenefitCards.js +44 -0
  80. package/dist/lib/components/BenefitCards/helpers.d.ts +1 -0
  81. package/dist/lib/components/BenefitCards/helpers.js +26 -0
  82. package/dist/lib/components/BenefitCards/types.d.ts +24 -0
  83. package/dist/lib/components/BenefitCards/types.js +5 -0
  84. package/dist/lib/components/BlogBox/components/BlogBoxTile.css +1 -1
  85. package/dist/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -0
  86. package/dist/lib/components/Breadcrumbs/Breadcrumbs.js +3 -0
  87. package/dist/lib/components/Breadcrumbs/components/BreadcrumbsItem.d.ts +1 -0
  88. package/dist/lib/components/Breadcrumbs/components/BreadcrumbsItem.js +18 -13
  89. package/dist/lib/components/Card/Card.css +1 -1
  90. package/dist/lib/components/Card/Card.d.ts +2 -1
  91. package/dist/lib/components/Card/Card.js +22 -15
  92. package/dist/lib/components/Card/types.d.ts +3 -5
  93. package/dist/lib/components/CardsOnBackground/CardsOnBackground.css +1 -0
  94. package/dist/lib/components/CardsOnBackground/CardsOnBackground.d.ts +37 -0
  95. package/dist/lib/components/CardsOnBackground/CardsOnBackground.js +107 -0
  96. package/dist/lib/components/CardsOnBackground/components/CardOnBackground.css +1 -0
  97. package/dist/lib/components/CardsOnBackground/components/CardOnBackground.d.ts +22 -0
  98. package/dist/lib/components/CardsOnBackground/components/CardOnBackground.js +100 -0
  99. package/dist/lib/components/CardsOnBackground/types.d.ts +47 -0
  100. package/dist/lib/components/CardsOnBackground/types.js +16 -0
  101. package/dist/lib/components/CardsOnBackground/useUniformHeights.d.ts +9 -0
  102. package/dist/lib/components/CardsOnBackground/useUniformHeights.js +95 -0
  103. package/dist/lib/components/Container/Container.css +1 -1
  104. package/dist/lib/components/Container/Container.d.ts +4 -0
  105. package/dist/lib/components/Container/Container.js +4 -1
  106. package/dist/lib/components/DarkGradientCards/components/DarkGradientCard.css +1 -1
  107. package/dist/lib/components/DownloadLinks/DownloadLink.css +1 -1
  108. package/dist/lib/components/DownloadLinks/DownloadLink.js +3 -1
  109. package/dist/lib/components/ImageBanner/ImageBanner.d.ts +3 -0
  110. package/dist/lib/components/ImageBanner/ImageBanner.js +3 -1
  111. package/dist/lib/components/InfoCards/components/InfoCard/InfoCard.css +1 -1
  112. package/dist/lib/components/InfoCards/components/InfoCard/InfoCard.js +4 -2
  113. package/dist/lib/components/Instructions/Instructions.css +1 -1
  114. package/dist/lib/components/Instructions/Instructions.d.ts +23 -7
  115. package/dist/lib/components/Instructions/Instructions.js +47 -30
  116. package/dist/lib/components/Instructions/img/android.png +0 -0
  117. package/dist/lib/components/Instructions/img/laptop.png +0 -0
  118. package/dist/lib/components/Instructions/img/logo-base.png +0 -0
  119. package/dist/lib/components/Instructions/img/logo-cropped-base-with-opacity.png +0 -0
  120. package/dist/lib/components/Instructions/img/logo-cropped-spb-sky-3.png +0 -0
  121. package/dist/lib/components/Instructions/img/logo-spb-sky-0.png +0 -0
  122. package/dist/lib/components/Partners/Partners.css +1 -1
  123. package/dist/lib/components/Partners/Partners.d.ts +3 -8
  124. package/dist/lib/components/Partners/Partners.js +19 -30
  125. package/dist/lib/components/Partners/components/PartnersItem/PartnersItem.css +1 -0
  126. package/dist/lib/components/Partners/components/PartnersItem/PartnersItem.d.ts +12 -0
  127. package/dist/lib/components/Partners/components/PartnersItem/PartnersItem.js +42 -0
  128. package/dist/lib/components/Partners/types.d.ts +7 -0
  129. package/dist/lib/components/Partners/types.js +5 -0
  130. package/dist/lib/components/PictureBox/PictureBox.d.ts +1 -0
  131. package/dist/lib/components/PictureBox/PictureBox.js +2 -0
  132. package/dist/lib/components/PromoBanner/components/PromoBannerSlide/PromoBannerSlide.d.ts +2 -0
  133. package/dist/lib/components/PromoBanner/components/PromoBannerSlide/PromoBannerSlide.js +2 -0
  134. package/dist/lib/components/PromoCards/components/PromoCard/PromoCard.css +1 -1
  135. package/dist/lib/components/ServiceCards/components/ServiceCard/ServiceCard.css +1 -1
  136. package/dist/lib/components/ServiceCards/components/ServiceCard/ServiceCard.js +1 -1
  137. package/dist/lib/components/StepperBox/StepperBox.d.ts +11 -0
  138. package/dist/lib/components/StepperBox/StepperBox.js +46 -0
  139. package/dist/lib/components/StoreButton/StoreButton.css +1 -1
  140. package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.css +1 -1
  141. package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +27 -1
  142. package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.js +30 -23
  143. package/dist/lib/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
  144. package/dist/lib/hooks/useIsomorphicLayoutEffect.js +13 -0
  145. package/dist/lib/index.d.ts +7 -2
  146. package/dist/lib/index.js +45 -10
  147. package/package.json +6 -6
  148. package/dist/es/components/Instructions/img/android-new.png +0 -0
  149. package/dist/es/components/Instructions/img/blackIphone.png +0 -0
  150. package/dist/es/components/Instructions/img/iphone-new.png +0 -0
  151. package/dist/es/components/Instructions/img/iphone12.png +0 -0
  152. package/dist/es/components/Instructions/img/laptop-new.png +0 -0
  153. package/dist/es/components/Stepper/Stepper.css +0 -1
  154. package/dist/es/components/Stepper/Stepper.d.ts +0 -52
  155. package/dist/es/components/Stepper/Stepper.js +0 -159
  156. package/dist/es/components/Stepper/StepperItem.css +0 -1
  157. package/dist/es/components/Stepper/StepperItem.d.ts +0 -57
  158. package/dist/es/components/Stepper/StepperItem.js +0 -99
  159. package/dist/es/components/Stepper/img/separator-mobile.png +0 -0
  160. package/dist/es/components/Stepper/img/separator-vertical.png +0 -0
  161. package/dist/es/components/Stepper/img/separator.png +0 -0
  162. package/dist/lib/components/Instructions/img/android-new.png +0 -0
  163. package/dist/lib/components/Instructions/img/blackIphone.png +0 -0
  164. package/dist/lib/components/Instructions/img/iphone-new.png +0 -0
  165. package/dist/lib/components/Instructions/img/iphone12.png +0 -0
  166. package/dist/lib/components/Instructions/img/laptop-new.png +0 -0
  167. package/dist/lib/components/Stepper/Stepper.css +0 -1
  168. package/dist/lib/components/Stepper/Stepper.d.ts +0 -52
  169. package/dist/lib/components/Stepper/Stepper.js +0 -168
  170. package/dist/lib/components/Stepper/StepperItem.css +0 -1
  171. package/dist/lib/components/Stepper/StepperItem.d.ts +0 -57
  172. package/dist/lib/components/Stepper/StepperItem.js +0 -108
  173. package/dist/lib/components/Stepper/img/separator-mobile.png +0 -0
  174. package/dist/lib/components/Stepper/img/separator-vertical.png +0 -0
  175. package/dist/lib/components/Stepper/img/separator.png +0 -0
  176. /package/dist/es/components/Instructions/img/{iphone15.png → iphone.png} +0 -0
  177. /package/dist/lib/components/Instructions/img/{iphone15.png → iphone.png} +0 -0
@@ -0,0 +1 @@
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-9-benefit-cards{display:grid;gap:20px;grid-template-columns:repeat(6,1fr)}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(3)) .mfui-9-benefit-cards__item:nth-child(-n+3){grid-column:span 3}.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(3)) .mfui-9-benefit-cards__item:first-child{grid-column:span 6}}@media screen and (min-width:1024px){.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(3)) .mfui-9-benefit-cards__item:nth-child(-n+3){grid-column:span 2}}.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(3)) .mfui-9-benefit-cards__item{grid-column:span 6}@media screen and (min-width:768px){.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(4)) .mfui-9-benefit-cards__item:nth-child(-n+4){grid-column:span 3}}.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(4)) .mfui-9-benefit-cards__item{grid-column:span 6}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(5)) .mfui-9-benefit-cards__item:first-child{grid-column:span 6}.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(5)) .mfui-9-benefit-cards__item:nth-child(n+2){grid-column:span 3}}@media screen and (min-width:1024px){.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(5)) .mfui-9-benefit-cards__item:nth-child(-n+2){grid-column:span 3}.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(5)) .mfui-9-benefit-cards__item:nth-child(n+3){grid-column:span 2}}.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(5)) .mfui-9-benefit-cards__item{grid-column:span 6}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(6)) .mfui-9-benefit-cards__item:nth-child(-n+6){grid-column:span 3}}@media screen and (min-width:1024px){.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(6)) .mfui-9-benefit-cards__item:nth-child(-n+6){grid-column:span 2}}.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(6)) .mfui-9-benefit-cards__item{grid-column:span 6}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(7)) .mfui-9-benefit-cards__item:first-child{grid-column:span 6}.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(7)) .mfui-9-benefit-cards__item:nth-child(n+2){grid-column:span 3}}@media screen and (min-width:1024px){.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(7)) .mfui-9-benefit-cards__item:nth-child(-n+2){grid-column:span 3}.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(7)) .mfui-9-benefit-cards__item:nth-child(n+3){grid-column:span 2}.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(7)) .mfui-9-benefit-cards__item:nth-child(n+6){grid-column:span 3}}.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(7)) .mfui-9-benefit-cards__item{grid-column:span 6}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(8)) .mfui-9-benefit-cards__item:nth-child(-n+8){grid-column:span 3}}@media screen and (min-width:1024px){.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(8)) .mfui-9-benefit-cards__item:nth-child(-n+2){grid-column:span 3}.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(8)) .mfui-9-benefit-cards__item:nth-child(n+3){grid-column:span 2}}.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(8)) .mfui-9-benefit-cards__item{grid-column:span 6}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(9)) .mfui-9-benefit-cards__item:first-child{grid-column:span 6}.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(9)) .mfui-9-benefit-cards__item:nth-child(n+2){grid-column:span 3}}@media screen and (min-width:1024px){.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(9)) .mfui-9-benefit-cards__item:nth-child(-n+9){grid-column:span 2}}.mfui-9-benefit-cards:has(.mfui-9-benefit-cards__item:nth-child(9)) .mfui-9-benefit-cards__item{grid-column:span 6}.mfui-9-benefit-cards__item{grid-column:span 3}@media screen and (max-width:767px){.mfui-9-benefit-cards__item{grid-column:span 6}}
@@ -0,0 +1,27 @@
1
+ import * as React from 'react';
2
+ import { ExtraBackgroundType, IBenefitCardData, MainBackgroundType } from './types';
3
+ import './BenefitCards.scss';
4
+ export interface IBenefitCards {
5
+ /** Список карточек */
6
+ items: IBenefitCardData[];
7
+ /** Основной фон карточек */
8
+ mainBackground?: MainBackgroundType;
9
+ /** Дополнительный фон карточек */
10
+ extraBackground?: ExtraBackgroundType;
11
+ /** Дополнительный класс для компонента */
12
+ className?: string;
13
+ /** Дополнительные классы для внутренних элементов */
14
+ classes?: {
15
+ root?: string;
16
+ card?: string;
17
+ };
18
+ /** Дополнительные data атрибуты к внутренним элементам */
19
+ dataAttrs?: {
20
+ root?: Record<string, string>;
21
+ card?: Record<string, string>;
22
+ };
23
+ /** Ссылка на корневой элемент */
24
+ rootRef?: React.Ref<HTMLDivElement>;
25
+ }
26
+ declare const BenefitCards: React.FC<IBenefitCards>;
27
+ export default BenefitCards;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ require("core-js/modules/es.array.concat.js");
10
+ require("core-js/modules/es.array.map.js");
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _uiHelpers = require("@megafon/ui-helpers");
13
+ var _BenefitCard = _interopRequireDefault(require("./BenefitCard/BenefitCard"));
14
+ var _helpers = require("./helpers");
15
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
17
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
18
+ var cn = (0, _uiHelpers.cnCreate)('mfui-9-benefit-cards');
19
+ var BenefitCards = function BenefitCards(_ref) {
20
+ var className = _ref.className,
21
+ items = _ref.items,
22
+ mainBackground = _ref.mainBackground,
23
+ extraBackground = _ref.extraBackground,
24
+ classes = _ref.classes,
25
+ dataAttrs = _ref.dataAttrs,
26
+ rootRef = _ref.rootRef;
27
+ return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
28
+ className: cn([className, classes === null || classes === void 0 ? void 0 : classes.root]),
29
+ ref: rootRef
30
+ }), items.map(function (item, i) {
31
+ var isExtraColored = !!extraBackground && (0, _helpers.checkIsExtraColoredCard)(i, items.length);
32
+ return /*#__PURE__*/React.createElement("div", {
33
+ className: cn('item'),
34
+ key: "".concat(item.title, "_").concat(i)
35
+ }, /*#__PURE__*/React.createElement(_BenefitCard["default"], (0, _extends2["default"])({}, item, {
36
+ background: isExtraColored ? extraBackground : mainBackground,
37
+ dataAttrs: {
38
+ root: (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.card, i + 1)
39
+ },
40
+ className: classes === null || classes === void 0 ? void 0 : classes.card
41
+ })));
42
+ }));
43
+ };
44
+ var _default = exports["default"] = BenefitCards;
@@ -0,0 +1 @@
1
+ export declare const checkIsExtraColoredCard: (index: number, total: number) => boolean;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.checkIsExtraColoredCard = void 0;
7
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
8
+ require("core-js/modules/es.array.includes.js");
9
+ require("core-js/modules/es.string.includes.js");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ var ONE_CARDS = '1';
12
+ var TWO_CARDS = '2';
13
+ var THREE_CARDS = '3';
14
+ var FOUR_CARDS = '4';
15
+ var FIVE_CARDS = '5';
16
+ var SIX_CARDS = '6';
17
+ var FIRST_CARD_INDEX = 0;
18
+ var THIRD_CARD_INDEX = 2;
19
+ var FOURTH_CARD_INDEX = 3;
20
+ var FIFTH_CARD_INDEX = 4;
21
+ var INDEXES_MAP = (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, ONE_CARDS, [FIRST_CARD_INDEX]), TWO_CARDS, [FIRST_CARD_INDEX]), THREE_CARDS, [FIRST_CARD_INDEX]), FOUR_CARDS, [FIRST_CARD_INDEX, FOURTH_CARD_INDEX]), FIVE_CARDS, [FIRST_CARD_INDEX, FIFTH_CARD_INDEX]), SIX_CARDS, [FIRST_CARD_INDEX, THIRD_CARD_INDEX, FIFTH_CARD_INDEX]);
22
+ var checkIsExtraColoredCard = exports.checkIsExtraColoredCard = function checkIsExtraColoredCard(index, total) {
23
+ var _a;
24
+ var indexes = (_a = INDEXES_MAP[String(total)]) !== null && _a !== void 0 ? _a : INDEXES_MAP[SIX_CARDS];
25
+ return indexes.includes(index);
26
+ };
@@ -0,0 +1,24 @@
1
+ type SoftBackgroundType = 'soft-purple' | 'soft-green' | 'soft-night' | 'soft-sky' | 'soft-flamingo' | 'soft-berry';
2
+ export type MainBackgroundType = SoftBackgroundType | 'outline' | 'white' | 'gray';
3
+ export type ExtraBackgroundType = SoftBackgroundType | 'gradient-berry1' | 'gradient-berry2' | 'gradient-purple1' | 'gradient-purple2' | 'gradient-purple3';
4
+ export type LinkType = {
5
+ /** Атрибут ссылки href */
6
+ href: string;
7
+ /** Атрибут ссылки target */
8
+ target: '_self' | '_blank';
9
+ /** Атрибут ссылки rel */
10
+ rel?: string;
11
+ /** Текст псевдоссылки внутри карточки */
12
+ pseudoLinkText: string;
13
+ };
14
+ export interface IBenefitCardData {
15
+ /** Заголовок */
16
+ title: string;
17
+ /** Описание */
18
+ description: string;
19
+ /** Изображение */
20
+ imageSrc: string;
21
+ /** Ссылка */
22
+ link?: LinkType;
23
+ }
24
+ export {};
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1 +1 @@
1
- h1,h2,h3,h4,h5{margin:0}.mfui-9-blog-box-tile{color:var(--content);display:block;position:relative;text-decoration:none}.mfui-9-blog-box-tile:hover{text-decoration:none}.mfui-9-blog-box-tile:hover .mfui-9-blog-box-tile__title{color:var(--brandGreen)}.mfui-9-blog-box-tile__image{border-radius:24px;height:100%;-o-object-fit:cover;object-fit:cover;vertical-align:top;width:100%}.mfui-9-blog-box-tile__picture{display:block}.mfui-9-blog-box-tile__date{color:var(--spbSky3);margin-bottom:4px}.mfui-9-blog-box-tile__title{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:4;-webkit-transition:color .3s;transition:color .3s}.mfui-9-blog-box-tile_view_thumbnail{display:-webkit-box;display:-ms-flexbox;display:flex;gap:20px}.mfui-9-blog-box-tile_view_thumbnail .mfui-9-blog-box-tile__picture{-ms-flex-negative:0;flex-shrink:0;height:102px;width:133px}@media screen and (min-width:1280px){.mfui-9-blog-box-tile_view_thumbnail .mfui-9-blog-box-tile__picture{height:130px;width:170px}}@media screen and (min-width:1440px){.mfui-9-blog-box-tile_view_thumbnail .mfui-9-blog-box-tile__picture{height:170px;width:233px}}.mfui-9-blog-box-tile_view_thumbnail .mfui-9-blog-box-tile__content{-ms-flex-item-align:center;align-self:center}.mfui-9-blog-box-tile_view_thumbnail .mfui-9-blog-box-tile__date{font-size:12px;line-height:18px}@media screen and (min-width:1280px){.mfui-9-blog-box-tile_view_thumbnail .mfui-9-blog-box-tile__date{font-size:15px;line-height:24px}}.mfui-9-blog-box-tile_view_thumbnail .mfui-9-blog-box-tile__title{font-size:18px;font-weight:500;letter-spacing:.5px;line-height:24px}@media screen and (min-width:1280px){.mfui-9-blog-box-tile_view_thumbnail .mfui-9-blog-box-tile__title{font-size:20px;line-height:28px}}.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__picture{height:358px}@media screen and (min-width:1280px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__picture{height:438px}}@media screen and (min-width:1440px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__picture{height:558px}}.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__content{background-color:var(--base);border-radius:24px;bottom:8px;left:8px;padding:16px;position:absolute;right:8px}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__content{padding:24px}}@media screen and (min-width:768px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__content{bottom:12px;left:12px;right:12px}}@media screen and (min-width:1024px) and (max-width:1279px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__content{padding:16px}}@media screen and (min-width:1280px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__content{padding:24px}}.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__title{font-size:22px;font-weight:600;letter-spacing:.5px;line-height:28px}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__title{font-size:26px;line-height:32px}}@media screen and (min-width:1024px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__title{font-size:28px;line-height:36px}}@media screen and (min-width:1280px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__title{font-size:32px;line-height:40px}}.mfui-9-blog-box-tile_view_compact .mfui-9-blog-box-tile__picture{height:233px}@media screen and (min-width:1280px){.mfui-9-blog-box-tile_view_compact .mfui-9-blog-box-tile__picture{height:288px}}@media screen and (min-width:1440px){.mfui-9-blog-box-tile_view_compact .mfui-9-blog-box-tile__picture{height:367px}}.mfui-9-blog-box-tile_view_compact .mfui-9-blog-box-tile__content{background-color:var(--base);border-radius:24px;bottom:12px;left:12px;padding:16px;position:absolute;right:12px}.mfui-9-blog-box-tile_view_compact .mfui-9-blog-box-tile__title{font-size:18px;font-weight:500;letter-spacing:.5px;line-height:24px}@media screen and (min-width:1280px){.mfui-9-blog-box-tile_view_compact .mfui-9-blog-box-tile__title{font-size:20px;line-height:28px}}
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-9-blog-box-tile{border-radius:24px;color:var(--content);display:block;position:relative;text-decoration:none}.mfui-9-blog-box-tile:focus-visible{-webkit-animation:focus-outline-shrink .3s linear forwards;animation:focus-outline-shrink .3s linear forwards;outline-offset:2px}@-webkit-keyframes focus-outline-shrink{0%{outline:0 solid var(--137C)}to{outline:4px solid var(--137C)}}@keyframes focus-outline-shrink{0%{outline:0 solid var(--137C)}to{outline:4px solid var(--137C)}}.mfui-9-blog-box-tile:focus{outline:none}.mfui-9-blog-box-tile:hover{text-decoration:none}.mfui-9-blog-box-tile:hover .mfui-9-blog-box-tile__title{color:var(--brandGreen)}.mfui-9-blog-box-tile__image{border-radius:24px;height:100%;-o-object-fit:cover;object-fit:cover;vertical-align:top;width:100%}.mfui-9-blog-box-tile__picture{display:block}.mfui-9-blog-box-tile__date{color:var(--spbSky3);margin-bottom:4px}.mfui-9-blog-box-tile__title{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-transition:color .3s;transition:color .3s;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:4}.mfui-9-blog-box-tile_view_thumbnail{display:-webkit-box;display:-ms-flexbox;display:flex;gap:20px}.mfui-9-blog-box-tile_view_thumbnail .mfui-9-blog-box-tile__picture{-ms-flex-negative:0;flex-shrink:0;height:102px;width:133px}@media screen and (min-width:1280px){.mfui-9-blog-box-tile_view_thumbnail .mfui-9-blog-box-tile__picture{height:130px;width:170px}}@media screen and (min-width:1440px){.mfui-9-blog-box-tile_view_thumbnail .mfui-9-blog-box-tile__picture{height:170px;width:233px}}.mfui-9-blog-box-tile_view_thumbnail .mfui-9-blog-box-tile__content{-ms-flex-item-align:center;align-self:center}.mfui-9-blog-box-tile_view_thumbnail .mfui-9-blog-box-tile__date{font-size:12px;line-height:18px}@media screen and (min-width:1280px){.mfui-9-blog-box-tile_view_thumbnail .mfui-9-blog-box-tile__date{font-size:15px;line-height:24px}}.mfui-9-blog-box-tile_view_thumbnail .mfui-9-blog-box-tile__title{font-size:18px;font-weight:500;letter-spacing:.5px;line-height:24px}@media screen and (min-width:1280px){.mfui-9-blog-box-tile_view_thumbnail .mfui-9-blog-box-tile__title{font-size:20px;line-height:28px}}.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__picture{height:358px}@media screen and (min-width:1280px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__picture{height:438px}}@media screen and (min-width:1440px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__picture{height:558px}}.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__content{background-color:var(--base);border-radius:24px;bottom:8px;left:8px;padding:16px;position:absolute;right:8px}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__content{padding:24px}}@media screen and (min-width:768px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__content{bottom:12px;left:12px;right:12px}}@media screen and (min-width:1024px) and (max-width:1279px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__content{padding:16px}}@media screen and (min-width:1280px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__content{padding:24px}}.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__title{font-size:22px;font-weight:600;letter-spacing:.5px;line-height:28px}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__title{font-size:26px;line-height:32px}}@media screen and (min-width:1024px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__title{font-size:28px;line-height:36px}}@media screen and (min-width:1280px){.mfui-9-blog-box-tile_view_full .mfui-9-blog-box-tile__title{font-size:32px;line-height:40px}}.mfui-9-blog-box-tile_view_compact .mfui-9-blog-box-tile__picture{height:233px}@media screen and (min-width:1280px){.mfui-9-blog-box-tile_view_compact .mfui-9-blog-box-tile__picture{height:288px}}@media screen and (min-width:1440px){.mfui-9-blog-box-tile_view_compact .mfui-9-blog-box-tile__picture{height:367px}}.mfui-9-blog-box-tile_view_compact .mfui-9-blog-box-tile__content{background-color:var(--base);border-radius:24px;bottom:12px;left:12px;padding:16px;position:absolute;right:12px}.mfui-9-blog-box-tile_view_compact .mfui-9-blog-box-tile__title{font-size:18px;font-weight:500;letter-spacing:.5px;line-height:24px}@media screen and (min-width:1280px){.mfui-9-blog-box-tile_view_compact .mfui-9-blog-box-tile__title{font-size:20px;line-height:28px}}
@@ -16,6 +16,8 @@ export type Props = {
16
16
  color?: TextColorType;
17
17
  /** Включить микроразметку */
18
18
  hasMicrodata?: boolean;
19
+ /** Включить микроразметку для последнего элемента */
20
+ hasMicrodataForLastItem?: boolean;
19
21
  /** Отключить на разрешении < 768 px */
20
22
  disabledOnMobile?: boolean;
21
23
  /** Отступ сверху */
@@ -29,6 +29,8 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
29
29
  dataAttrs = _ref.dataAttrs,
30
30
  _ref$hasMicrodata = _ref.hasMicrodata,
31
31
  hasMicrodata = _ref$hasMicrodata === void 0 ? false : _ref$hasMicrodata,
32
+ _ref$hasMicrodataForL = _ref.hasMicrodataForLastItem,
33
+ hasMicrodataForLastItem = _ref$hasMicrodataForL === void 0 ? false : _ref$hasMicrodataForL,
32
34
  _ref$disabledOnMobile = _ref.disabledOnMobile,
33
35
  disabledOnMobile = _ref$disabledOnMobile === void 0 ? false : _ref$disabledOnMobile,
34
36
  _ref$hasMarginTop = _ref.hasMarginTop,
@@ -58,6 +60,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
58
60
  index: i,
59
61
  isLastItem: i === items.length - 1,
60
62
  hasMicrodata: hasMicrodata,
63
+ hasMicrodataForLastItem: hasMicrodataForLastItem,
61
64
  dataAttrs: {
62
65
  root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.itemInner,
63
66
  link: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link,
@@ -13,6 +13,7 @@ export type Props = {
13
13
  index?: number;
14
14
  isLastItem?: boolean;
15
15
  hasMicrodata?: boolean;
16
+ hasMicrodataForLastItem?: boolean;
16
17
  classes?: {
17
18
  link?: string;
18
19
  itemTitle?: string;
@@ -18,6 +18,14 @@ var TextColor = exports.TextColor = {
18
18
  BLACK: 'black',
19
19
  WHITE: 'white'
20
20
  };
21
+ var MICRODATA = {
22
+ itemScope: true,
23
+ itemProp: 'itemListElement',
24
+ itemType: 'https://schema.org/ListItem'
25
+ };
26
+ var MICRODATA_ITEM_PROP = {
27
+ itemProp: 'name'
28
+ };
21
29
  var cn = (0, _uiHelpers.cnCreate)('mfui-9-breadcrumbs-item');
22
30
  var BreadcrumbsItem = function BreadcrumbsItem(_ref) {
23
31
  var title = _ref.title,
@@ -29,24 +37,26 @@ var BreadcrumbsItem = function BreadcrumbsItem(_ref) {
29
37
  isLastItem = _ref$isLastItem === void 0 ? false : _ref$isLastItem,
30
38
  _ref$hasMicrodata = _ref.hasMicrodata,
31
39
  hasMicrodata = _ref$hasMicrodata === void 0 ? false : _ref$hasMicrodata,
40
+ _ref$hasMicrodataForL = _ref.hasMicrodataForLastItem,
41
+ hasMicrodataForLastItem = _ref$hasMicrodataForL === void 0 ? false : _ref$hasMicrodataForL,
32
42
  classes = _ref.classes,
33
43
  dataAttrs = _ref.dataAttrs;
44
+ var renderMeta = /*#__PURE__*/React.createElement("meta", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.meta, index + 1), {
45
+ itemProp: "position",
46
+ content: String(index + 1)
47
+ }));
34
48
  if (isLastItem) {
35
49
  return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
36
50
  className: cn({
37
51
  color: color
38
52
  })
39
- }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root, index + 1)), /*#__PURE__*/React.createElement("span", (0, _extends2["default"])({
53
+ }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root, index + 1), hasMicrodataForLastItem && MICRODATA), /*#__PURE__*/React.createElement("span", (0, _extends2["default"])({
40
54
  className: classes === null || classes === void 0 ? void 0 : classes.lastItemTitle
41
- }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.itemTitle, index + 1)), title));
55
+ }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.itemTitle, index + 1), hasMicrodataForLastItem && MICRODATA_ITEM_PROP), title), hasMicrodataForLastItem && renderMeta);
42
56
  }
43
57
  return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
44
58
  className: cn()
45
- }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root, index + 1), hasMicrodata && {
46
- itemScope: true,
47
- itemProp: 'itemListElement',
48
- itemType: 'https://schema.org/ListItem'
49
- }), /*#__PURE__*/React.createElement(_uiCore.TextLink, {
59
+ }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root, index + 1), hasMicrodata && MICRODATA), /*#__PURE__*/React.createElement(_uiCore.TextLink, {
50
60
  className: classes === null || classes === void 0 ? void 0 : classes.link,
51
61
  href: href,
52
62
  color: color,
@@ -56,11 +66,6 @@ var BreadcrumbsItem = function BreadcrumbsItem(_ref) {
56
66
  itemProp: hasMicrodata ? 'item' : undefined
57
67
  }, /*#__PURE__*/React.createElement("span", (0, _extends2["default"])({
58
68
  className: classes === null || classes === void 0 ? void 0 : classes.itemTitle
59
- }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.itemTitle, index + 1), hasMicrodata && {
60
- itemProp: 'name'
61
- }), title)), hasMicrodata && /*#__PURE__*/React.createElement("meta", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.meta, index + 1), {
62
- itemProp: "position",
63
- content: String(index + 1)
64
- })));
69
+ }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.itemTitle, index + 1), hasMicrodata && MICRODATA_ITEM_PROP), title)), hasMicrodata && renderMeta);
65
70
  };
66
71
  var _default = exports["default"] = BreadcrumbsItem;
@@ -1 +1 @@
1
- h1,h2,h3,h4,h5{margin:0}.mfui-9-card{display:-webkit-box;display:-ms-flexbox;display:flex;font-family:inherit;font-size:15px;font-weight:400;line-height:24px;-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:var(--base);border-radius:24px;color:var(--content);-ms-flex-direction:column;flex-direction:column;padding:16px 16px 24px;text-decoration:none!important;-webkit-transition:background-color .3s,.3s,-webkit-box-shadow;transition:background-color .3s,.3s,-webkit-box-shadow;transition:background-color .3s,box-shadow,.3s;transition:background-color .3s,box-shadow,.3s,-webkit-box-shadow}@media screen and (min-width:1280px){.mfui-9-card{padding:24px 24px 32px}}.mfui-9-card_full-height{height:100%}.mfui-9-card_link{cursor:pointer}.mfui-9-card_view_shadow{-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.mfui-9-card_link.mfui-9-card_view_hover-shadow:hover,.mfui-9-card_link.mfui-9-card_view_shadow:hover{-webkit-box-shadow:0 8px 28px 0 rgba(0,0,0,.1);box-shadow:0 8px 28px 0 rgba(0,0,0,.1)}.mfui-9-card_view_background{background-color:var(--spbSky0)}.mfui-9-card_link.mfui-9-card_view_background:hover{background-color:var(--spbSky1)}.mfui-9-card_only-title{padding:24px}@media screen and (min-width:1280px){.mfui-9-card_only-title{padding:32px}}.mfui-9-card__header{display:-webkit-box;display:-ms-flexbox;display:flex;gap:12px;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.mfui-9-card__icon{height:40px;margin-bottom:32px;width:40px}.mfui-9-card__img-box{border-radius:24px;overflow:hidden;padding-bottom:56.25%;position:relative}.mfui-9-card__img-box_position_top{margin:-6px -6px 24px}@media screen and (min-width:1280px){.mfui-9-card__img-box_position_top{margin:-12px -12px 32px}}.mfui-9-card__img-box_position_bottom{margin:24px -6px 0}@media screen and (min-width:1280px){.mfui-9-card__img-box_position_bottom{margin:32px -12px 0}}.mfui-9-card__img{height:100%;-o-object-fit:cover;object-fit:cover;position:absolute;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;width:100%}.mfui-9-card_link:hover .mfui-9-card__img{-webkit-transform:scale(1.2);transform:scale(1.2)}.mfui-9-card__marker-list{list-style-type:none;margin:16px 0 0;padding:0}.mfui-9-card__marker-item{padding-left:20px;position:relative}.mfui-9-card__marker-item:not(:last-child){margin-bottom:12px}.mfui-9-card__marker-item:before{background-color:var(--spbSky2);border-radius:50%;content:"";height:6px;left:0;opacity:.8;position:absolute;top:7px;width:6px}.mfui-9-card__marker-note{display:block;font-weight:500;margin:4px 0 0;padding:0}.mfui-9-card__texts{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:12px;margin-top:16px}.mfui-9-card__texts ol,.mfui-9-card__texts ul{margin:0;padding-left:24px}.mfui-9-card__texts ol{list-style-type:decimal}.mfui-9-card__texts ul{list-style-type:disc}.mfui-9-card__texts-title{font-weight:500}.mfui-9-card__features{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:12px;margin-top:16px;overflow:hidden}.mfui-9-card__features-list{list-style:none;margin:0;padding:0}.mfui-9-card__features-item{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.mfui-9-card__features-item:before{background-image:radial-gradient(circle,var(--spbSky3) 1px,transparent 1px);background-size:6px 2px;bottom:.4em;content:"";height:2px;position:absolute;width:100%}.mfui-9-card__features-item-value{-ms-flex-negative:0;flex-shrink:0;text-align:end}.mfui-9-card__features-item-text{background-color:var(--base);position:relative;-webkit-transition:background-color .3s;transition:background-color .3s;z-index:1}.mfui-9-card_view_background .mfui-9-card__features-item-text{background-color:var(--spbSky0)}.mfui-9-card_link.mfui-9-card_view_background:hover .mfui-9-card__features-item-text{background-color:var(--spbSky1)}.mfui-9-card__features-item-title .mfui-9-card__features-item-text{padding-right:4px}.mfui-9-card__features-item-value .mfui-9-card__features-item-text{padding-left:4px}.mfui-9-card__icons{margin-top:16px}.mfui-9-card__icons-desc{margin-bottom:12px}.mfui-9-card__icons-list{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:12px}.mfui-9-card__icons-item,.mfui-9-card__icons-list{display:-webkit-box;display:-ms-flexbox;display:flex}.mfui-9-card__icons-item-icon{-ms-flex-negative:0;flex-shrink:0;height:32px;margin-right:8px;width:32px}.mfui-9-card__icons-item-text{margin-top:4px}.mfui-9-card__price{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px;-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline;-webkit-box-pack:center;-ms-flex-pack:center;border-top:1px solid var(--spbSky1);justify-content:center;margin-top:24px;padding-top:24px}@media screen and (min-width:1280px){.mfui-9-card__price{margin-top:32px}}.mfui-9-card__img-box+.mfui-9-card__price{border:none;padding-top:0}.mfui-9-card__price-old-value{color:var(--spbSky3);position:relative}.mfui-9-card__price-old-value:before{background-color:var(--fury);content:"";height:1px;left:-1px;position:absolute;right:-1px;top:50%}.mfui-9-card__price-value{font-size:22px;font-weight:600;letter-spacing:.5px;line-height:28px}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-card__price-value{font-size:26px;line-height:32px}}@media screen and (min-width:1024px){.mfui-9-card__price-value{font-size:28px;line-height:36px}}@media screen and (min-width:1280px){.mfui-9-card__price-value{font-size:32px;line-height:40px}}.mfui-9-card__buttons{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px;margin-top:32px}.mfui-9-card__price+.mfui-9-card__buttons{margin-top:24px}.mfui-9-card__buttons_centered{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.mfui-9-card__button{-ms-flex-preferred-size:190px;flex-basis:190px;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1;max-width:320px}.mfui-9-card__footer{margin-top:auto}
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-9-card{display:-webkit-box;display:-ms-flexbox;display:flex;font-family:inherit;font-size:15px;font-weight:400;line-height:24px;-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:var(--base);border-radius:24px;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--content);-ms-flex-direction:column;flex-direction:column;padding:16px 16px 24px;text-decoration:none!important;-webkit-transition:background-color .3s,.3s,-webkit-box-shadow;transition:background-color .3s,.3s,-webkit-box-shadow;transition:background-color .3s,box-shadow,.3s;transition:background-color .3s,box-shadow,.3s,-webkit-box-shadow}.mfui-9-card:focus-visible{-webkit-animation:focus-outline-shrink .3s linear forwards;animation:focus-outline-shrink .3s linear forwards;outline-offset:2px}@-webkit-keyframes focus-outline-shrink{0%{outline:0 solid var(--137C)}to{outline:4px solid var(--137C)}}@keyframes focus-outline-shrink{0%{outline:0 solid var(--137C)}to{outline:4px solid var(--137C)}}.mfui-9-card:focus{outline:none}@media screen and (min-width:1280px){.mfui-9-card{padding:24px 24px 32px}}.mfui-9-card_full-height{height:100%}.mfui-9-card_link{cursor:pointer}.mfui-9-card_view_shadow{-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.mfui-9-card_link.mfui-9-card_view_hover-shadow:hover,.mfui-9-card_link.mfui-9-card_view_shadow:hover{-webkit-box-shadow:0 8px 28px 0 rgba(0,0,0,.1);box-shadow:0 8px 28px 0 rgba(0,0,0,.1)}.mfui-9-card_view_stroke{background-color:inherit;border:1px solid var(--spbSky2)}.mfui-9-card_link.mfui-9-card_view_stroke:hover{border:1px solid var(--brandGreen)}.mfui-9-card_view_background{background-color:var(--spbSky0)}.mfui-9-card_link.mfui-9-card_view_background:hover{background-color:var(--spbSky1)}.mfui-9-card_only-title{padding:24px}@media screen and (min-width:1280px){.mfui-9-card_only-title{padding:32px}}.mfui-9-card__header{display:-webkit-box;display:-ms-flexbox;display:flex;gap:12px;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.mfui-9-card__icon{height:40px;margin-bottom:32px;width:40px}.mfui-9-card__img-box{border-radius:24px;overflow:hidden;padding-bottom:56.25%;position:relative}.mfui-9-card__img-box_position_top{margin:-6px -6px 24px}@media screen and (min-width:1280px){.mfui-9-card__img-box_position_top{margin:-12px -12px 32px}}.mfui-9-card__img-box_position_bottom{margin:24px -6px 0}@media screen and (min-width:1280px){.mfui-9-card__img-box_position_bottom{margin:32px -12px 0}}.mfui-9-card__img{height:100%;-o-object-fit:cover;object-fit:cover;position:absolute;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;width:100%}.mfui-9-card_link:hover .mfui-9-card__img{-webkit-transform:scale(1.2);transform:scale(1.2)}.mfui-9-card__marker-list{list-style-type:none;margin:16px 0 0;padding:0}.mfui-9-card__marker-item{padding-left:20px;position:relative}.mfui-9-card__marker-item:not(:last-child){margin-bottom:12px}.mfui-9-card__marker-item:before{background-color:var(--spbSky2);border-radius:50%;content:"";height:6px;left:0;opacity:.8;position:absolute;top:7px;width:6px}.mfui-9-card__marker-note{display:block;font-weight:500;margin:4px 0 0;padding:0}.mfui-9-card__texts{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:12px;margin-top:16px}.mfui-9-card__texts ol,.mfui-9-card__texts ul{margin:0;padding-left:24px}.mfui-9-card__texts ol{list-style-type:decimal}.mfui-9-card__texts ul{list-style-type:disc}.mfui-9-card__texts-item_center .mfui-9-card__texts-desc,.mfui-9-card__texts-item_center .mfui-9-card__texts-title{text-align:center}.mfui-9-card__texts-title{font-weight:500}.mfui-9-card__features{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:12px;margin-top:16px;overflow:hidden}.mfui-9-card__features-list{list-style:none;margin:0;padding:0}.mfui-9-card__features-item{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.mfui-9-card__features-item:before{background-image:radial-gradient(circle,var(--spbSky3) 1px,transparent 1px);background-size:6px 2px;bottom:.4em;content:"";height:2px;position:absolute;width:100%}.mfui-9-card__features-item-value{-ms-flex-negative:0;flex-shrink:0;text-align:end}.mfui-9-card__features-item-text{background-color:var(--base);position:relative;-webkit-transition:background-color .3s;transition:background-color .3s;z-index:1}.mfui-9-card_view_background .mfui-9-card__features-item-text{background-color:var(--spbSky0)}.mfui-9-card_link.mfui-9-card_view_background:hover .mfui-9-card__features-item-text{background-color:var(--spbSky1)}.mfui-9-card__features-item-title .mfui-9-card__features-item-text{padding-right:4px}.mfui-9-card__features-item-value .mfui-9-card__features-item-text{padding-left:4px}.mfui-9-card__icons{margin-top:16px}.mfui-9-card__icons-desc{margin-bottom:12px}.mfui-9-card__icons-list{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:12px}.mfui-9-card__icons-item,.mfui-9-card__icons-list{display:-webkit-box;display:-ms-flexbox;display:flex}.mfui-9-card__icons-item-icon{-ms-flex-negative:0;flex-shrink:0;height:32px;margin-right:8px;width:32px}.mfui-9-card__icons-item-text{margin-top:4px}.mfui-9-card__price{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px;-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline;-webkit-box-pack:center;-ms-flex-pack:center;border-top:1px solid var(--spbSky1);justify-content:center;margin-top:24px;padding-top:24px}@media screen and (min-width:1280px){.mfui-9-card__price{margin-top:32px}}.mfui-9-card__img-box+.mfui-9-card__price{border:none;padding-top:0}.mfui-9-card__price-old-value{color:var(--spbSky3);position:relative}.mfui-9-card__price-old-value:before{background-color:var(--fury);content:"";height:1px;left:-1px;position:absolute;right:-1px;top:50%}.mfui-9-card__price-value{font-size:22px;font-weight:600;letter-spacing:.5px;line-height:28px}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-card__price-value{font-size:26px;line-height:32px}}@media screen and (min-width:1024px){.mfui-9-card__price-value{font-size:28px;line-height:36px}}@media screen and (min-width:1280px){.mfui-9-card__price-value{font-size:32px;line-height:40px}}.mfui-9-card__buttons{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px;margin-top:32px}.mfui-9-card__price+.mfui-9-card__buttons{margin-top:24px}.mfui-9-card__button{-ms-flex-preferred-size:190px;flex-basis:190px;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1}.mfui-9-card__footer{margin-top:auto}
@@ -21,8 +21,9 @@ export interface ICard {
21
21
  /** Ссылка на корневой элемент */
22
22
  rootRef?: React.Ref<HTMLDivElement | HTMLAnchorElement>;
23
23
  isFullHeight?: boolean;
24
+ isCenteredText?: boolean;
24
25
  /** Вид */
25
- view?: 'shadow' | 'hover-shadow' | 'background';
26
+ view?: 'shadow' | 'hover-shadow' | 'background' | 'stroke';
26
27
  /** Ссылка для карточки */
27
28
  link?: Link;
28
29
  /** Изображение */
@@ -14,32 +14,32 @@ var _uiHelpers = require("@megafon/ui-helpers");
14
14
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
15
15
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
16
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
17
- var textsConvertConfig = {
18
- b: {
17
+ var textsConvertConfig = (0, _extends2["default"])((0, _extends2["default"])({}, _uiHelpers.textConvertConfig), {
18
+ ul: {
19
19
  component: function component(_ref) {
20
20
  var children = _ref.children;
21
- return /*#__PURE__*/React.createElement("b", null, children);
21
+ return /*#__PURE__*/React.createElement("ul", null, children);
22
22
  }
23
23
  },
24
- ul: {
24
+ ol: {
25
25
  component: function component(_ref2) {
26
26
  var children = _ref2.children;
27
- return /*#__PURE__*/React.createElement("ul", null, children);
27
+ return /*#__PURE__*/React.createElement("ol", null, children);
28
28
  }
29
29
  },
30
- ol: {
30
+ li: {
31
31
  component: function component(_ref3) {
32
32
  var children = _ref3.children;
33
- return /*#__PURE__*/React.createElement("ol", null, children);
33
+ return /*#__PURE__*/React.createElement("li", null, children);
34
34
  }
35
35
  },
36
- li: {
36
+ p: {
37
37
  component: function component(_ref4) {
38
38
  var children = _ref4.children;
39
- return /*#__PURE__*/React.createElement("li", null, children);
39
+ return /*#__PURE__*/React.createElement("p", null, children);
40
40
  }
41
41
  }
42
- };
42
+ });
43
43
  var cn = (0, _uiHelpers.cnCreate)('mfui-9-card');
44
44
  var Card = function Card(_ref5) {
45
45
  var dataAttrs = _ref5.dataAttrs,
@@ -48,6 +48,8 @@ var Card = function Card(_ref5) {
48
48
  rootRef = _ref5.rootRef,
49
49
  _ref5$isFullHeight = _ref5.isFullHeight,
50
50
  isFullHeight = _ref5$isFullHeight === void 0 ? false : _ref5$isFullHeight,
51
+ _ref5$isCenteredText = _ref5.isCenteredText,
52
+ isCenteredText = _ref5$isCenteredText === void 0 ? false : _ref5$isCenteredText,
51
53
  link = _ref5.link,
52
54
  _ref5$view = _ref5.view,
53
55
  view = _ref5$view === void 0 ? 'shadow' : _ref5$view,
@@ -111,7 +113,9 @@ var Card = function Card(_ref5) {
111
113
  className: cn('texts')
112
114
  }, textsList.map(function (item, i) {
113
115
  return /*#__PURE__*/React.createElement("div", {
114
- className: cn('texts-item'),
116
+ className: cn('texts-item', {
117
+ center: isCenteredText
118
+ }),
115
119
  key: i
116
120
  }, !!item.title && /*#__PURE__*/React.createElement("div", {
117
121
  className: cn('texts-title')
@@ -179,10 +183,10 @@ var Card = function Card(_ref5) {
179
183
  return null;
180
184
  }
181
185
  var extraButtonType = (button === null || button === void 0 ? void 0 : button.type) === 'outline' ? 'text' : extraButton === null || extraButton === void 0 ? void 0 : extraButton.type;
186
+ var extraButtonDefaultTheme = view === 'background' ? 'white' : 'gray';
187
+ var extraButtonTheme = (extraButton === null || extraButton === void 0 ? void 0 : extraButton.theme) || extraButtonDefaultTheme;
182
188
  return /*#__PURE__*/React.createElement("div", {
183
- className: cn('buttons', {
184
- centered: (button === null || button === void 0 ? void 0 : button.isCentered) || (extraButton === null || extraButton === void 0 ? void 0 : extraButton.isCentered)
185
- })
189
+ className: cn('buttons')
186
190
  }, !!button && /*#__PURE__*/React.createElement(_uiCore.Button, {
187
191
  dataAttrs: {
188
192
  root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button
@@ -200,7 +204,8 @@ var Card = function Card(_ref5) {
200
204
  className: cn('button', [classes === null || classes === void 0 ? void 0 : classes.extraButton]),
201
205
  href: extraButton.href,
202
206
  target: extraButton.target,
203
- type: extraButtonType || 'outline',
207
+ type: extraButtonType,
208
+ theme: extraButtonTheme,
204
209
  onClick: extraButton === null || extraButton === void 0 ? void 0 : extraButton.onClick
205
210
  }, extraButton.title));
206
211
  };
@@ -223,6 +228,8 @@ var Card = function Card(_ref5) {
223
228
  target: isLink ? link === null || link === void 0 ? void 0 : link.target : undefined,
224
229
  onClick: isLink ? onClick : undefined,
225
230
  ref: rootRef
231
+ }, !!onClick && {
232
+ tabIndex: 0
226
233
  }), renderIcon(), !isBottomImage && renderImage(), /*#__PURE__*/React.createElement("div", {
227
234
  className: cn('header')
228
235
  }, /*#__PURE__*/React.createElement(_uiCore.Header, {
@@ -68,19 +68,17 @@ export type ButtonType = {
68
68
  href?: string;
69
69
  /** Target свойство кнопки */
70
70
  target?: Target;
71
- /** Центрировать кнопку */
72
- isCentered?: boolean;
71
+ /** Тема кнопки */
72
+ theme?: 'green' | 'gray' | 'white';
73
73
  /** Обработчик клика по кнопке */
74
74
  onClick?: () => void;
75
75
  };
76
76
  export type MainButtonType = ButtonType & {
77
77
  /** Тип кнопки */
78
78
  type?: 'primary' | 'outline';
79
- /** Тема кнопки */
80
- theme?: 'green' | 'green-soft';
81
79
  };
82
80
  export type ExtraButtonType = ButtonType & {
83
81
  /** Тип кнопки */
84
- type?: 'outline' | 'text';
82
+ type?: 'primary' | 'text';
85
83
  };
86
84
  export {};
@@ -0,0 +1 @@
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-9-cards-on-background{border-radius:24px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;padding:16px;position:relative;width:100%}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-cards-on-background{padding:32px}}@media screen and (min-width:1024px){.mfui-9-cards-on-background{padding:56px}}.mfui-9-cards-on-background_background_gray{background-color:var(--spbSky0)}.mfui-9-cards-on-background_background_green{background-color:var(--brandGreen20)}.mfui-9-cards-on-background_background_blue{background-color:var(--night20)}.mfui-9-cards-on-background_background_violet{background-color:#e1dcea}@media screen and (max-width:767px){.mfui-9-cards-on-background_carousel{padding-bottom:32px}}@media screen and (max-width:1023px){.mfui-9-cards-on-background_carousel:before{background:-webkit-gradient(linear,left top,right top,from(rgba(242,244,247,.3)),to(hsla(0,0%,100%,0)));background:linear-gradient(90deg,rgba(242,244,247,.3),hsla(0,0%,100%,0));content:"";height:100%;left:0;position:absolute;top:0;width:16px;z-index:1}.mfui-9-cards-on-background_carousel:after{background:-webkit-gradient(linear,right top,left top,from(rgba(242,244,247,.3)),to(hsla(0,0%,100%,0)));background:linear-gradient(270deg,rgba(242,244,247,.3),hsla(0,0%,100%,0));content:"";height:100%;position:absolute;right:0;top:0;width:16px;z-index:1}}.mfui-9-cards-on-background__grid{display:grid;gap:20px;grid-template-columns:1fr;width:100%}@media screen and (min-width:768px){.mfui-9-cards-on-background__grid{grid-template-columns:repeat(12,1fr)}}.mfui-9-cards-on-background__grid-item{grid-column:span 1}@media screen and (min-width:768px){.mfui-9-cards-on-background__grid-item{grid-column:span 6}}@media screen and (min-width:1280px){.mfui-9-cards-on-background__grid-item{grid-column:span 4}}@media screen and (min-width:768px){.mfui-9-cards-on-background__grid_count_1 .mfui-9-cards-on-background__grid-item{grid-column:span 12}}@media screen and (min-width:1280px){.mfui-9-cards-on-background__grid_single-align_left.mfui-9-cards-on-background__grid_count_1 .mfui-9-cards-on-background__grid-item{grid-column:span 6}.mfui-9-cards-on-background__grid_single-align_center.mfui-9-cards-on-background__grid_count_1 .mfui-9-cards-on-background__grid-item{grid-column:4/10}}@media screen and (min-width:768px){.mfui-9-cards-on-background__grid_count_2 .mfui-9-cards-on-background__grid-item,.mfui-9-cards-on-background__grid_count_4 .mfui-9-cards-on-background__grid-item{grid-column:span 6}}@media screen and (min-width:1024px) and (max-width:1279px),screen and (min-width:768px) and (max-width:1023px){.mfui-9-cards-on-background__grid_count_3 .mfui-9-cards-on-background__grid-item:first-child{grid-column:span 12}.mfui-9-cards-on-background__grid_count_3 .mfui-9-cards-on-background__grid-item:nth-child(n+2){grid-column:span 6}}@media screen and (min-width:1280px){.mfui-9-cards-on-background__grid_count_3 .mfui-9-cards-on-background__grid-item{grid-column:span 4}}@media screen and (min-width:1024px) and (max-width:1279px),screen and (min-width:768px) and (max-width:1023px){.mfui-9-cards-on-background__grid_count_5 .mfui-9-cards-on-background__grid-item:first-child{grid-column:span 12}.mfui-9-cards-on-background__grid_count_5 .mfui-9-cards-on-background__grid-item:nth-child(n+2){grid-column:span 6}}@media screen and (min-width:1280px){.mfui-9-cards-on-background__grid_count_5 .mfui-9-cards-on-background__grid-item:nth-child(-n+2){grid-column:span 6}.mfui-9-cards-on-background__grid_count_5 .mfui-9-cards-on-background__grid-item:nth-child(n+3){grid-column:span 4}}
@@ -0,0 +1,37 @@
1
+ import * as React from 'react';
2
+ import { Carousel } from '@megafon/ui-core';
3
+ import { BackgroundColorType, CardDataType, SingleCardAlignType } from './types';
4
+ import './CardsOnBackground.scss';
5
+ type CarouselProps = React.ComponentProps<typeof Carousel>;
6
+ export interface ICardsOnBackground {
7
+ /** Карточки. Минимальное количество 2 карточки */
8
+ items: CardDataType[];
9
+ /** Цвет фона карточек */
10
+ background?: BackgroundColorType;
11
+ /** Выстраивать карточки в карусель */
12
+ hasCarousel?: boolean;
13
+ /** Выравнивание одиночной карточки */
14
+ singleCardAlign?: SingleCardAlignType;
15
+ /** Дополнительный класс для компонента */
16
+ className?: string;
17
+ /** Дополнительные классы для внутренних элементов */
18
+ classes?: {
19
+ root?: string;
20
+ item?: string;
21
+ itemTitle?: string;
22
+ itemButton?: string;
23
+ itemExtraButton?: string;
24
+ };
25
+ /** Дополнительные data атрибуты к внутренним элементам */
26
+ dataAttrs?: {
27
+ root?: Record<string, string>;
28
+ grid?: Record<string, string>;
29
+ item?: Record<string, string>;
30
+ };
31
+ /** Обработчик смены слайда карусели */
32
+ onCarouselChange?: CarouselProps['onChange'];
33
+ /** Ссылка на корневой элемент */
34
+ rootRef?: React.Ref<HTMLDivElement>;
35
+ }
36
+ declare const CardsOnBackground: React.FC<ICardsOnBackground>;
37
+ export default CardsOnBackground;
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ require("core-js/modules/es.array.map.js");
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _uiCore = require("@megafon/ui-core");
13
+ var _uiHelpers = require("@megafon/ui-helpers");
14
+ var _useResolutions2 = _interopRequireDefault(require("../../hooks/useResolutions"));
15
+ var _CardOnBackground = _interopRequireDefault(require("./components/CardOnBackground"));
16
+ var _useUniformHeights2 = _interopRequireDefault(require("./useUniformHeights"));
17
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
18
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
19
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
20
+ var getSlidesSettings = function getSlidesSettings(count) {
21
+ return (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, _uiHelpers.breakpoints.MOBILE_SMALL_START, {
22
+ slidesPerView: 1,
23
+ spaceBetween: 16
24
+ }), _uiHelpers.breakpoints.MOBILE_BIG_START, {
25
+ slidesPerView: 2,
26
+ spaceBetween: 20
27
+ }), _uiHelpers.breakpoints.DESKTOP_MIDDLE_START, {
28
+ slidesPerView: count < 3 ? count : 3,
29
+ spaceBetween: 20
30
+ }), _uiHelpers.breakpoints.DESKTOP_BIG_START, {
31
+ slidesPerView: count < 4 ? count : 4,
32
+ spaceBetween: 20
33
+ });
34
+ };
35
+ var cn = (0, _uiHelpers.cnCreate)('mfui-9-cards-on-background');
36
+ var CardsOnBackground = function CardsOnBackground(_ref2) {
37
+ var items = _ref2.items,
38
+ _ref2$background = _ref2.background,
39
+ background = _ref2$background === void 0 ? 'gray' : _ref2$background,
40
+ _ref2$hasCarousel = _ref2.hasCarousel,
41
+ hasCarousel = _ref2$hasCarousel === void 0 ? false : _ref2$hasCarousel,
42
+ _ref2$singleCardAlign = _ref2.singleCardAlign,
43
+ singleCardAlign = _ref2$singleCardAlign === void 0 ? 'left' : _ref2$singleCardAlign,
44
+ className = _ref2.className,
45
+ _ref2$classes = _ref2.classes,
46
+ classes = _ref2$classes === void 0 ? {} : _ref2$classes,
47
+ dataAttrs = _ref2.dataAttrs,
48
+ onCarouselChange = _ref2.onCarouselChange,
49
+ rootRef = _ref2.rootRef;
50
+ var cardsCount = items.length;
51
+ var _useResolutions = (0, _useResolutions2["default"])(),
52
+ isMobile = _useResolutions.isMobile;
53
+ var _useUniformHeights = (0, _useUniformHeights2["default"])(cardsCount, {
54
+ disabled: isMobile
55
+ }),
56
+ maxHeight = _useUniformHeights.maxHeight,
57
+ getRef = _useUniformHeights.getRef;
58
+ var renderCard = function renderCard(item, index) {
59
+ return /*#__PURE__*/React.createElement(_CardOnBackground["default"], (0, _extends2["default"])({}, item, !!maxHeight && {
60
+ headerHeight: maxHeight
61
+ }, {
62
+ headerRef: getRef(index),
63
+ classes: {
64
+ root: classes.item,
65
+ title: classes.itemTitle,
66
+ button: classes.itemButton,
67
+ extraButton: classes.itemExtraButton
68
+ },
69
+ dataAttrs: {
70
+ root: (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, index + 1))
71
+ }
72
+ }));
73
+ };
74
+ var renderContent = function renderContent() {
75
+ if (hasCarousel) {
76
+ return /*#__PURE__*/React.createElement(_uiCore.Carousel, {
77
+ slidesSettings: getSlidesSettings(cardsCount),
78
+ arrowPosition: "inside",
79
+ onChange: onCarouselChange
80
+ }, items.map(function (item, i) {
81
+ return /*#__PURE__*/React.createElement(React.Fragment, {
82
+ key: item.title + i
83
+ }, renderCard(item, i));
84
+ }));
85
+ }
86
+ return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.grid), {
87
+ className: cn('grid', {
88
+ count: "".concat(cardsCount),
89
+ 'single-align': singleCardAlign
90
+ })
91
+ }), items.map(function (item, i) {
92
+ return /*#__PURE__*/React.createElement("div", {
93
+ className: cn('grid-item'),
94
+ key: item.title + i
95
+ }, renderCard(item, i));
96
+ }));
97
+ };
98
+ return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
99
+ className: cn({
100
+ background: background,
101
+ carousel: hasCarousel
102
+ }, [className, classes.root])
103
+ }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
104
+ ref: rootRef
105
+ }), renderContent());
106
+ };
107
+ var _default = exports["default"] = CardsOnBackground;
@@ -0,0 +1 @@
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-9-card-on-background{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;-webkit-box-pack:center;-ms-flex-pack:center;background-color:var(--base);border-radius:24px;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--content);height:100%;justify-content:center;min-width:240px;padding:16px 16px 0;text-decoration:none}.mfui-9-card-on-background:focus-visible{-webkit-animation:focus-outline-shrink .3s linear forwards;animation:focus-outline-shrink .3s linear forwards;outline-offset:2px}@-webkit-keyframes focus-outline-shrink{0%{outline:0 solid var(--137C)}to{outline:4px solid var(--137C)}}@keyframes focus-outline-shrink{0%{outline:0 solid var(--137C)}to{outline:4px solid var(--137C)}}.mfui-9-card-on-background:focus{outline:none}@media screen and (min-width:768px){.mfui-9-card-on-background{padding:24px 24px 0}}.mfui-9-card-on-background:hover{text-decoration:none}.mfui-9-card-on-background_active:hover{-webkit-box-shadow:0 8px 28px 0 rgba(0,0,0,.1);box-shadow:0 8px 28px 0 rgba(0,0,0,.1)}.mfui-9-card-on-background__content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;max-width:520px;width:100%}.mfui-9-card-on-background__description{font-size:15px;font-weight:400;line-height:24px;margin-top:8px;text-align:center}.mfui-9-card-on-background__image-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;height:118px;justify-content:center;margin:16px 0;overflow:hidden;width:118px}@media screen and (min-width:1024px){.mfui-9-card-on-background__image-wrapper{height:168px;width:168px}}.mfui-9-card-on-background__image{max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain}.mfui-9-card-on-background__buttons{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;gap:12px;-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-bottom:16px;width:100%}@media screen and (min-width:768px){.mfui-9-card-on-background__buttons{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-bottom:24px}}.mfui-9-card-on-background__button{-webkit-box-flex:1;-ms-flex:1;flex:1;width:100%}
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { CardDataType } from '../types';
3
+ import './CardOnBackground.scss';
4
+ export type CardOnBackgroundType = CardDataType & {
5
+ headerHeight?: number;
6
+ headerRef: (node: HTMLDivElement) => void;
7
+ classes?: {
8
+ root?: string;
9
+ title?: string;
10
+ button?: string;
11
+ extraButton?: string;
12
+ };
13
+ dataAttrs?: {
14
+ root?: Record<string, string>;
15
+ title?: Record<string, string>;
16
+ button?: Record<string, string>;
17
+ extraButton?: Record<string, string>;
18
+ header?: Record<string, string>;
19
+ };
20
+ };
21
+ declare const CardOnBackground: React.FC<CardOnBackgroundType>;
22
+ export default CardOnBackground;