@megafon/ui-shared 3.0.0-beta.6 → 3.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 (50) hide show
  1. package/CHANGELOG.md +31 -53
  2. package/dist/es/components/AccordionBox/AccordionBox.d.ts +2 -4
  3. package/dist/es/components/AccordionBox/AccordionBox.js +3 -2
  4. package/dist/es/components/ButtonBanner/ButtonBanner.d.ts +2 -2
  5. package/dist/es/components/ButtonBanner/ButtonBanner.js +4 -2
  6. package/dist/es/components/ButtonLinkBox/ButtonLinkBox.d.ts +2 -2
  7. package/dist/es/components/ButtonLinkBox/ButtonLinkBox.js +4 -2
  8. package/dist/es/components/Container/Container.css +163 -0
  9. package/dist/es/components/StoreBanner/StoreBanner.css +21 -22
  10. package/dist/es/components/StoreBanner/StoreBanner.d.ts +2 -2
  11. package/dist/es/components/StoreBanner/StoreBanner.js +5 -3
  12. package/dist/es/components/StoreBanner/doc/img/qr-code.png +0 -0
  13. package/dist/es/components/TextBox/TextBox.css +9 -0
  14. package/dist/es/components/TextWithIcon/TextWithIcon.css +15 -0
  15. package/dist/es/components/TextWithIcon/TextWithIcon.d.ts +19 -0
  16. package/dist/es/components/TextWithIcon/TextWithIcon.js +40 -0
  17. package/dist/es/components/TextWithIcon/TextWithIconItem.css +49 -0
  18. package/dist/es/components/TextWithIcon/TextWithIconItem.d.ts +18 -0
  19. package/dist/es/components/TextWithIcon/TextWithIconItem.js +35 -0
  20. package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +2 -2
  21. package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.js +4 -2
  22. package/dist/es/components/VideoBlock/VideoBlock.d.ts +1 -1
  23. package/dist/es/components/VideoBlock/VideoBlock.js +3 -3
  24. package/dist/es/index.d.ts +2 -0
  25. package/dist/es/index.js +2 -0
  26. package/dist/lib/components/AccordionBox/AccordionBox.d.ts +2 -4
  27. package/dist/lib/components/AccordionBox/AccordionBox.js +3 -2
  28. package/dist/lib/components/ButtonBanner/ButtonBanner.d.ts +2 -2
  29. package/dist/lib/components/ButtonBanner/ButtonBanner.js +4 -2
  30. package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.d.ts +2 -2
  31. package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.js +4 -2
  32. package/dist/lib/components/Container/Container.css +163 -0
  33. package/dist/lib/components/StoreBanner/StoreBanner.css +21 -22
  34. package/dist/lib/components/StoreBanner/StoreBanner.d.ts +2 -2
  35. package/dist/lib/components/StoreBanner/StoreBanner.js +5 -3
  36. package/dist/lib/components/StoreBanner/doc/img/qr-code.png +0 -0
  37. package/dist/lib/components/TextBox/TextBox.css +9 -0
  38. package/dist/lib/components/TextWithIcon/TextWithIcon.css +15 -0
  39. package/dist/lib/components/TextWithIcon/TextWithIcon.d.ts +19 -0
  40. package/dist/lib/components/TextWithIcon/TextWithIcon.js +60 -0
  41. package/dist/lib/components/TextWithIcon/TextWithIconItem.css +49 -0
  42. package/dist/lib/components/TextWithIcon/TextWithIconItem.d.ts +18 -0
  43. package/dist/lib/components/TextWithIcon/TextWithIconItem.js +54 -0
  44. package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +2 -2
  45. package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.js +4 -2
  46. package/dist/lib/components/VideoBlock/VideoBlock.d.ts +1 -1
  47. package/dist/lib/components/VideoBlock/VideoBlock.js +3 -3
  48. package/dist/lib/index.d.ts +2 -0
  49. package/dist/lib/index.js +16 -0
  50. package/package.json +5 -5
@@ -0,0 +1,60 @@
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 = _interopRequireWildcard(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
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
21
+
22
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
+
26
+ var cn = (0, _uiHelpers.cnCreate)('mfui-text-with-icon');
27
+
28
+ var TextWithIcon = function TextWithIcon(_ref) {
29
+ var title = _ref.title,
30
+ rootRef = _ref.rootRef,
31
+ dataAttrs = _ref.dataAttrs,
32
+ className = _ref.className,
33
+ children = _ref.children;
34
+ return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
35
+ className: cn([className]),
36
+ ref: rootRef
37
+ }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement(_uiCore.Grid, null, /*#__PURE__*/React.createElement(_uiCore.GridColumn, {
38
+ mobile: '12',
39
+ tablet: '7',
40
+ desktop: '6',
41
+ wide: '6'
42
+ }, title && /*#__PURE__*/React.createElement(_uiCore.Header, {
43
+ className: cn('header'),
44
+ as: "h5"
45
+ }, title), children)));
46
+ };
47
+
48
+ TextWithIcon.propTypes = {
49
+ title: PropTypes.string,
50
+ rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
51
+ current: PropTypes.elementType
52
+ }), PropTypes.any])]),
53
+ dataAttrs: PropTypes.shape({
54
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
55
+ }),
56
+ children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element.isRequired]).isRequired,
57
+ className: PropTypes.string
58
+ };
59
+ var _default = TextWithIcon;
60
+ exports["default"] = _default;
@@ -0,0 +1,49 @@
1
+ h1,
2
+ h2,
3
+ h3,
4
+ h4,
5
+ h5 {
6
+ margin: 0;
7
+ }
8
+ .mfui-text-with-icon-item {
9
+ display: -webkit-box;
10
+ display: -ms-flexbox;
11
+ display: flex;
12
+ -webkit-box-align: center;
13
+ -ms-flex-align: center;
14
+ align-items: center;
15
+ }
16
+ @media screen and (max-width: 767px) {
17
+ .mfui-text-with-icon-item {
18
+ -webkit-box-orient: vertical;
19
+ -webkit-box-direction: normal;
20
+ -ms-flex-direction: column;
21
+ flex-direction: column;
22
+ }
23
+ }
24
+ .mfui-text-with-icon-item:not(:first-of-type) {
25
+ margin-top: 16px;
26
+ }
27
+ @media screen and (max-width: 767px) {
28
+ .mfui-text-with-icon-item:not(:first-of-type) {
29
+ margin-top: 24px;
30
+ }
31
+ }
32
+ .mfui-text-with-icon-item__svg-icon {
33
+ width: 40px;
34
+ min-width: 40px;
35
+ height: 40px;
36
+ min-height: 40px;
37
+ overflow: hidden;
38
+ }
39
+ @media screen and (min-width: 768px) {
40
+ .mfui-text-with-icon-item__svg-icon {
41
+ margin-right: 16px;
42
+ }
43
+ }
44
+ @media screen and (max-width: 767px) {
45
+ .mfui-text-with-icon-item__text {
46
+ margin-top: 12px;
47
+ text-align: center;
48
+ }
49
+ }
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import './TextWithIconItem.less';
3
+ export interface ITextWithIconItem {
4
+ /** Текст */
5
+ text: string;
6
+ /** Иконка */
7
+ icon: React.ReactNode;
8
+ /** Ссылка на корневой элемент */
9
+ rootRef?: React.Ref<HTMLDivElement>;
10
+ /** Дополнительные data атрибуты к внутренним элементам */
11
+ dataAttrs?: {
12
+ root?: Record<string, string>;
13
+ };
14
+ /** Дополнительный класс для корневого элемента */
15
+ className?: string;
16
+ }
17
+ declare const TextWithIconItem: React.FC<ITextWithIconItem>;
18
+ export default TextWithIconItem;
@@ -0,0 +1,54 @@
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 = _interopRequireWildcard(require("react"));
13
+
14
+ var _uiHelpers = require("@megafon/ui-helpers");
15
+
16
+ var PropTypes = _interopRequireWildcard(require("prop-types"));
17
+
18
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
19
+
20
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
+
24
+ var cn = (0, _uiHelpers.cnCreate)('mfui-text-with-icon-item');
25
+
26
+ var TextWithIconItem = function TextWithIconItem(_ref) {
27
+ var text = _ref.text,
28
+ icon = _ref.icon,
29
+ rootRef = _ref.rootRef,
30
+ dataAttrs = _ref.dataAttrs,
31
+ className = _ref.className;
32
+ return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
33
+ className: cn([className]),
34
+ ref: rootRef
35
+ }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("div", {
36
+ className: cn('svg-icon')
37
+ }, icon), /*#__PURE__*/React.createElement("div", {
38
+ className: cn('text')
39
+ }, text));
40
+ };
41
+
42
+ TextWithIconItem.propTypes = {
43
+ text: PropTypes.string.isRequired,
44
+ icon: PropTypes.node.isRequired,
45
+ rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
46
+ current: PropTypes.elementType
47
+ }), PropTypes.any])]),
48
+ dataAttrs: PropTypes.shape({
49
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
50
+ }),
51
+ className: PropTypes.string
52
+ };
53
+ var _default = TextWithIconItem;
54
+ exports["default"] = _default;
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import './TitleDescriptionBox.less';
3
3
  export interface ITitleDescriptionBoxProps {
4
- /** Дата атрибуты для корневого элемента */
4
+ /** Дополнительные data атрибуты к внутренним элементам */
5
5
  dataAttrs?: {
6
- [key: string]: string;
6
+ root?: Record<string, string>;
7
7
  };
8
8
  /** Ссылка на корневой элемент */
9
9
  rootRef?: React.Ref<HTMLDivElement>;
@@ -50,7 +50,7 @@ var TitleDescriptionBox = function TitleDescriptionBox(_ref) {
50
50
  className: cn('description')
51
51
  }, description);
52
52
  }, [description]);
53
- return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs), {
53
+ return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
54
54
  className: cn({
55
55
  'h-align': hAlign,
56
56
  'text-color': textColor
@@ -71,7 +71,9 @@ var TitleDescriptionBox = function TitleDescriptionBox(_ref) {
71
71
  };
72
72
 
73
73
  TitleDescriptionBox.propTypes = {
74
- dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired),
74
+ dataAttrs: PropTypes.shape({
75
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
76
+ }),
75
77
  rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
76
78
  current: PropTypes.elementType
77
79
  }), PropTypes.any])]),
@@ -6,7 +6,7 @@ export interface IContent {
6
6
  /** Текст-описание */
7
7
  description: string | React.ReactNode[] | React.ReactNode;
8
8
  /** Текст кнопки */
9
- buttonTitle: string;
9
+ buttonTitle?: string;
10
10
  /** Добавляет атрибут download для тега <a> компонента Button */
11
11
  buttonDownload?: boolean;
12
12
  /** Ссылка на кнопке */
@@ -101,7 +101,7 @@ var VideoBlock = function VideoBlock(_ref) {
101
101
  className: cn('header')
102
102
  }, title), /*#__PURE__*/_react["default"].createElement("div", {
103
103
  className: cn('description', [classes.description])
104
- }, description), /*#__PURE__*/_react["default"].createElement(_uiCore.Button, {
104
+ }, description), buttonTitle && /*#__PURE__*/_react["default"].createElement(_uiCore.Button, {
105
105
  className: cn('button', [classes.button]),
106
106
  href: href,
107
107
  onClick: onButtonClick,
@@ -121,7 +121,7 @@ var VideoBlock = function VideoBlock(_ref) {
121
121
  orderTablet: "2",
122
122
  orderMobile: "2",
123
123
  key: "column-content"
124
- }, renderContent && renderContent(content)));
124
+ }, renderContent(content)));
125
125
  }
126
126
 
127
127
  columns.push( /*#__PURE__*/_react["default"].createElement(_uiCore.GridColumn, {
@@ -161,7 +161,7 @@ VideoBlock.propTypes = {
161
161
  title: _propTypes["default"].string.isRequired,
162
162
  description: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node]).isRequired,
163
163
  href: _propTypes["default"].string,
164
- buttonTitle: _propTypes["default"].string.isRequired,
164
+ buttonTitle: _propTypes["default"].string,
165
165
  buttonDownload: _propTypes["default"].bool,
166
166
  onButtonClick: _propTypes["default"].func
167
167
  }),
@@ -29,6 +29,8 @@ export { default as TableRow } from './components/Table/TableRow';
29
29
  export { default as TabsBox } from './components/TabsBox/TabsBox';
30
30
  export { default as TextBox } from './components/TextBox/TextBox';
31
31
  export { default as TextBoxPicture } from './components/TextBox/TextBoxPicture';
32
+ export { default as TextWithIcon } from './components/TextWithIcon/TextWithIcon';
33
+ export { default as TextWithIconItem } from './components/TextWithIcon/TextWithIconItem';
32
34
  export { default as TitleDescriptionBox } from './components/TitleDescriptionBox/TitleDescriptionBox';
33
35
  export { default as VideoBanner } from './components/VideoBanner/VideoBanner';
34
36
  export { default as VideoBlock } from './components/VideoBlock/VideoBlock';
package/dist/lib/index.js CHANGED
@@ -189,6 +189,18 @@ Object.defineProperty(exports, "TextBoxPicture", {
189
189
  return _TextBoxPicture["default"];
190
190
  }
191
191
  });
192
+ Object.defineProperty(exports, "TextWithIcon", {
193
+ enumerable: true,
194
+ get: function get() {
195
+ return _TextWithIcon["default"];
196
+ }
197
+ });
198
+ Object.defineProperty(exports, "TextWithIconItem", {
199
+ enumerable: true,
200
+ get: function get() {
201
+ return _TextWithIconItem["default"];
202
+ }
203
+ });
192
204
  Object.defineProperty(exports, "TitleDescriptionBox", {
193
205
  enumerable: true,
194
206
  get: function get() {
@@ -270,6 +282,10 @@ var _TextBox = _interopRequireDefault(require("./components/TextBox/TextBox"));
270
282
 
271
283
  var _TextBoxPicture = _interopRequireDefault(require("./components/TextBox/TextBoxPicture"));
272
284
 
285
+ var _TextWithIcon = _interopRequireDefault(require("./components/TextWithIcon/TextWithIcon"));
286
+
287
+ var _TextWithIconItem = _interopRequireDefault(require("./components/TextWithIcon/TextWithIconItem"));
288
+
273
289
  var _TitleDescriptionBox = _interopRequireDefault(require("./components/TitleDescriptionBox/TitleDescriptionBox"));
274
290
 
275
291
  var _VideoBanner = _interopRequireDefault(require("./components/VideoBanner/VideoBanner"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-shared",
3
- "version": "3.0.0-beta.6",
3
+ "version": "3.0.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -52,7 +52,7 @@
52
52
  "@babel/preset-env": "^7.8.6",
53
53
  "@babel/preset-react": "^7.8.3",
54
54
  "@babel/preset-typescript": "^7.8.3",
55
- "@megafon/ui-icons": "^1.0.0-beta.3",
55
+ "@megafon/ui-icons": "^1.0.0",
56
56
  "@svgr/core": "^2.4.1",
57
57
  "@types/enzyme": "^3.10.5",
58
58
  "@types/enzyme-adapter-react-16": "^1.0.6",
@@ -82,13 +82,13 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "@babel/runtime": "^7.8.4",
85
- "@megafon/ui-core": "^3.0.0-beta.6",
86
- "@megafon/ui-helpers": "^2.0.0-beta.3",
85
+ "@megafon/ui-core": "^3.0.0",
86
+ "@megafon/ui-helpers": "^2.0.0",
87
87
  "core-js": "^3.6.4",
88
88
  "htmr": "^0.9.2",
89
89
  "lodash.throttle": "^4.1.1",
90
90
  "prop-types": "^15.7.2",
91
91
  "swiper": "^6.5.6"
92
92
  },
93
- "gitHead": "b9c40183bddf83627eb55aefdfc561babfd1f64f"
93
+ "gitHead": "6c0ceaf24ab250ae0d733395974991f0b58572b6"
94
94
  }