@megafon/ui-core 6.2.0 → 6.3.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,29 @@
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
+ # [6.3.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@6.2.1...@megafon/ui-core@6.3.0) (2024-09-24)
7
+
8
+
9
+ ### Features
10
+
11
+ * **tooltip:** add classes for close-button and button on Tooltip ([7c6e075](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/7c6e075a3d75fd16424f9cddb7f1295617fc4519))
12
+ * **tooltip:** fix useEffect dependency ([69a583b](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/69a583b57e98b6fd00edb9b9685d3d9119c581c3))
13
+
14
+
15
+
16
+
17
+
18
+ ## [6.2.1](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@6.2.0...@megafon/ui-core@6.2.1) (2024-09-02)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * **textfield, search, select:** added type JSX.Element to props noticeText ([3b2d9d3](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/3b2d9d3ddd1c4541849c0282b331095e7c90352d))
24
+
25
+
26
+
27
+
28
+
6
29
  # [6.2.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@6.1.1...@megafon/ui-core@6.2.0) (2024-08-30)
7
30
 
8
31
 
@@ -60,7 +60,7 @@ export interface ISearchProps {
60
60
  /** Результат проверки данных */
61
61
  verification?: VerificationType;
62
62
  /** Дополнительный текст под полем. Свойство verification влияет на цвет текста. */
63
- noticeText?: string;
63
+ noticeText?: string | JSX.Element;
64
64
  /** Отключение поля ввода */
65
65
  disabled?: boolean;
66
66
  /** Делает поле обязательным */
@@ -475,7 +475,7 @@ Search.propTypes = {
475
475
  }).isRequired),
476
476
  changeDelay: PropTypes.number,
477
477
  verification: PropTypes.oneOf(['valid', 'error']),
478
- noticeText: PropTypes.string,
478
+ noticeText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
479
479
  disabled: PropTypes.bool,
480
480
  required: PropTypes.bool,
481
481
  className: PropTypes.string,
@@ -45,7 +45,7 @@ export interface ISelectProps<T extends SelectItemValueType> {
45
45
  /** Результат проверки данных */
46
46
  verification?: VerificationType;
47
47
  /** Дополнительный текст под полем. Свойство verification влияет на цвет текста. */
48
- noticeText?: string;
48
+ noticeText?: string | JSX.Element;
49
49
  /** Отключение селекта */
50
50
  disabled?: boolean;
51
51
  /** Делает поле обязательным */
@@ -101,7 +101,7 @@ declare const Select: {
101
101
  id: PropTypes.Requireable<string>;
102
102
  currentValue: PropTypes.Requireable<string | number>;
103
103
  verification: PropTypes.Requireable<"error" | "valid">;
104
- noticeText: PropTypes.Requireable<string>;
104
+ noticeText: PropTypes.Requireable<string | PropTypes.ReactElementLike>;
105
105
  disabled: PropTypes.Requireable<boolean>;
106
106
  required: PropTypes.Requireable<boolean>;
107
107
  placeholder: PropTypes.Requireable<string>;
@@ -443,7 +443,7 @@ Select.propTypes = {
443
443
  id: PropTypes.string,
444
444
  currentValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
445
445
  verification: PropTypes.oneOf(Object.values(Verification)),
446
- noticeText: PropTypes.string,
446
+ noticeText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
447
447
  disabled: PropTypes.bool,
448
448
  required: PropTypes.bool,
449
449
  placeholder: PropTypes.string,
@@ -35,7 +35,7 @@ export declare type TextFieldProps = {
35
35
  /** Отображение валидации */
36
36
  verification?: 'valid' | 'error';
37
37
  /** Подпись снизу, меняет цвет в зависимости от аргумента verification */
38
- noticeText?: string;
38
+ noticeText?: string | JSX.Element;
39
39
  /** Отключение поля ввода */
40
40
  disabled?: boolean;
41
41
  /** Показывает обязательность поля */
@@ -518,7 +518,7 @@ TextField.propTypes = {
518
518
  customIcon: PropTypes.element,
519
519
  mask: PropTypes.string,
520
520
  maskChar: PropTypes.string,
521
- noticeText: PropTypes.string,
521
+ noticeText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
522
522
  className: PropTypes.string,
523
523
  minTextareaHeight: PropTypes.oneOf([24, 72]),
524
524
  hideResizeButton: PropTypes.bool,
@@ -81,6 +81,8 @@ export interface ITooltipProps {
81
81
  arrow?: string;
82
82
  content?: string;
83
83
  contentShadow?: string;
84
+ close?: string;
85
+ button?: string;
84
86
  };
85
87
  /** Дополнительные data атрибуты к внутренним элементам */
86
88
  dataAttrs?: {
@@ -112,6 +112,8 @@ var Tooltip = function Tooltip(_ref) {
112
112
  arrowClassName = _ref$classes.arrow,
113
113
  contentClassName = _ref$classes.content,
114
114
  contentShadowClassName = _ref$classes.contentShadow,
115
+ closeButtonClassName = _ref$classes.close,
116
+ buttonClassName = _ref$classes.button,
115
117
  dataAttrs = _ref.dataAttrs,
116
118
  onOpen = _ref.onOpen,
117
119
  onClose = _ref.onClose,
@@ -318,7 +320,7 @@ var Tooltip = function Tooltip(_ref) {
318
320
  type: "button",
319
321
  className: cn('button', {
320
322
  margin: hasButtonMargin
321
- })
323
+ }, [buttonClassName])
322
324
  }, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button), {
323
325
  onClick: onClick
324
326
  }), buttonText, /*#__PURE__*/React.createElement(RightArrow, {
@@ -328,7 +330,7 @@ var Tooltip = function Tooltip(_ref) {
328
330
  margin: hasChildrenMargin
329
331
  })
330
332
  }, children));
331
- }, [title, text, buttonText, children, dataAttrs, renderedText, onClick]);
333
+ }, [title, text, buttonText, children, dataAttrs, renderedText, onClick, buttonClassName]);
332
334
  var template = /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
333
335
  className: cn({
334
336
  theme: theme,
@@ -357,7 +359,7 @@ var Tooltip = function Tooltip(_ref) {
357
359
  },
358
360
  className: cn('content', [contentClassName])
359
361
  }, hasCloseButton && /*#__PURE__*/React.createElement("button", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.close), {
360
- className: cn('close-button'),
362
+ className: cn('close-button', [closeButtonClassName]),
361
363
  type: "button",
362
364
  onClick: handleCloseButtonClick
363
365
  }), /*#__PURE__*/React.createElement(CancelIcon, {
@@ -428,7 +430,9 @@ Tooltip.propTypes = {
428
430
  root: PropTypes.string,
429
431
  arrow: PropTypes.string,
430
432
  content: PropTypes.string,
431
- contentShadow: PropTypes.string
433
+ contentShadow: PropTypes.string,
434
+ close: PropTypes.string,
435
+ button: PropTypes.string
432
436
  }),
433
437
  dataAttrs: PropTypes.shape({
434
438
  root: PropTypes.objectOf(PropTypes.string.isRequired),
@@ -60,7 +60,7 @@ export interface ISearchProps {
60
60
  /** Результат проверки данных */
61
61
  verification?: VerificationType;
62
62
  /** Дополнительный текст под полем. Свойство verification влияет на цвет текста. */
63
- noticeText?: string;
63
+ noticeText?: string | JSX.Element;
64
64
  /** Отключение поля ввода */
65
65
  disabled?: boolean;
66
66
  /** Делает поле обязательным */
@@ -528,7 +528,7 @@ Search.propTypes = {
528
528
  }).isRequired),
529
529
  changeDelay: PropTypes.number,
530
530
  verification: PropTypes.oneOf(['valid', 'error']),
531
- noticeText: PropTypes.string,
531
+ noticeText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
532
532
  disabled: PropTypes.bool,
533
533
  required: PropTypes.bool,
534
534
  className: PropTypes.string,
@@ -45,7 +45,7 @@ export interface ISelectProps<T extends SelectItemValueType> {
45
45
  /** Результат проверки данных */
46
46
  verification?: VerificationType;
47
47
  /** Дополнительный текст под полем. Свойство verification влияет на цвет текста. */
48
- noticeText?: string;
48
+ noticeText?: string | JSX.Element;
49
49
  /** Отключение селекта */
50
50
  disabled?: boolean;
51
51
  /** Делает поле обязательным */
@@ -101,7 +101,7 @@ declare const Select: {
101
101
  id: PropTypes.Requireable<string>;
102
102
  currentValue: PropTypes.Requireable<string | number>;
103
103
  verification: PropTypes.Requireable<"error" | "valid">;
104
- noticeText: PropTypes.Requireable<string>;
104
+ noticeText: PropTypes.Requireable<string | PropTypes.ReactElementLike>;
105
105
  disabled: PropTypes.Requireable<boolean>;
106
106
  required: PropTypes.Requireable<boolean>;
107
107
  placeholder: PropTypes.Requireable<string>;
@@ -478,7 +478,7 @@ Select.propTypes = {
478
478
  id: PropTypes.string,
479
479
  currentValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
480
480
  verification: PropTypes.oneOf(Object.values(Verification)),
481
- noticeText: PropTypes.string,
481
+ noticeText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
482
482
  disabled: PropTypes.bool,
483
483
  required: PropTypes.bool,
484
484
  placeholder: PropTypes.string,
@@ -35,7 +35,7 @@ export declare type TextFieldProps = {
35
35
  /** Отображение валидации */
36
36
  verification?: 'valid' | 'error';
37
37
  /** Подпись снизу, меняет цвет в зависимости от аргумента verification */
38
- noticeText?: string;
38
+ noticeText?: string | JSX.Element;
39
39
  /** Отключение поля ввода */
40
40
  disabled?: boolean;
41
41
  /** Показывает обязательность поля */
@@ -544,7 +544,7 @@ TextField.propTypes = {
544
544
  customIcon: PropTypes.element,
545
545
  mask: PropTypes.string,
546
546
  maskChar: PropTypes.string,
547
- noticeText: PropTypes.string,
547
+ noticeText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
548
548
  className: PropTypes.string,
549
549
  minTextareaHeight: PropTypes.oneOf([24, 72]),
550
550
  hideResizeButton: PropTypes.bool,
@@ -81,6 +81,8 @@ export interface ITooltipProps {
81
81
  arrow?: string;
82
82
  content?: string;
83
83
  contentShadow?: string;
84
+ close?: string;
85
+ button?: string;
84
86
  };
85
87
  /** Дополнительные data атрибуты к внутренним элементам */
86
88
  dataAttrs?: {
@@ -143,6 +143,8 @@ var Tooltip = function Tooltip(_ref) {
143
143
  arrowClassName = _ref$classes.arrow,
144
144
  contentClassName = _ref$classes.content,
145
145
  contentShadowClassName = _ref$classes.contentShadow,
146
+ closeButtonClassName = _ref$classes.close,
147
+ buttonClassName = _ref$classes.button,
146
148
  dataAttrs = _ref.dataAttrs,
147
149
  onOpen = _ref.onOpen,
148
150
  onClose = _ref.onClose,
@@ -351,7 +353,7 @@ var Tooltip = function Tooltip(_ref) {
351
353
  type: "button",
352
354
  className: cn('button', {
353
355
  margin: hasButtonMargin
354
- })
356
+ }, [buttonClassName])
355
357
  }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button), {
356
358
  onClick: onClick
357
359
  }), buttonText, /*#__PURE__*/_react["default"].createElement(RightArrow, {
@@ -361,7 +363,7 @@ var Tooltip = function Tooltip(_ref) {
361
363
  margin: hasChildrenMargin
362
364
  })
363
365
  }, children));
364
- }, [title, text, buttonText, children, dataAttrs, renderedText, onClick]);
366
+ }, [title, text, buttonText, children, dataAttrs, renderedText, onClick, buttonClassName]);
365
367
 
366
368
  var template = /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
367
369
  className: cn({
@@ -391,7 +393,7 @@ var Tooltip = function Tooltip(_ref) {
391
393
  },
392
394
  className: cn('content', [contentClassName])
393
395
  }, hasCloseButton && /*#__PURE__*/_react["default"].createElement("button", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.close), {
394
- className: cn('close-button'),
396
+ className: cn('close-button', [closeButtonClassName]),
395
397
  type: "button",
396
398
  onClick: handleCloseButtonClick
397
399
  }), /*#__PURE__*/_react["default"].createElement(CancelIcon, {
@@ -463,7 +465,9 @@ Tooltip.propTypes = {
463
465
  root: _propTypes["default"].string,
464
466
  arrow: _propTypes["default"].string,
465
467
  content: _propTypes["default"].string,
466
- contentShadow: _propTypes["default"].string
468
+ contentShadow: _propTypes["default"].string,
469
+ close: _propTypes["default"].string,
470
+ button: _propTypes["default"].string
467
471
  }),
468
472
  dataAttrs: _propTypes["default"].shape({
469
473
  root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-core",
3
- "version": "6.2.0",
3
+ "version": "6.3.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "styles"
@@ -99,5 +99,5 @@
99
99
  "react-popper": "^2.2.3",
100
100
  "swiper": "^6.5.6"
101
101
  },
102
- "gitHead": "51d2691e1194c1600d683e1a521d851b4b2ac39a"
102
+ "gitHead": "adda2eba84cd9dd0a71bd4fdeba30c7c5d54ff6a"
103
103
  }