@megafon/ui-shared 6.10.0 → 6.11.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 (40) hide show
  1. package/CHANGELOG.md +2483 -0
  2. package/dist/es/components/ButtonsBox/ButtonsBox.css +34 -0
  3. package/dist/es/components/ButtonsBox/ButtonsBox.d.ts +48 -0
  4. package/dist/es/components/ButtonsBox/ButtonsBox.js +89 -0
  5. package/dist/es/components/Container/Container.css +519 -0
  6. package/dist/es/components/InfoCards/InfoCards.d.ts +4 -1
  7. package/dist/es/components/InfoCards/InfoCards.js +14 -5
  8. package/dist/es/components/InfoCards/components/InfoCard/InfoCard.css +30 -7
  9. package/dist/es/components/InfoCards/components/InfoCard/InfoCard.d.ts +4 -0
  10. package/dist/es/components/InfoCards/components/InfoCard/InfoCard.js +20 -10
  11. package/dist/es/components/InfoCards/types.d.ts +6 -1
  12. package/dist/es/components/PromoCards/PromoCards.d.ts +28 -0
  13. package/dist/es/components/PromoCards/PromoCards.js +90 -0
  14. package/dist/es/components/PromoCards/components/PromoCard/PromoCard.css +157 -0
  15. package/dist/es/components/PromoCards/components/PromoCard/PromoCard.d.ts +18 -0
  16. package/dist/es/components/PromoCards/components/PromoCard/PromoCard.js +74 -0
  17. package/dist/es/components/PromoCards/types.d.ts +29 -0
  18. package/dist/es/components/PromoCards/types.js +0 -0
  19. package/dist/es/index.d.ts +3 -0
  20. package/dist/es/index.js +3 -0
  21. package/dist/lib/components/ButtonsBox/ButtonsBox.css +34 -0
  22. package/dist/lib/components/ButtonsBox/ButtonsBox.d.ts +48 -0
  23. package/dist/lib/components/ButtonsBox/ButtonsBox.js +110 -0
  24. package/dist/lib/components/Container/Container.css +519 -0
  25. package/dist/lib/components/InfoCards/InfoCards.d.ts +4 -1
  26. package/dist/lib/components/InfoCards/InfoCards.js +16 -13
  27. package/dist/lib/components/InfoCards/components/InfoCard/InfoCard.css +30 -7
  28. package/dist/lib/components/InfoCards/components/InfoCard/InfoCard.d.ts +4 -0
  29. package/dist/lib/components/InfoCards/components/InfoCard/InfoCard.js +19 -9
  30. package/dist/lib/components/InfoCards/types.d.ts +6 -1
  31. package/dist/lib/components/PromoCards/PromoCards.d.ts +28 -0
  32. package/dist/lib/components/PromoCards/PromoCards.js +113 -0
  33. package/dist/lib/components/PromoCards/components/PromoCard/PromoCard.css +157 -0
  34. package/dist/lib/components/PromoCards/components/PromoCard/PromoCard.d.ts +18 -0
  35. package/dist/lib/components/PromoCards/components/PromoCard/PromoCard.js +96 -0
  36. package/dist/lib/components/PromoCards/types.d.ts +29 -0
  37. package/dist/lib/components/PromoCards/types.js +1 -0
  38. package/dist/lib/index.d.ts +3 -0
  39. package/dist/lib/index.js +24 -0
  40. package/package.json +3 -3
@@ -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/es/index.js CHANGED
@@ -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";
@@ -0,0 +1,34 @@
1
+ h1,
2
+ h2,
3
+ h3,
4
+ h4,
5
+ h5 {
6
+ margin: 0;
7
+ }
8
+ .mfui-v6-buttons-box {
9
+ display: -webkit-box;
10
+ display: -ms-flexbox;
11
+ display: flex;
12
+ }
13
+ .mfui-v6-buttons-box__buttons_equal-width {
14
+ display: grid;
15
+ gap: 20px;
16
+ max-width: -webkit-max-content;
17
+ max-width: -moz-max-content;
18
+ max-width: max-content;
19
+ }
20
+ @media screen and (max-width: 767px) {
21
+ .mfui-v6-buttons-box__buttons_equal-width {
22
+ grid-template-rows: repeat(2, 1fr);
23
+ }
24
+ }
25
+ @media screen and (min-width: 768px) {
26
+ .mfui-v6-buttons-box__buttons_equal-width {
27
+ grid-template-columns: repeat(2, 1fr);
28
+ }
29
+ }
30
+ .mfui-v6-buttons-box_h-align_center {
31
+ -webkit-box-pack: center;
32
+ -ms-flex-pack: center;
33
+ justify-content: center;
34
+ }
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+ import './ButtonsBox.less';
3
+ export declare type ButtonType = {
4
+ /** Тип */
5
+ type?: 'primary' | 'outline';
6
+ /** Иконка */
7
+ icon?: JSX.Element;
8
+ /** Название */
9
+ title?: string;
10
+ /** Ссылка */
11
+ href?: string;
12
+ /** Target свойство кнопки */
13
+ target?: '_self' | '_blank' | '_parent' | '_top';
14
+ /** Rel - атрибут тега <a> */
15
+ rel?: string;
16
+ /** Задает атрибут download для тега <a> */
17
+ download?: boolean;
18
+ /** Показать стелку */
19
+ showArrow?: boolean;
20
+ /** Обработчик клика */
21
+ onClick?: (e: React.SyntheticEvent<EventTarget>) => void;
22
+ };
23
+ export interface IButtonsBox {
24
+ /** Дополнительные data атрибуты к внутренним элементам */
25
+ dataAttrs?: {
26
+ root?: Record<string, string>;
27
+ button?: Record<string, string>;
28
+ extraButton?: Record<string, string>;
29
+ };
30
+ /** Дополнительный класс корневого элемента */
31
+ className?: string;
32
+ /** Дополнительные классы для внутренних элементов */
33
+ classes?: {
34
+ root?: string;
35
+ button?: string;
36
+ extraButton?: string;
37
+ };
38
+ /** Кнопка */
39
+ button: ButtonType;
40
+ /** Дополнительная кнопка */
41
+ extraButton?: ButtonType;
42
+ /** Горизонтальное выравнивание */
43
+ align?: 'center' | 'left';
44
+ /** Ссылка на корневой элемент */
45
+ rootRef?: React.Ref<HTMLDivElement>;
46
+ }
47
+ declare const ButtonsBox: React.FC<IButtonsBox>;
48
+ export default ButtonsBox;
@@ -0,0 +1,110 @@
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
+ var _react = _interopRequireDefault(require("react"));
13
+
14
+ var _uiCore = require("@megafon/ui-core");
15
+
16
+ var _uiHelpers = require("@megafon/ui-helpers");
17
+
18
+ var PropTypes = _interopRequireWildcard(require("prop-types"));
19
+
20
+ var _setRelAttribute = require("../../helpers/setRelAttribute");
21
+
22
+ 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); }
23
+
24
+ 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; }
25
+
26
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
+
28
+ var cn = (0, _uiHelpers.cnCreate)('mfui-v6-buttons-box');
29
+
30
+ var ButtonsBox = function ButtonsBox(_ref) {
31
+ var className = _ref.className,
32
+ _ref$classes = _ref.classes,
33
+ classes = _ref$classes === void 0 ? {} : _ref$classes,
34
+ dataAttrs = _ref.dataAttrs,
35
+ button = _ref.button,
36
+ extraButton = _ref.extraButton,
37
+ align = _ref.align,
38
+ rootRef = _ref.rootRef;
39
+ var showTwoButtons = !!button && !!extraButton;
40
+
41
+ var renderButton = function renderButton(btnProps, btnClassName, dataAttr) {
42
+ return /*#__PURE__*/_react["default"].createElement(_uiCore.Button, {
43
+ dataAttrs: {
44
+ root: dataAttr
45
+ },
46
+ className: btnClassName,
47
+ fullWidth: showTwoButtons,
48
+ type: btnProps.type,
49
+ theme: "green",
50
+ icon: btnProps.icon,
51
+ href: btnProps.href,
52
+ target: btnProps.target,
53
+ download: btnProps.download,
54
+ showArrow: btnProps.showArrow,
55
+ rel: (0, _setRelAttribute.setRelAttribute)(btnProps.rel, btnProps.target),
56
+ onClick: btnProps.onClick
57
+ }, btnProps.title);
58
+ };
59
+
60
+ return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
61
+ className: cn({
62
+ 'h-align': align
63
+ }, [className, classes.root]),
64
+ ref: rootRef
65
+ }), /*#__PURE__*/_react["default"].createElement("div", {
66
+ className: cn('buttons', {
67
+ 'equal-width': showTwoButtons
68
+ })
69
+ }, !!button && renderButton(button, classes.button, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button), !!extraButton && renderButton(extraButton, classes.extraButton, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.extraButton)));
70
+ };
71
+
72
+ ButtonsBox.propTypes = {
73
+ dataAttrs: PropTypes.shape({
74
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
75
+ link: PropTypes.objectOf(PropTypes.string.isRequired),
76
+ button: PropTypes.objectOf(PropTypes.string.isRequired)
77
+ }),
78
+ className: PropTypes.string,
79
+ classes: PropTypes.shape({
80
+ root: PropTypes.string,
81
+ button: PropTypes.string,
82
+ link: PropTypes.string
83
+ }),
84
+ rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
85
+ current: PropTypes.elementType
86
+ }), PropTypes.any])]),
87
+ align: PropTypes.oneOf(['center', 'left']),
88
+ button: PropTypes.shape({
89
+ type: PropTypes.oneOf(['primary', 'outline']),
90
+ icon: PropTypes.element,
91
+ title: PropTypes.string,
92
+ href: PropTypes.string,
93
+ target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
94
+ rel: PropTypes.string,
95
+ download: PropTypes.bool,
96
+ onClick: PropTypes.func
97
+ }).isRequired,
98
+ extraButton: PropTypes.shape({
99
+ type: PropTypes.oneOf(['primary', 'outline']),
100
+ icon: PropTypes.element,
101
+ title: PropTypes.string,
102
+ href: PropTypes.string,
103
+ target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
104
+ rel: PropTypes.string,
105
+ download: PropTypes.bool,
106
+ onClick: PropTypes.func
107
+ })
108
+ };
109
+ var _default = ButtonsBox;
110
+ exports["default"] = _default;