@megafon/ui-core 5.17.0 → 5.18.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.18.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@5.17.0...@megafon/ui-core@5.18.0) (2024-07-08)
7
+
8
+
9
+ ### Features
10
+
11
+ * **contentview:** add props to ContentView component ([ffa2dcc](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/ffa2dcc51305f96190aa65157733a3b624e462ac))
12
+
13
+
14
+
15
+
16
+
6
17
  # [5.17.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@5.16.0...@megafon/ui-core@5.17.0) (2024-07-01)
7
18
 
8
19
 
@@ -22,6 +22,7 @@ export interface IContentViewProps {
22
22
  title?: string;
23
23
  button?: string;
24
24
  link?: string;
25
+ bgImage?: string;
25
26
  };
26
27
  /** Заголовок */
27
28
  title: string;
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import "core-js/modules/es.string.link.js";
3
3
  import * as React from 'react';
4
- import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
4
+ import { cnCreate, convert, filterDataAttrs, titleConvertConfig } from '@megafon/ui-helpers';
5
5
  import * as PropTypes from 'prop-types';
6
6
  import Button from "../Button/Button";
7
7
  import "./ContentView.css";
@@ -31,14 +31,14 @@ var ContentView = function ContentView(_ref) {
31
31
  }, !!type && /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.bgImage), {
32
32
  className: cn('bg-image', {
33
33
  type: type
34
- })
34
+ }, [classes.bgImage])
35
35
  })), !!src && !type && /*#__PURE__*/React.createElement("img", {
36
36
  className: cn('image'),
37
37
  src: src,
38
38
  alt: alt
39
39
  }), /*#__PURE__*/React.createElement("div", {
40
40
  className: cn('title', [classes.title])
41
- }, title), !!children && /*#__PURE__*/React.createElement("div", {
41
+ }, convert(title, titleConvertConfig)), !!children && /*#__PURE__*/React.createElement("div", {
42
42
  className: cn('text')
43
43
  }, children)), showButtons && /*#__PURE__*/React.createElement("div", {
44
44
  className: cn('buttons')
@@ -68,6 +68,12 @@ var ContentView = function ContentView(_ref) {
68
68
 
69
69
  ContentView.propTypes = {
70
70
  className: PropTypes.string,
71
+ classes: PropTypes.shape({
72
+ title: PropTypes.string,
73
+ button: PropTypes.string,
74
+ link: PropTypes.string,
75
+ bgImage: PropTypes.string
76
+ }),
71
77
  title: PropTypes.string.isRequired,
72
78
  type: PropTypes.oneOf(['waiting', 'error', 'submit', 'success', 'fail', 'update', 'alarm', 'empty', 'searchNoResult']),
73
79
  alt: PropTypes.string,
@@ -22,6 +22,7 @@ export interface IContentViewProps {
22
22
  title?: string;
23
23
  button?: string;
24
24
  link?: string;
25
+ bgImage?: string;
25
26
  };
26
27
  /** Заголовок */
27
28
  title: string;
@@ -51,14 +51,14 @@ var ContentView = function ContentView(_ref) {
51
51
  }, !!type && /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.bgImage), {
52
52
  className: cn('bg-image', {
53
53
  type: type
54
- })
54
+ }, [classes.bgImage])
55
55
  })), !!src && !type && /*#__PURE__*/React.createElement("img", {
56
56
  className: cn('image'),
57
57
  src: src,
58
58
  alt: alt
59
59
  }), /*#__PURE__*/React.createElement("div", {
60
60
  className: cn('title', [classes.title])
61
- }, title), !!children && /*#__PURE__*/React.createElement("div", {
61
+ }, (0, _uiHelpers.convert)(title, _uiHelpers.titleConvertConfig)), !!children && /*#__PURE__*/React.createElement("div", {
62
62
  className: cn('text')
63
63
  }, children)), showButtons && /*#__PURE__*/React.createElement("div", {
64
64
  className: cn('buttons')
@@ -88,6 +88,12 @@ var ContentView = function ContentView(_ref) {
88
88
 
89
89
  ContentView.propTypes = {
90
90
  className: PropTypes.string,
91
+ classes: PropTypes.shape({
92
+ title: PropTypes.string,
93
+ button: PropTypes.string,
94
+ link: PropTypes.string,
95
+ bgImage: PropTypes.string
96
+ }),
91
97
  title: PropTypes.string.isRequired,
92
98
  type: PropTypes.oneOf(['waiting', 'error', 'submit', 'success', 'fail', 'update', 'alarm', 'empty', 'searchNoResult']),
93
99
  alt: PropTypes.string,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-core",
3
- "version": "5.17.0",
3
+ "version": "5.18.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "styles"
@@ -50,7 +50,7 @@
50
50
  "@babel/preset-env": "^7.8.6",
51
51
  "@babel/preset-react": "^7.8.3",
52
52
  "@babel/preset-typescript": "^7.8.3",
53
- "@megafon/ui-icons": "^2.25.0",
53
+ "@megafon/ui-icons": "^2.26.0",
54
54
  "@svgr/core": "^2.4.1",
55
55
  "@testing-library/jest-dom": "5.16.2",
56
56
  "@testing-library/react": "12.1.2",
@@ -99,5 +99,5 @@
99
99
  "react-popper": "^2.2.3",
100
100
  "swiper": "^6.5.6"
101
101
  },
102
- "gitHead": "426c7d8e65c13746f9cc1c895a2e7e1b4b08316a"
102
+ "gitHead": "083ea89de7d915f3d2d74aff90e4ec8213a235f5"
103
103
  }