@megafon/ui-shared 5.12.0 → 5.14.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 +22 -0
- package/dist/es/components/AccordionBox/AccordionBox.d.ts +4 -0
- package/dist/es/components/AccordionBox/AccordionBox.js +3 -1
- package/dist/es/components/ButtonBanner/ButtonBanner.d.ts +7 -0
- package/dist/es/components/ButtonBanner/ButtonBanner.js +8 -0
- package/dist/es/helpers/getColumnConfig.d.ts +1 -1
- package/dist/lib/components/AccordionBox/AccordionBox.d.ts +4 -0
- package/dist/lib/components/AccordionBox/AccordionBox.js +3 -1
- package/dist/lib/components/ButtonBanner/ButtonBanner.d.ts +7 -0
- package/dist/lib/components/ButtonBanner/ButtonBanner.js +10 -1
- package/dist/lib/helpers/getColumnConfig.d.ts +1 -1
- package/package.json +5 -5
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
|
+
# [5.14.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@5.13.0...@megafon/ui-shared@5.14.0) (2024-06-26)
|
7
|
+
|
8
|
+
|
9
|
+
### Features
|
10
|
+
|
11
|
+
* **accordion:** add new prop titleTag for change title tag, add classes.title prop" ([6f265f5](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/6f265f53bbd552957454405d8c95cbe1549c72dd))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
# [5.13.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@5.12.0...@megafon/ui-shared@5.13.0) (2024-06-17)
|
18
|
+
|
19
|
+
|
20
|
+
### Features
|
21
|
+
|
22
|
+
* **buttonbanner:** add prop buttonType ([adff95d](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/adff95de303e64fd51829001a276fa9696fb4676))
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
6
28
|
# [5.12.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@5.11.0...@megafon/ui-shared@5.12.0) (2024-06-10)
|
7
29
|
|
8
30
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
+
import { IHeaderProps } from '@megafon/ui-core/dist/lib/components/Header/Header';
|
2
3
|
import './AccordionBox.less';
|
3
4
|
export interface IAccordionBox {
|
4
5
|
/** Дополнительные data атрибуты к внутренним элементам */
|
@@ -19,6 +20,8 @@ export interface IAccordionBox {
|
|
19
20
|
rootRef?: React.Ref<HTMLDivElement>;
|
20
21
|
/** Заголовок аккордеона */
|
21
22
|
title: string;
|
23
|
+
/** Заголовок аккордеона */
|
24
|
+
titleTag?: IHeaderProps['as'];
|
22
25
|
/** Состояние аккордеона, заданное извне */
|
23
26
|
isOpened?: boolean;
|
24
27
|
/** Включить микроразметку */
|
@@ -35,6 +38,7 @@ export interface IAccordionBox {
|
|
35
38
|
root?: string;
|
36
39
|
collapse?: string;
|
37
40
|
titleWrap?: string;
|
41
|
+
title?: string;
|
38
42
|
};
|
39
43
|
/** Обработчик клика */
|
40
44
|
onClickAccordion?: (isOpened: boolean) => void;
|
@@ -67,6 +67,7 @@ AccordionBox.propTypes = {
|
|
67
67
|
current: PropTypes.elementType
|
68
68
|
}), PropTypes.any])]),
|
69
69
|
title: PropTypes.string.isRequired,
|
70
|
+
titleTag: PropTypes.oneOf(['h1', 'h2', 'h3', 'h5']),
|
70
71
|
isFullWidth: PropTypes.bool,
|
71
72
|
isOpened: PropTypes.bool,
|
72
73
|
hasMicrodata: PropTypes.bool,
|
@@ -76,7 +77,8 @@ AccordionBox.propTypes = {
|
|
76
77
|
openedClass: PropTypes.string,
|
77
78
|
root: PropTypes.string,
|
78
79
|
collapse: PropTypes.string,
|
79
|
-
titleWrap: PropTypes.string
|
80
|
+
titleWrap: PropTypes.string,
|
81
|
+
title: PropTypes.string
|
80
82
|
}),
|
81
83
|
onClickAccordion: PropTypes.func
|
82
84
|
};
|
@@ -5,6 +5,11 @@ export declare const ButtonColor: {
|
|
5
5
|
readonly PURPLE: "purple";
|
6
6
|
};
|
7
7
|
declare type ButtonColorType = typeof ButtonColor[keyof typeof ButtonColor];
|
8
|
+
export declare const ButtonTypes: {
|
9
|
+
readonly PRIMARY: "primary";
|
10
|
+
readonly OUTLINE: "outline";
|
11
|
+
};
|
12
|
+
declare type ButtonTypesType = typeof ButtonTypes[keyof typeof ButtonTypes];
|
8
13
|
export declare const ButtonTarget: {
|
9
14
|
readonly SELF: "_self";
|
10
15
|
readonly BLANK: "_blank";
|
@@ -46,6 +51,8 @@ export interface IButtonBannerProps {
|
|
46
51
|
buttonTarget?: ButtonTargetType;
|
47
52
|
/** Цвет кнопки */
|
48
53
|
buttonColor?: ButtonColorType;
|
54
|
+
/** Тип кнопки */
|
55
|
+
buttonType?: ButtonTypesType;
|
49
56
|
/** Rel - атрибут тега <a> */
|
50
57
|
buttonRel?: string;
|
51
58
|
/** Масштабирование изображения */
|
@@ -9,6 +9,10 @@ export var ButtonColor = {
|
|
9
9
|
GREEN: 'green',
|
10
10
|
PURPLE: 'purple'
|
11
11
|
};
|
12
|
+
export var ButtonTypes = {
|
13
|
+
PRIMARY: 'primary',
|
14
|
+
OUTLINE: 'outline'
|
15
|
+
};
|
12
16
|
export var ButtonTarget = {
|
13
17
|
SELF: '_self',
|
14
18
|
BLANK: '_blank'
|
@@ -44,6 +48,8 @@ var ButtonBanner = function ButtonBanner(_ref) {
|
|
44
48
|
buttonTarget = _ref$buttonTarget === void 0 ? '_self' : _ref$buttonTarget,
|
45
49
|
_ref$buttonColor = _ref.buttonColor,
|
46
50
|
buttonColor = _ref$buttonColor === void 0 ? 'green' : _ref$buttonColor,
|
51
|
+
_ref$buttonType = _ref.buttonType,
|
52
|
+
buttonType = _ref$buttonType === void 0 ? 'primary' : _ref$buttonType,
|
47
53
|
buttonRel = _ref.buttonRel,
|
48
54
|
_ref$imageScaling = _ref.imageScaling,
|
49
55
|
imageScaling = _ref$imageScaling === void 0 ? 'cover' : _ref$imageScaling,
|
@@ -57,6 +63,7 @@ var ButtonBanner = function ButtonBanner(_ref) {
|
|
57
63
|
rel: buttonRel,
|
58
64
|
target: buttonTarget,
|
59
65
|
theme: buttonColor,
|
66
|
+
type: buttonType,
|
60
67
|
onClick: onButtonClick,
|
61
68
|
download: buttonDownload
|
62
69
|
}, buttonText);
|
@@ -113,6 +120,7 @@ ButtonBanner.propTypes = {
|
|
113
120
|
buttonDownload: PropTypes.bool,
|
114
121
|
buttonTarget: PropTypes.oneOf(Object.values(ButtonTarget)),
|
115
122
|
buttonColor: PropTypes.oneOf(Object.values(ButtonColor)),
|
123
|
+
buttonType: PropTypes.oneOf(Object.values(ButtonTypes)),
|
116
124
|
buttonRel: PropTypes.string,
|
117
125
|
onButtonClick: PropTypes.func
|
118
126
|
};
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
export declare const getColumnConfig: (isFullWidth: boolean) => Pick<React.PropsWithChildren<import("
|
2
|
+
export declare const getColumnConfig: (isFullWidth: boolean) => Pick<React.PropsWithChildren<import("../../../ui-core/dist/lib/components/Grid/GridColumn").IGridColumn>, "all" | "wide" | "mobile" | "desktop" | "tablet">;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
+
import { IHeaderProps } from '@megafon/ui-core/dist/lib/components/Header/Header';
|
2
3
|
import './AccordionBox.less';
|
3
4
|
export interface IAccordionBox {
|
4
5
|
/** Дополнительные data атрибуты к внутренним элементам */
|
@@ -19,6 +20,8 @@ export interface IAccordionBox {
|
|
19
20
|
rootRef?: React.Ref<HTMLDivElement>;
|
20
21
|
/** Заголовок аккордеона */
|
21
22
|
title: string;
|
23
|
+
/** Заголовок аккордеона */
|
24
|
+
titleTag?: IHeaderProps['as'];
|
22
25
|
/** Состояние аккордеона, заданное извне */
|
23
26
|
isOpened?: boolean;
|
24
27
|
/** Включить микроразметку */
|
@@ -35,6 +38,7 @@ export interface IAccordionBox {
|
|
35
38
|
root?: string;
|
36
39
|
collapse?: string;
|
37
40
|
titleWrap?: string;
|
41
|
+
title?: string;
|
38
42
|
};
|
39
43
|
/** Обработчик клика */
|
40
44
|
onClickAccordion?: (isOpened: boolean) => void;
|
@@ -88,6 +88,7 @@ AccordionBox.propTypes = {
|
|
88
88
|
current: PropTypes.elementType
|
89
89
|
}), PropTypes.any])]),
|
90
90
|
title: PropTypes.string.isRequired,
|
91
|
+
titleTag: PropTypes.oneOf(['h1', 'h2', 'h3', 'h5']),
|
91
92
|
isFullWidth: PropTypes.bool,
|
92
93
|
isOpened: PropTypes.bool,
|
93
94
|
hasMicrodata: PropTypes.bool,
|
@@ -97,7 +98,8 @@ AccordionBox.propTypes = {
|
|
97
98
|
openedClass: PropTypes.string,
|
98
99
|
root: PropTypes.string,
|
99
100
|
collapse: PropTypes.string,
|
100
|
-
titleWrap: PropTypes.string
|
101
|
+
titleWrap: PropTypes.string,
|
102
|
+
title: PropTypes.string
|
101
103
|
}),
|
102
104
|
onClickAccordion: PropTypes.func
|
103
105
|
};
|
@@ -5,6 +5,11 @@ export declare const ButtonColor: {
|
|
5
5
|
readonly PURPLE: "purple";
|
6
6
|
};
|
7
7
|
declare type ButtonColorType = typeof ButtonColor[keyof typeof ButtonColor];
|
8
|
+
export declare const ButtonTypes: {
|
9
|
+
readonly PRIMARY: "primary";
|
10
|
+
readonly OUTLINE: "outline";
|
11
|
+
};
|
12
|
+
declare type ButtonTypesType = typeof ButtonTypes[keyof typeof ButtonTypes];
|
8
13
|
export declare const ButtonTarget: {
|
9
14
|
readonly SELF: "_self";
|
10
15
|
readonly BLANK: "_blank";
|
@@ -46,6 +51,8 @@ export interface IButtonBannerProps {
|
|
46
51
|
buttonTarget?: ButtonTargetType;
|
47
52
|
/** Цвет кнопки */
|
48
53
|
buttonColor?: ButtonColorType;
|
54
|
+
/** Тип кнопки */
|
55
|
+
buttonType?: ButtonTypesType;
|
49
56
|
/** Rel - атрибут тега <a> */
|
50
57
|
buttonRel?: string;
|
51
58
|
/** Масштабирование изображения */
|
@@ -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.ImageScaling = exports.ButtonTarget = exports.ButtonColor = void 0;
|
8
|
+
exports["default"] = exports.ImageScaling = exports.ButtonTarget = exports.ButtonTypes = exports.ButtonColor = void 0;
|
9
9
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
11
11
|
|
@@ -30,6 +30,11 @@ var ButtonColor = {
|
|
30
30
|
PURPLE: 'purple'
|
31
31
|
};
|
32
32
|
exports.ButtonColor = ButtonColor;
|
33
|
+
var ButtonTypes = {
|
34
|
+
PRIMARY: 'primary',
|
35
|
+
OUTLINE: 'outline'
|
36
|
+
};
|
37
|
+
exports.ButtonTypes = ButtonTypes;
|
33
38
|
var ButtonTarget = {
|
34
39
|
SELF: '_self',
|
35
40
|
BLANK: '_blank'
|
@@ -67,6 +72,8 @@ var ButtonBanner = function ButtonBanner(_ref) {
|
|
67
72
|
buttonTarget = _ref$buttonTarget === void 0 ? '_self' : _ref$buttonTarget,
|
68
73
|
_ref$buttonColor = _ref.buttonColor,
|
69
74
|
buttonColor = _ref$buttonColor === void 0 ? 'green' : _ref$buttonColor,
|
75
|
+
_ref$buttonType = _ref.buttonType,
|
76
|
+
buttonType = _ref$buttonType === void 0 ? 'primary' : _ref$buttonType,
|
70
77
|
buttonRel = _ref.buttonRel,
|
71
78
|
_ref$imageScaling = _ref.imageScaling,
|
72
79
|
imageScaling = _ref$imageScaling === void 0 ? 'cover' : _ref$imageScaling,
|
@@ -81,6 +88,7 @@ var ButtonBanner = function ButtonBanner(_ref) {
|
|
81
88
|
rel: buttonRel,
|
82
89
|
target: buttonTarget,
|
83
90
|
theme: buttonColor,
|
91
|
+
type: buttonType,
|
84
92
|
onClick: onButtonClick,
|
85
93
|
download: buttonDownload
|
86
94
|
}, buttonText);
|
@@ -138,6 +146,7 @@ ButtonBanner.propTypes = {
|
|
138
146
|
buttonDownload: PropTypes.bool,
|
139
147
|
buttonTarget: PropTypes.oneOf(Object.values(ButtonTarget)),
|
140
148
|
buttonColor: PropTypes.oneOf(Object.values(ButtonColor)),
|
149
|
+
buttonType: PropTypes.oneOf(Object.values(ButtonTypes)),
|
141
150
|
buttonRel: PropTypes.string,
|
142
151
|
onButtonClick: PropTypes.func
|
143
152
|
};
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
export declare const getColumnConfig: (isFullWidth: boolean) => Pick<React.PropsWithChildren<import("
|
2
|
+
export declare const getColumnConfig: (isFullWidth: boolean) => Pick<React.PropsWithChildren<import("../../../ui-core/dist/lib/components/Grid/GridColumn").IGridColumn>, "all" | "wide" | "mobile" | "desktop" | "tablet">;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@megafon/ui-shared",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.14.0",
|
4
4
|
"files": [
|
5
5
|
"dist"
|
6
6
|
],
|
@@ -48,7 +48,7 @@
|
|
48
48
|
"@babel/preset-env": "^7.8.6",
|
49
49
|
"@babel/preset-react": "^7.8.3",
|
50
50
|
"@babel/preset-typescript": "^7.8.3",
|
51
|
-
"@megafon/ui-icons": "^2.
|
51
|
+
"@megafon/ui-icons": "^2.25.0",
|
52
52
|
"@svgr/core": "^2.4.1",
|
53
53
|
"@testing-library/jest-dom": "5.16.2",
|
54
54
|
"@testing-library/react": "12.1.2",
|
@@ -82,13 +82,13 @@
|
|
82
82
|
},
|
83
83
|
"dependencies": {
|
84
84
|
"@babel/runtime": "^7.8.4",
|
85
|
-
"@megafon/ui-core": "^5.
|
86
|
-
"@megafon/ui-helpers": "^2.
|
85
|
+
"@megafon/ui-core": "^5.16.0",
|
86
|
+
"@megafon/ui-helpers": "^2.6.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": "
|
93
|
+
"gitHead": "0d4f96ecbc805db6a1b2200dd9adbb707349d474"
|
94
94
|
}
|