@megafon/ui-core 6.1.1 → 6.2.1
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 +22 -0
- package/dist/es/components/Badges/components/PromoBadge/PromoBadge.css +5 -0
- package/dist/es/components/Badges/components/PromoBadge/PromoBadge.d.ts +7 -0
- package/dist/es/components/Badges/components/PromoBadge/PromoBadge.js +7 -0
- package/dist/es/components/Search/Search.d.ts +1 -1
- package/dist/es/components/Search/Search.js +1 -1
- package/dist/es/components/Select/Select.d.ts +2 -2
- package/dist/es/components/Select/Select.js +1 -1
- package/dist/es/components/TextField/TextField.d.ts +1 -1
- package/dist/es/components/TextField/TextField.js +1 -1
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.css +5 -0
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.d.ts +7 -0
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.js +10 -2
- package/dist/lib/components/Search/Search.d.ts +1 -1
- package/dist/lib/components/Search/Search.js +1 -1
- package/dist/lib/components/Select/Select.d.ts +2 -2
- package/dist/lib/components/Select/Select.js +1 -1
- package/dist/lib/components/TextField/TextField.d.ts +1 -1
- package/dist/lib/components/TextField/TextField.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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.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)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **textfield, search, select:** added type JSX.Element to props noticeText ([3b2d9d3](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/3b2d9d3ddd1c4541849c0282b331095e7c90352d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [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)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **promobadge:** added size option and added SMALL size ([b4803e2](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/b4803e29564328d561f3b76f36211a54d2d2a699))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [6.1.1](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@6.1.0...@megafon/ui-core@6.1.1) (2024-08-22)
|
|
7
29
|
|
|
8
30
|
**Note:** Version bump only for package @megafon/ui-core
|
|
@@ -10,6 +10,11 @@ export declare const PromoBadgeColors: {
|
|
|
10
10
|
readonly GRADIENT_PURPLE: "gradient-purple";
|
|
11
11
|
};
|
|
12
12
|
declare type PromoBadgeColorsType = typeof PromoBadgeColors[keyof typeof PromoBadgeColors];
|
|
13
|
+
export declare const PromoBadgeSize: {
|
|
14
|
+
readonly SMALL: "small";
|
|
15
|
+
readonly MEDIUM: "medium";
|
|
16
|
+
};
|
|
17
|
+
declare type PromoBadgeSizeType = typeof PromoBadgeSize[keyof typeof PromoBadgeSize];
|
|
13
18
|
export declare const PromoBadgeTypes: {
|
|
14
19
|
readonly HIT: "hit";
|
|
15
20
|
readonly NEW: "new";
|
|
@@ -22,6 +27,8 @@ declare type PromoBadgeTypesType = typeof PromoBadgeTypes[keyof typeof PromoBadg
|
|
|
22
27
|
export interface IPromoBadgeProps {
|
|
23
28
|
/** Цвет промо-бэйджа */
|
|
24
29
|
color?: PromoBadgeColorsType;
|
|
30
|
+
/** Размер промо-бэйджа */
|
|
31
|
+
size?: PromoBadgeSizeType;
|
|
25
32
|
/** DEPRECATED Тип промо-бэйджа (Используйте проп `color`) */
|
|
26
33
|
type?: PromoBadgeTypesType;
|
|
27
34
|
/** Дополнительный класс корневого элемента */
|
|
@@ -12,6 +12,10 @@ export var PromoBadgeColors = {
|
|
|
12
12
|
SYSTEM_BLUE: 'system-blue',
|
|
13
13
|
WARM_RED: 'warm-red',
|
|
14
14
|
GRADIENT_PURPLE: 'gradient-purple'
|
|
15
|
+
};
|
|
16
|
+
export var PromoBadgeSize = {
|
|
17
|
+
SMALL: 'small',
|
|
18
|
+
MEDIUM: 'medium'
|
|
15
19
|
}; // DEPRECATED
|
|
16
20
|
|
|
17
21
|
export var PromoBadgeTypes = {
|
|
@@ -26,6 +30,8 @@ var cn = cnCreate('mfui-promo-badge');
|
|
|
26
30
|
|
|
27
31
|
var PromoBadge = function PromoBadge(_ref) {
|
|
28
32
|
var color = _ref.color,
|
|
33
|
+
_ref$size = _ref.size,
|
|
34
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
29
35
|
_ref$type = _ref.type,
|
|
30
36
|
type = _ref$type === void 0 ? PromoBadgeTypes.HIT : _ref$type,
|
|
31
37
|
className = _ref.className,
|
|
@@ -34,6 +40,7 @@ var PromoBadge = function PromoBadge(_ref) {
|
|
|
34
40
|
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
35
41
|
className: cn({
|
|
36
42
|
color: color,
|
|
43
|
+
size: size,
|
|
37
44
|
type: color ? undefined : type
|
|
38
45
|
}, className)
|
|
39
46
|
}), /*#__PURE__*/React.createElement("span", {
|
|
@@ -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,
|
|
@@ -10,6 +10,11 @@ export declare const PromoBadgeColors: {
|
|
|
10
10
|
readonly GRADIENT_PURPLE: "gradient-purple";
|
|
11
11
|
};
|
|
12
12
|
declare type PromoBadgeColorsType = typeof PromoBadgeColors[keyof typeof PromoBadgeColors];
|
|
13
|
+
export declare const PromoBadgeSize: {
|
|
14
|
+
readonly SMALL: "small";
|
|
15
|
+
readonly MEDIUM: "medium";
|
|
16
|
+
};
|
|
17
|
+
declare type PromoBadgeSizeType = typeof PromoBadgeSize[keyof typeof PromoBadgeSize];
|
|
13
18
|
export declare const PromoBadgeTypes: {
|
|
14
19
|
readonly HIT: "hit";
|
|
15
20
|
readonly NEW: "new";
|
|
@@ -22,6 +27,8 @@ declare type PromoBadgeTypesType = typeof PromoBadgeTypes[keyof typeof PromoBadg
|
|
|
22
27
|
export interface IPromoBadgeProps {
|
|
23
28
|
/** Цвет промо-бэйджа */
|
|
24
29
|
color?: PromoBadgeColorsType;
|
|
30
|
+
/** Размер промо-бэйджа */
|
|
31
|
+
size?: PromoBadgeSizeType;
|
|
25
32
|
/** DEPRECATED Тип промо-бэйджа (Используйте проп `color`) */
|
|
26
33
|
type?: PromoBadgeTypesType;
|
|
27
34
|
/** Дополнительный класс корневого элемента */
|
|
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports["default"] = exports.PromoBadgeTypes = exports.PromoBadgeColors = void 0;
|
|
8
|
+
exports["default"] = exports.PromoBadgeTypes = exports.PromoBadgeSize = exports.PromoBadgeColors = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -31,9 +31,14 @@ var PromoBadgeColors = {
|
|
|
31
31
|
SYSTEM_BLUE: 'system-blue',
|
|
32
32
|
WARM_RED: 'warm-red',
|
|
33
33
|
GRADIENT_PURPLE: 'gradient-purple'
|
|
34
|
+
};
|
|
35
|
+
exports.PromoBadgeColors = PromoBadgeColors;
|
|
36
|
+
var PromoBadgeSize = {
|
|
37
|
+
SMALL: 'small',
|
|
38
|
+
MEDIUM: 'medium'
|
|
34
39
|
}; // DEPRECATED
|
|
35
40
|
|
|
36
|
-
exports.
|
|
41
|
+
exports.PromoBadgeSize = PromoBadgeSize;
|
|
37
42
|
var PromoBadgeTypes = {
|
|
38
43
|
HIT: 'hit',
|
|
39
44
|
NEW: 'new',
|
|
@@ -47,6 +52,8 @@ var cn = (0, _uiHelpers.cnCreate)('mfui-promo-badge');
|
|
|
47
52
|
|
|
48
53
|
var PromoBadge = function PromoBadge(_ref) {
|
|
49
54
|
var color = _ref.color,
|
|
55
|
+
_ref$size = _ref.size,
|
|
56
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
50
57
|
_ref$type = _ref.type,
|
|
51
58
|
type = _ref$type === void 0 ? PromoBadgeTypes.HIT : _ref$type,
|
|
52
59
|
className = _ref.className,
|
|
@@ -55,6 +62,7 @@ var PromoBadge = function PromoBadge(_ref) {
|
|
|
55
62
|
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
56
63
|
className: cn({
|
|
57
64
|
color: color,
|
|
65
|
+
size: size,
|
|
58
66
|
type: color ? undefined : type
|
|
59
67
|
}, className)
|
|
60
68
|
}), /*#__PURE__*/React.createElement("span", {
|
|
@@ -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,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@megafon/ui-core",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.1",
|
|
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": "
|
|
102
|
+
"gitHead": "fe62002ae1623a7f9316553d35c8c2fa4df36bd7"
|
|
103
103
|
}
|