@megafon/ui-core 5.4.1 → 5.4.3

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,27 @@
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.4.3](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@5.4.2...@megafon/ui-core@5.4.3) (2024-01-09)
7
+
8
+ **Note:** Version bump only for package @megafon/ui-core
9
+
10
+
11
+
12
+
13
+
14
+ ## [5.4.2](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@5.4.1...@megafon/ui-core@5.4.2) (2023-12-14)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **notification:** added root ref, link class ([4b6e76c](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/4b6e76cbeee4b17b46f0abae2c73ec879d9201de))
20
+ * **pricebadge:** change font-weight from 400 to 500 ([79e3480](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/79e3480a8f6254101b687db949b3257c2fa00a32))
21
+ * **search:** add extra classes ([2bef678](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/2bef67859c166644194bf39ea380465617e80ad7))
22
+
23
+
24
+
25
+
26
+
6
27
  ## [5.4.1](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@5.4.0...@megafon/ui-core@5.4.1) (2023-11-27)
7
28
 
8
29
 
@@ -7,23 +7,24 @@
7
7
  -webkit-box-align: center;
8
8
  -ms-flex-align: center;
9
9
  align-items: center;
10
- padding: 2px;
11
- padding-right: 8px;
12
10
  width: -webkit-fit-content;
13
11
  width: -moz-fit-content;
14
12
  width: fit-content;
15
13
  height: -webkit-fit-content;
16
14
  height: -moz-fit-content;
17
15
  height: fit-content;
16
+ padding: 2px;
17
+ padding-right: 8px;
18
18
  border-radius: 8px;
19
+ font-weight: 500;
19
20
  }
20
21
  @media screen and (min-width: 1024px) {
21
22
  .mfui-price-badge_adaptive {
22
23
  font-size: 15px;
23
24
  line-height: 24px;
25
+ min-height: 32px;
24
26
  padding: 4px;
25
27
  padding-right: 8px;
26
- min-height: 32px;
27
28
  border-radius: 12px;
28
29
  }
29
30
  }
@@ -64,9 +65,9 @@
64
65
  fill: var(--fury);
65
66
  }
66
67
  .mfui-price-badge_size_big {
68
+ padding: 12px 12px 12px 4px;
67
69
  font-size: 15px;
68
70
  line-height: 18px;
69
- padding: 12px 12px 12px 4px;
70
71
  }
71
72
  .mfui-price-badge__text {
72
73
  font-family: inherit;
@@ -78,17 +79,17 @@
78
79
  display: flex;
79
80
  }
80
81
  .mfui-price-badge__icon {
81
- height: 20px;
82
82
  width: 20px;
83
83
  min-width: 20px;
84
+ height: 20px;
84
85
  }
85
86
  .mfui-price-badge_size_big .mfui-price-badge__icon {
86
- height: 32px;
87
87
  width: 32px;
88
88
  min-width: 32px;
89
+ height: 32px;
89
90
  }
90
91
  .mfui-price-badge_size_big .mfui-price-badge__sub-title {
92
+ margin-top: 2px;
91
93
  font-size: 12px;
92
94
  line-height: 18px;
93
- margin-top: 2px;
94
95
  }
@@ -22,6 +22,7 @@ export interface INotificationProps {
22
22
  root?: string;
23
23
  container?: string;
24
24
  content?: string;
25
+ link?: string;
25
26
  };
26
27
  /** Тип отображения */
27
28
  type?: NotificationType;
@@ -67,6 +68,8 @@ export interface INotificationProps {
67
68
  button?: Record<string, string>;
68
69
  collapseButton?: Record<string, string>;
69
70
  };
71
+ /** Ссылка на элемент */
72
+ rootRef?: React.Ref<HTMLDivElement>;
70
73
  /** Обработчик на закрытие */
71
74
  onClose?: () => void;
72
75
  /** Обработчик клика по ссылке */
@@ -96,6 +96,7 @@ var Notification = function Notification(_ref) {
96
96
  var rootClass = _ref$classes.root,
97
97
  containerClass = _ref$classes.container,
98
98
  contentClass = _ref$classes.content,
99
+ linkClass = _ref$classes.link,
99
100
  children = _ref.children,
100
101
  _ref$type = _ref.type,
101
102
  type = _ref$type === void 0 ? 'info' : _ref$type,
@@ -122,6 +123,7 @@ var Notification = function Notification(_ref) {
122
123
  href = _ref.href,
123
124
  target = _ref.target,
124
125
  icon = _ref.icon,
126
+ rootRef = _ref.rootRef,
125
127
  dataAttrs = _ref.dataAttrs,
126
128
  onClose = _ref.onClose,
127
129
  onLinkClick = _ref.onLinkClick,
@@ -208,7 +210,7 @@ var Notification = function Notification(_ref) {
208
210
  dataAttrs: {
209
211
  root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link
210
212
  },
211
- className: cn('link'),
213
+ className: cn('link', [linkClass]),
212
214
  onClick: onLinkClick,
213
215
  rel: rel,
214
216
  href: href,
@@ -271,18 +273,19 @@ var Notification = function Notification(_ref) {
271
273
  };
272
274
 
273
275
  return /*#__PURE__*/React.createElement(Tile, {
274
- dataAttrs: {
275
- root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root
276
- },
277
- radius: "rounded",
278
- shadowLevel: shadowLevel,
279
276
  className: cn({
280
277
  type: type,
281
278
  colored: isColored
282
- }, [className, rootClass])
279
+ }, [className, rootClass]),
280
+ radius: "rounded",
281
+ shadowLevel: shadowLevel,
282
+ dataAttrs: {
283
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root
284
+ }
283
285
  }, /*#__PURE__*/React.createElement("div", {
284
286
  "data-testid": "".concat(testIdPrefix, "-container"),
285
- className: cn('container', [containerClass])
287
+ className: cn('container', [containerClass]),
288
+ ref: rootRef
286
289
  }, /*#__PURE__*/React.createElement("div", {
287
290
  className: cn('icon-container')
288
291
  }, renderIcon()), /*#__PURE__*/React.createElement("div", {
@@ -326,7 +329,8 @@ Notification.propTypes = {
326
329
  classes: PropTypes.shape({
327
330
  root: PropTypes.string,
328
331
  container: PropTypes.string,
329
- content: PropTypes.string
332
+ content: PropTypes.string,
333
+ link: PropTypes.string
330
334
  }),
331
335
  shadowLevel: PropTypes.oneOf(Object.values(ShadowTypes)),
332
336
  isColored: PropTypes.bool,
@@ -344,6 +348,9 @@ Notification.propTypes = {
344
348
  href: PropTypes.string,
345
349
  target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
346
350
  icon: PropTypes.element,
351
+ rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
352
+ current: PropTypes.elementType
353
+ }), PropTypes.any])]),
347
354
  dataAttrs: PropTypes.shape({
348
355
  root: PropTypes.objectOf(PropTypes.string.isRequired),
349
356
  title: PropTypes.objectOf(PropTypes.string.isRequired),
@@ -62,6 +62,7 @@ export interface ISearchProps {
62
62
  listItemTitle?: string;
63
63
  control?: string;
64
64
  icon?: string;
65
+ submitButton?: string;
65
66
  };
66
67
  /** Отображение загрузки */
67
68
  showLoader?: boolean;
@@ -9,9 +9,9 @@ import "core-js/modules/es.array.map.js";
9
9
  import "core-js/modules/es.object.values.js";
10
10
  import React from 'react';
11
11
  import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
12
- import Preloader from "../Preloader/Preloader";
13
12
  import debounce from 'lodash.debounce';
14
13
  import * as PropTypes from 'prop-types';
14
+ import Preloader from "../Preloader/Preloader";
15
15
  import "./Search.css";
16
16
 
17
17
  var SearchIcon16 = function SearchIcon16(props) {
@@ -223,7 +223,7 @@ var Search = function Search(_ref) {
223
223
  var renderSubmitButton = function renderSubmitButton() {
224
224
  var Icon = isCompact ? SearchIcon16 : SearchIcon;
225
225
  return /*#__PURE__*/React.createElement("button", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.submit), {
226
- className: cn('submit-button'),
226
+ className: cn('submit-button', [classes === null || classes === void 0 ? void 0 : classes.submitButton]),
227
227
  onClick: handleSearchSubmit,
228
228
  type: "button"
229
229
  }), /*#__PURE__*/React.createElement(Icon, {
@@ -7,23 +7,24 @@
7
7
  -webkit-box-align: center;
8
8
  -ms-flex-align: center;
9
9
  align-items: center;
10
- padding: 2px;
11
- padding-right: 8px;
12
10
  width: -webkit-fit-content;
13
11
  width: -moz-fit-content;
14
12
  width: fit-content;
15
13
  height: -webkit-fit-content;
16
14
  height: -moz-fit-content;
17
15
  height: fit-content;
16
+ padding: 2px;
17
+ padding-right: 8px;
18
18
  border-radius: 8px;
19
+ font-weight: 500;
19
20
  }
20
21
  @media screen and (min-width: 1024px) {
21
22
  .mfui-price-badge_adaptive {
22
23
  font-size: 15px;
23
24
  line-height: 24px;
25
+ min-height: 32px;
24
26
  padding: 4px;
25
27
  padding-right: 8px;
26
- min-height: 32px;
27
28
  border-radius: 12px;
28
29
  }
29
30
  }
@@ -64,9 +65,9 @@
64
65
  fill: var(--fury);
65
66
  }
66
67
  .mfui-price-badge_size_big {
68
+ padding: 12px 12px 12px 4px;
67
69
  font-size: 15px;
68
70
  line-height: 18px;
69
- padding: 12px 12px 12px 4px;
70
71
  }
71
72
  .mfui-price-badge__text {
72
73
  font-family: inherit;
@@ -78,17 +79,17 @@
78
79
  display: flex;
79
80
  }
80
81
  .mfui-price-badge__icon {
81
- height: 20px;
82
82
  width: 20px;
83
83
  min-width: 20px;
84
+ height: 20px;
84
85
  }
85
86
  .mfui-price-badge_size_big .mfui-price-badge__icon {
86
- height: 32px;
87
87
  width: 32px;
88
88
  min-width: 32px;
89
+ height: 32px;
89
90
  }
90
91
  .mfui-price-badge_size_big .mfui-price-badge__sub-title {
92
+ margin-top: 2px;
91
93
  font-size: 12px;
92
94
  line-height: 18px;
93
- margin-top: 2px;
94
95
  }
@@ -22,6 +22,7 @@ export interface INotificationProps {
22
22
  root?: string;
23
23
  container?: string;
24
24
  content?: string;
25
+ link?: string;
25
26
  };
26
27
  /** Тип отображения */
27
28
  type?: NotificationType;
@@ -67,6 +68,8 @@ export interface INotificationProps {
67
68
  button?: Record<string, string>;
68
69
  collapseButton?: Record<string, string>;
69
70
  };
71
+ /** Ссылка на элемент */
72
+ rootRef?: React.Ref<HTMLDivElement>;
70
73
  /** Обработчик на закрытие */
71
74
  onClose?: () => void;
72
75
  /** Обработчик клика по ссылке */
@@ -121,6 +121,7 @@ var Notification = function Notification(_ref) {
121
121
  var rootClass = _ref$classes.root,
122
122
  containerClass = _ref$classes.container,
123
123
  contentClass = _ref$classes.content,
124
+ linkClass = _ref$classes.link,
124
125
  children = _ref.children,
125
126
  _ref$type = _ref.type,
126
127
  type = _ref$type === void 0 ? 'info' : _ref$type,
@@ -147,6 +148,7 @@ var Notification = function Notification(_ref) {
147
148
  href = _ref.href,
148
149
  target = _ref.target,
149
150
  icon = _ref.icon,
151
+ rootRef = _ref.rootRef,
150
152
  dataAttrs = _ref.dataAttrs,
151
153
  onClose = _ref.onClose,
152
154
  onLinkClick = _ref.onLinkClick,
@@ -233,7 +235,7 @@ var Notification = function Notification(_ref) {
233
235
  dataAttrs: {
234
236
  root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link
235
237
  },
236
- className: cn('link'),
238
+ className: cn('link', [linkClass]),
237
239
  onClick: onLinkClick,
238
240
  rel: rel,
239
241
  href: href,
@@ -296,18 +298,19 @@ var Notification = function Notification(_ref) {
296
298
  };
297
299
 
298
300
  return /*#__PURE__*/_react["default"].createElement(_Tile["default"], {
299
- dataAttrs: {
300
- root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root
301
- },
302
- radius: "rounded",
303
- shadowLevel: shadowLevel,
304
301
  className: cn({
305
302
  type: type,
306
303
  colored: isColored
307
- }, [className, rootClass])
304
+ }, [className, rootClass]),
305
+ radius: "rounded",
306
+ shadowLevel: shadowLevel,
307
+ dataAttrs: {
308
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root
309
+ }
308
310
  }, /*#__PURE__*/_react["default"].createElement("div", {
309
311
  "data-testid": "".concat(testIdPrefix, "-container"),
310
- className: cn('container', [containerClass])
312
+ className: cn('container', [containerClass]),
313
+ ref: rootRef
311
314
  }, /*#__PURE__*/_react["default"].createElement("div", {
312
315
  className: cn('icon-container')
313
316
  }, renderIcon()), /*#__PURE__*/_react["default"].createElement("div", {
@@ -351,7 +354,8 @@ Notification.propTypes = {
351
354
  classes: PropTypes.shape({
352
355
  root: PropTypes.string,
353
356
  container: PropTypes.string,
354
- content: PropTypes.string
357
+ content: PropTypes.string,
358
+ link: PropTypes.string
355
359
  }),
356
360
  shadowLevel: PropTypes.oneOf(Object.values(ShadowTypes)),
357
361
  isColored: PropTypes.bool,
@@ -369,6 +373,9 @@ Notification.propTypes = {
369
373
  href: PropTypes.string,
370
374
  target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
371
375
  icon: PropTypes.element,
376
+ rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
377
+ current: PropTypes.elementType
378
+ }), PropTypes.any])]),
372
379
  dataAttrs: PropTypes.shape({
373
380
  root: PropTypes.objectOf(PropTypes.string.isRequired),
374
381
  title: PropTypes.objectOf(PropTypes.string.isRequired),
@@ -62,6 +62,7 @@ export interface ISearchProps {
62
62
  listItemTitle?: string;
63
63
  control?: string;
64
64
  icon?: string;
65
+ submitButton?: string;
65
66
  };
66
67
  /** Отображение загрузки */
67
68
  showLoader?: boolean;
@@ -29,12 +29,12 @@ var _react = _interopRequireDefault(require("react"));
29
29
 
30
30
  var _uiHelpers = require("@megafon/ui-helpers");
31
31
 
32
- var _Preloader = _interopRequireDefault(require("../Preloader/Preloader"));
33
-
34
32
  var _lodash = _interopRequireDefault(require("lodash.debounce"));
35
33
 
36
34
  var PropTypes = _interopRequireWildcard(require("prop-types"));
37
35
 
36
+ var _Preloader = _interopRequireDefault(require("../Preloader/Preloader"));
37
+
38
38
  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); }
39
39
 
40
40
  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; }
@@ -267,7 +267,7 @@ var Search = function Search(_ref) {
267
267
  var renderSubmitButton = function renderSubmitButton() {
268
268
  var Icon = isCompact ? SearchIcon16 : SearchIcon;
269
269
  return /*#__PURE__*/_react["default"].createElement("button", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.submit), {
270
- className: cn('submit-button'),
270
+ className: cn('submit-button', [classes === null || classes === void 0 ? void 0 : classes.submitButton]),
271
271
  onClick: handleSearchSubmit,
272
272
  type: "button"
273
273
  }), /*#__PURE__*/_react["default"].createElement(Icon, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-core",
3
- "version": "5.4.1",
3
+ "version": "5.4.3",
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.15.0",
53
+ "@megafon/ui-icons": "^2.17.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",
@@ -85,7 +85,7 @@
85
85
  "dependencies": {
86
86
  "@babel/runtime": "^7.8.4",
87
87
  "@datepicker-react/hooks": "^2.7.0",
88
- "@megafon/ui-helpers": "^2.5.3",
88
+ "@megafon/ui-helpers": "^2.5.4",
89
89
  "@popperjs/core": "^2.5.3",
90
90
  "core-js": "^3.6.4",
91
91
  "date-fns": "^2.16.1",
@@ -96,5 +96,5 @@
96
96
  "react-popper": "^2.2.3",
97
97
  "swiper": "^6.5.6"
98
98
  },
99
- "gitHead": "d65bc4cd4de9180971e4285c2d0b5beec27d0542"
99
+ "gitHead": "1120ea0f847f81f7a9218cba42ee13a24f09912a"
100
100
  }