@megafon/ui-shared 6.10.0 → 6.11.1

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 (43) hide show
  1. package/dist/es/components/ButtonsBox/ButtonsBox.css +34 -0
  2. package/dist/es/components/ButtonsBox/ButtonsBox.d.ts +48 -0
  3. package/dist/es/components/ButtonsBox/ButtonsBox.js +89 -0
  4. package/dist/es/components/Container/Container.css +526 -1
  5. package/dist/es/components/Container/Container.d.ts +9 -0
  6. package/dist/es/components/Container/Container.js +14 -3
  7. package/dist/es/components/InfoCards/InfoCards.d.ts +4 -1
  8. package/dist/es/components/InfoCards/InfoCards.js +14 -5
  9. package/dist/es/components/InfoCards/components/InfoCard/InfoCard.css +30 -7
  10. package/dist/es/components/InfoCards/components/InfoCard/InfoCard.d.ts +4 -0
  11. package/dist/es/components/InfoCards/components/InfoCard/InfoCard.js +20 -10
  12. package/dist/es/components/InfoCards/types.d.ts +6 -1
  13. package/dist/es/components/PromoCards/PromoCards.d.ts +28 -0
  14. package/dist/es/components/PromoCards/PromoCards.js +90 -0
  15. package/dist/es/components/PromoCards/components/PromoCard/PromoCard.css +157 -0
  16. package/dist/es/components/PromoCards/components/PromoCard/PromoCard.d.ts +18 -0
  17. package/dist/es/components/PromoCards/components/PromoCard/PromoCard.js +74 -0
  18. package/dist/es/components/PromoCards/types.d.ts +29 -0
  19. package/dist/es/components/PromoCards/types.js +0 -0
  20. package/dist/es/index.d.ts +3 -0
  21. package/dist/es/index.js +3 -0
  22. package/dist/lib/components/ButtonsBox/ButtonsBox.css +34 -0
  23. package/dist/lib/components/ButtonsBox/ButtonsBox.d.ts +48 -0
  24. package/dist/lib/components/ButtonsBox/ButtonsBox.js +110 -0
  25. package/dist/lib/components/Container/Container.css +526 -1
  26. package/dist/lib/components/Container/Container.d.ts +9 -0
  27. package/dist/lib/components/Container/Container.js +14 -3
  28. package/dist/lib/components/InfoCards/InfoCards.d.ts +4 -1
  29. package/dist/lib/components/InfoCards/InfoCards.js +16 -13
  30. package/dist/lib/components/InfoCards/components/InfoCard/InfoCard.css +30 -7
  31. package/dist/lib/components/InfoCards/components/InfoCard/InfoCard.d.ts +4 -0
  32. package/dist/lib/components/InfoCards/components/InfoCard/InfoCard.js +19 -9
  33. package/dist/lib/components/InfoCards/types.d.ts +6 -1
  34. package/dist/lib/components/PromoCards/PromoCards.d.ts +28 -0
  35. package/dist/lib/components/PromoCards/PromoCards.js +113 -0
  36. package/dist/lib/components/PromoCards/components/PromoCard/PromoCard.css +157 -0
  37. package/dist/lib/components/PromoCards/components/PromoCard/PromoCard.d.ts +18 -0
  38. package/dist/lib/components/PromoCards/components/PromoCard/PromoCard.js +96 -0
  39. package/dist/lib/components/PromoCards/types.d.ts +29 -0
  40. package/dist/lib/components/PromoCards/types.js +1 -0
  41. package/dist/lib/index.d.ts +3 -0
  42. package/dist/lib/index.js +24 -0
  43. package/package.json +3 -3
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import { IPromoCardData, IPromoCardSettings } from '../../types';
3
+ import './PromoCard.less';
4
+ export interface IPromoCard extends IPromoCardData, IPromoCardSettings {
5
+ className?: string;
6
+ classes?: {
7
+ root?: string;
8
+ };
9
+ dataAttrs?: {
10
+ root?: Record<string, string>;
11
+ image?: Record<string, string>;
12
+ badge?: Record<string, string>;
13
+ logo?: Record<string, string>;
14
+ subtitle?: Record<string, string>;
15
+ };
16
+ }
17
+ declare const PromoCard: React.FC<IPromoCard>;
18
+ export default PromoCard;
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
12
+ require("core-js/modules/es.string.link.js");
13
+
14
+ require("core-js/modules/es.array.concat.js");
15
+
16
+ var React = _interopRequireWildcard(require("react"));
17
+
18
+ var _uiCore = require("@megafon/ui-core");
19
+
20
+ var _uiHelpers = require("@megafon/ui-helpers");
21
+
22
+ var _setRelAttribute = require("../../../../helpers/setRelAttribute");
23
+
24
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
+
26
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
+
28
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
+
30
+ var cn = (0, _uiHelpers.cnCreate)('mfui-v6-promo-card');
31
+
32
+ var PromoCard = function PromoCard(_ref) {
33
+ var title = _ref.title,
34
+ subtitle = _ref.subtitle,
35
+ link = _ref.link,
36
+ _ref$background = _ref.background,
37
+ background = _ref$background === void 0 ? 'shadow' : _ref$background,
38
+ image = _ref.image,
39
+ logo = _ref.logo,
40
+ badge = _ref.badge,
41
+ className = _ref.className,
42
+ classes = _ref.classes,
43
+ dataAttrs = _ref.dataAttrs,
44
+ onClick = _ref.onClick;
45
+ var imageSrc = image.src,
46
+ imageSrc2x = image.src2x,
47
+ imageAlt = image.alt;
48
+ var linkHref = link.href,
49
+ _link$target = link.target,
50
+ linkTarget = _link$target === void 0 ? '_self' : _link$target,
51
+ linkRel = link.rel,
52
+ linkTitle = link.title;
53
+ var imageSrcSet = imageSrc2x ? "".concat(imageSrc, ", ").concat(imageSrc2x, " 2x") : undefined;
54
+ return /*#__PURE__*/React.createElement("a", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
55
+ className: cn({
56
+ background: background
57
+ }, [className, classes === null || classes === void 0 ? void 0 : classes.root]),
58
+ href: linkHref,
59
+ target: linkTarget,
60
+ rel: (0, _setRelAttribute.setRelAttribute)(linkRel, linkTarget),
61
+ onClick: onClick
62
+ }), /*#__PURE__*/React.createElement("img", (0, _extends2["default"])({
63
+ className: cn('image')
64
+ }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image), {
65
+ srcSet: imageSrcSet,
66
+ src: imageSrc,
67
+ alt: imageAlt || ''
68
+ })), /*#__PURE__*/React.createElement("div", {
69
+ className: cn('content')
70
+ }, !!badge && /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.badge), {
71
+ className: cn('badge')
72
+ }), badge), !!(logo === null || logo === void 0 ? void 0 : logo.src) && !badge && /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.logo), {
73
+ className: cn('logo')
74
+ }), /*#__PURE__*/React.createElement("img", {
75
+ className: cn('logo-img'),
76
+ src: logo.src,
77
+ alt: logo.alt || ''
78
+ })), /*#__PURE__*/React.createElement(_uiCore.Header, {
79
+ as: "h3"
80
+ }, (0, _uiHelpers.convert)(title, {})), !!subtitle && /*#__PURE__*/React.createElement(_uiCore.Paragraph, {
81
+ className: cn('subtitle'),
82
+ hasMargin: false,
83
+ dataAttrs: {
84
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.subtitle
85
+ }
86
+ }, (0, _uiHelpers.convert)(subtitle, {})), /*#__PURE__*/React.createElement("div", {
87
+ className: cn('footer')
88
+ }, /*#__PURE__*/React.createElement(_uiCore.Button, {
89
+ sizeAll: "small",
90
+ type: "text",
91
+ showArrow: true
92
+ }, linkTitle))));
93
+ };
94
+
95
+ var _default = PromoCard;
96
+ exports["default"] = _default;
@@ -0,0 +1,29 @@
1
+ /// <reference types="react" />
2
+ declare type ImageType = {
3
+ src: string;
4
+ src2x?: string;
5
+ alt?: string;
6
+ };
7
+ declare type LogoType = {
8
+ src?: string;
9
+ alt?: string;
10
+ };
11
+ declare type LinkType = {
12
+ title: string;
13
+ href: string;
14
+ target?: '_self' | '_blank';
15
+ rel?: string;
16
+ };
17
+ export interface IPromoCardSettings {
18
+ background?: 'gray' | 'white' | 'shadow';
19
+ }
20
+ export interface IPromoCardData {
21
+ title: string;
22
+ subtitle?: string;
23
+ link: LinkType;
24
+ image: ImageType;
25
+ logo?: LogoType;
26
+ badge?: React.ReactElement | null;
27
+ onClick?: (e: React.SyntheticEvent<EventTarget>) => void;
28
+ }
29
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";
@@ -13,6 +13,7 @@ export { default as Breadcrumbs } from './components/Breadcrumbs/Breadcrumbs';
13
13
  export { default as BreadcrumbsItem } from './components/Breadcrumbs/components/BreadcrumbsItem';
14
14
  export { default as ButtonBanner } from './components/ButtonBanner/ButtonBanner';
15
15
  export { default as ButtonLinkBox } from './components/ButtonLinkBox/ButtonLinkBox';
16
+ export { default as ButtonsBox } from './components/ButtonsBox/ButtonsBox';
16
17
  export { default as Card } from './components/Card/Card';
17
18
  export { default as CardsBox } from './components/CardsBox/CardsBox';
18
19
  export { default as CarouselBox } from './components/CarouselBox/CarouselBox';
@@ -30,6 +31,8 @@ export { default as NotificationBox } from './components/NotificationBox/Notific
30
31
  export { default as PageTitle } from './components/PageTitle/PageTitle';
31
32
  export { default as Partners } from './components/Partners/Partners';
32
33
  export { default as PictureWithDescription } from './components/PictureWithDescription/PictureWithDescription';
34
+ export { default as PromoCard } from './components/PromoCards/components/PromoCard/PromoCard';
35
+ export { default as PromoCards } from './components/PromoCards/PromoCards';
33
36
  export { default as Property } from './components/Property/Property';
34
37
  export { default as PropertyDescription } from './components/Property/PropertyDescription';
35
38
  export { default as SidePictureCard } from './components/SidePictureCards/components/SidePictureCard';
package/dist/lib/index.js CHANGED
@@ -93,6 +93,12 @@ Object.defineProperty(exports, "ButtonLinkBox", {
93
93
  return _ButtonLinkBox["default"];
94
94
  }
95
95
  });
96
+ Object.defineProperty(exports, "ButtonsBox", {
97
+ enumerable: true,
98
+ get: function get() {
99
+ return _ButtonsBox["default"];
100
+ }
101
+ });
96
102
  Object.defineProperty(exports, "Card", {
97
103
  enumerable: true,
98
104
  get: function get() {
@@ -195,6 +201,18 @@ Object.defineProperty(exports, "PictureWithDescription", {
195
201
  return _PictureWithDescription["default"];
196
202
  }
197
203
  });
204
+ Object.defineProperty(exports, "PromoCard", {
205
+ enumerable: true,
206
+ get: function get() {
207
+ return _PromoCard["default"];
208
+ }
209
+ });
210
+ Object.defineProperty(exports, "PromoCards", {
211
+ enumerable: true,
212
+ get: function get() {
213
+ return _PromoCards["default"];
214
+ }
215
+ });
198
216
  Object.defineProperty(exports, "Property", {
199
217
  enumerable: true,
200
218
  get: function get() {
@@ -358,6 +376,8 @@ var _ButtonBanner = _interopRequireDefault(require("./components/ButtonBanner/Bu
358
376
 
359
377
  var _ButtonLinkBox = _interopRequireDefault(require("./components/ButtonLinkBox/ButtonLinkBox"));
360
378
 
379
+ var _ButtonsBox = _interopRequireDefault(require("./components/ButtonsBox/ButtonsBox"));
380
+
361
381
  var _Card = _interopRequireDefault(require("./components/Card/Card"));
362
382
 
363
383
  var _CardsBox = _interopRequireDefault(require("./components/CardsBox/CardsBox"));
@@ -392,6 +412,10 @@ var _Partners = _interopRequireDefault(require("./components/Partners/Partners")
392
412
 
393
413
  var _PictureWithDescription = _interopRequireDefault(require("./components/PictureWithDescription/PictureWithDescription"));
394
414
 
415
+ var _PromoCard = _interopRequireDefault(require("./components/PromoCards/components/PromoCard/PromoCard"));
416
+
417
+ var _PromoCards = _interopRequireDefault(require("./components/PromoCards/PromoCards"));
418
+
395
419
  var _Property = _interopRequireDefault(require("./components/Property/Property"));
396
420
 
397
421
  var _PropertyDescription = _interopRequireDefault(require("./components/Property/PropertyDescription"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-shared",
3
- "version": "6.10.0",
3
+ "version": "6.11.1",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -82,7 +82,7 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "@babel/runtime": "^7.8.4",
85
- "@megafon/ui-core": "^6.5.0",
85
+ "@megafon/ui-core": "^6.6.1",
86
86
  "@megafon/ui-helpers": "^2.6.0",
87
87
  "core-js": "^3.6.4",
88
88
  "htmr": "^0.9.2",
@@ -90,5 +90,5 @@
90
90
  "prop-types": "^15.7.2",
91
91
  "swiper": "^6.5.6"
92
92
  },
93
- "gitHead": "9804a8e7196f90b0c310e4ee83988276ff7b58bc"
93
+ "gitHead": "c119b673112829f75ebb828789f183e7c061b715"
94
94
  }