@megafon/ui-shared 6.9.1 → 6.11.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 +16 -4
- package/dist/es/components/ButtonsBox/ButtonsBox.css +34 -0
- package/dist/es/components/ButtonsBox/ButtonsBox.d.ts +48 -0
- package/dist/es/components/ButtonsBox/ButtonsBox.js +89 -0
- package/dist/es/components/Container/Container.css +535 -0
- package/dist/es/components/Container/Container.d.ts +2 -0
- package/dist/es/components/Container/Container.js +8 -3
- package/dist/es/components/InfoCards/InfoCards.d.ts +4 -1
- package/dist/es/components/InfoCards/InfoCards.js +14 -5
- package/dist/es/components/InfoCards/components/InfoCard/InfoCard.css +30 -7
- package/dist/es/components/InfoCards/components/InfoCard/InfoCard.d.ts +4 -0
- package/dist/es/components/InfoCards/components/InfoCard/InfoCard.js +20 -10
- package/dist/es/components/InfoCards/types.d.ts +6 -1
- package/dist/es/components/PromoCards/PromoCards.d.ts +28 -0
- package/dist/es/components/PromoCards/PromoCards.js +90 -0
- package/dist/es/components/PromoCards/components/PromoCard/PromoCard.css +157 -0
- package/dist/es/components/PromoCards/components/PromoCard/PromoCard.d.ts +18 -0
- package/dist/es/components/PromoCards/components/PromoCard/PromoCard.js +74 -0
- package/dist/es/components/PromoCards/types.d.ts +29 -0
- package/dist/es/components/PromoCards/types.js +0 -0
- package/dist/es/index.d.ts +3 -0
- package/dist/es/index.js +3 -0
- package/dist/lib/components/ButtonsBox/ButtonsBox.css +34 -0
- package/dist/lib/components/ButtonsBox/ButtonsBox.d.ts +48 -0
- package/dist/lib/components/ButtonsBox/ButtonsBox.js +110 -0
- package/dist/lib/components/Container/Container.css +535 -0
- package/dist/lib/components/Container/Container.d.ts +2 -0
- package/dist/lib/components/Container/Container.js +8 -3
- package/dist/lib/components/InfoCards/InfoCards.d.ts +4 -1
- package/dist/lib/components/InfoCards/InfoCards.js +16 -13
- package/dist/lib/components/InfoCards/components/InfoCard/InfoCard.css +30 -7
- package/dist/lib/components/InfoCards/components/InfoCard/InfoCard.d.ts +4 -0
- package/dist/lib/components/InfoCards/components/InfoCard/InfoCard.js +19 -9
- package/dist/lib/components/InfoCards/types.d.ts +6 -1
- package/dist/lib/components/PromoCards/PromoCards.d.ts +28 -0
- package/dist/lib/components/PromoCards/PromoCards.js +113 -0
- package/dist/lib/components/PromoCards/components/PromoCard/PromoCard.css +157 -0
- package/dist/lib/components/PromoCards/components/PromoCard/PromoCard.d.ts +18 -0
- package/dist/lib/components/PromoCards/components/PromoCard/PromoCard.js +96 -0
- package/dist/lib/components/PromoCards/types.d.ts +29 -0
- package/dist/lib/components/PromoCards/types.js +1 -0
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.js +24 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -3,24 +3,36 @@
|
|
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
|
+
# [6.11.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@6.10.0...@megafon/ui-shared@6.11.0) (2024-11-15)
|
7
7
|
|
8
|
-
**Note:** Version bump only for package @megafon/ui-shared
|
9
8
|
|
9
|
+
### Features
|
10
|
+
|
11
|
+
* **buttonsbox:** create component ButtonsBox ([e5bc9dc](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/e5bc9dc1b54e0756291e4b597be74dd75d88b91f))
|
12
|
+
* **container:** add default margin for k36 (buttons-box) ([7a2a0e9](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/7a2a0e9b242a07c57565d6e4e76d8592fe6d8005))
|
13
|
+
* **container:** add margins for PromoCards ([8c1cf07](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/8c1cf07d043bcbdf4c1f9ea0720aa0601c37def5))
|
14
|
+
* **infocards:** add onClick and download props ([1fbbe80](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/1fbbe803a53b1105268f5eee065f38f732a98c08))
|
15
|
+
* **promocards:** add new component PromoCards ([9e45fbc](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/9e45fbcf88720d4eaa28eadb8a80ea3a3fa6e73c))
|
10
16
|
|
11
17
|
|
12
18
|
|
13
19
|
|
14
|
-
# [6.9.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@6.8.0...@megafon/ui-shared@6.9.0) (2024-10-29)
|
15
20
|
|
21
|
+
# [6.10.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@6.9.1...@megafon/ui-shared@6.10.0) (2024-11-06)
|
16
22
|
|
17
23
|
### Features
|
18
24
|
|
19
|
-
|
25
|
+
- **container:** add optional prop preventMarginTopCollapse ([2b5633b](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/2b5633bb5c63e6fbc7e828253c083d2e6474a6ac))
|
20
26
|
|
27
|
+
## [6.9.1](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@6.9.0...@megafon/ui-shared@6.9.1) (2024-11-01)
|
21
28
|
|
29
|
+
**Note:** Version bump only for package @megafon/ui-shared
|
22
30
|
|
31
|
+
# [6.9.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@6.8.0...@megafon/ui-shared@6.9.0) (2024-10-29)
|
32
|
+
|
33
|
+
### Features
|
23
34
|
|
35
|
+
- **buttonlinkbox:** add new prop and values ([09a7f47](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/09a7f4791b27972c048838efc5e862fd47c1d1cf))
|
24
36
|
|
25
37
|
# [6.8.0](/compare/@megafon/ui-shared@6.7.0...@megafon/ui-shared@6.8.0) (2024-10-21)
|
26
38
|
|
@@ -0,0 +1,34 @@
|
|
1
|
+
h1,
|
2
|
+
h2,
|
3
|
+
h3,
|
4
|
+
h4,
|
5
|
+
h5 {
|
6
|
+
margin: 0;
|
7
|
+
}
|
8
|
+
.mfui-v6-buttons-box {
|
9
|
+
display: -webkit-box;
|
10
|
+
display: -ms-flexbox;
|
11
|
+
display: flex;
|
12
|
+
}
|
13
|
+
.mfui-v6-buttons-box__buttons_equal-width {
|
14
|
+
display: grid;
|
15
|
+
gap: 20px;
|
16
|
+
max-width: -webkit-max-content;
|
17
|
+
max-width: -moz-max-content;
|
18
|
+
max-width: max-content;
|
19
|
+
}
|
20
|
+
@media screen and (max-width: 767px) {
|
21
|
+
.mfui-v6-buttons-box__buttons_equal-width {
|
22
|
+
grid-template-rows: repeat(2, 1fr);
|
23
|
+
}
|
24
|
+
}
|
25
|
+
@media screen and (min-width: 768px) {
|
26
|
+
.mfui-v6-buttons-box__buttons_equal-width {
|
27
|
+
grid-template-columns: repeat(2, 1fr);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
.mfui-v6-buttons-box_h-align_center {
|
31
|
+
-webkit-box-pack: center;
|
32
|
+
-ms-flex-pack: center;
|
33
|
+
justify-content: center;
|
34
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import './ButtonsBox.less';
|
3
|
+
export declare type ButtonType = {
|
4
|
+
/** Тип */
|
5
|
+
type?: 'primary' | 'outline';
|
6
|
+
/** Иконка */
|
7
|
+
icon?: JSX.Element;
|
8
|
+
/** Название */
|
9
|
+
title?: string;
|
10
|
+
/** Ссылка */
|
11
|
+
href?: string;
|
12
|
+
/** Target свойство кнопки */
|
13
|
+
target?: '_self' | '_blank' | '_parent' | '_top';
|
14
|
+
/** Rel - атрибут тега <a> */
|
15
|
+
rel?: string;
|
16
|
+
/** Задает атрибут download для тега <a> */
|
17
|
+
download?: boolean;
|
18
|
+
/** Показать стелку */
|
19
|
+
showArrow?: boolean;
|
20
|
+
/** Обработчик клика */
|
21
|
+
onClick?: (e: React.SyntheticEvent<EventTarget>) => void;
|
22
|
+
};
|
23
|
+
export interface IButtonsBox {
|
24
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
25
|
+
dataAttrs?: {
|
26
|
+
root?: Record<string, string>;
|
27
|
+
button?: Record<string, string>;
|
28
|
+
extraButton?: Record<string, string>;
|
29
|
+
};
|
30
|
+
/** Дополнительный класс корневого элемента */
|
31
|
+
className?: string;
|
32
|
+
/** Дополнительные классы для внутренних элементов */
|
33
|
+
classes?: {
|
34
|
+
root?: string;
|
35
|
+
button?: string;
|
36
|
+
extraButton?: string;
|
37
|
+
};
|
38
|
+
/** Кнопка */
|
39
|
+
button: ButtonType;
|
40
|
+
/** Дополнительная кнопка */
|
41
|
+
extraButton?: ButtonType;
|
42
|
+
/** Горизонтальное выравнивание */
|
43
|
+
align?: 'center' | 'left';
|
44
|
+
/** Ссылка на корневой элемент */
|
45
|
+
rootRef?: React.Ref<HTMLDivElement>;
|
46
|
+
}
|
47
|
+
declare const ButtonsBox: React.FC<IButtonsBox>;
|
48
|
+
export default ButtonsBox;
|
@@ -0,0 +1,89 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import React from 'react';
|
3
|
+
import { Button } from '@megafon/ui-core';
|
4
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
5
|
+
import * as PropTypes from 'prop-types';
|
6
|
+
import { setRelAttribute } from "../../helpers/setRelAttribute";
|
7
|
+
import "./ButtonsBox.css";
|
8
|
+
var cn = cnCreate('mfui-v6-buttons-box');
|
9
|
+
|
10
|
+
var ButtonsBox = function ButtonsBox(_ref) {
|
11
|
+
var className = _ref.className,
|
12
|
+
_ref$classes = _ref.classes,
|
13
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
14
|
+
dataAttrs = _ref.dataAttrs,
|
15
|
+
button = _ref.button,
|
16
|
+
extraButton = _ref.extraButton,
|
17
|
+
align = _ref.align,
|
18
|
+
rootRef = _ref.rootRef;
|
19
|
+
var showTwoButtons = !!button && !!extraButton;
|
20
|
+
|
21
|
+
var renderButton = function renderButton(btnProps, btnClassName, dataAttr) {
|
22
|
+
return /*#__PURE__*/React.createElement(Button, {
|
23
|
+
dataAttrs: {
|
24
|
+
root: dataAttr
|
25
|
+
},
|
26
|
+
className: btnClassName,
|
27
|
+
fullWidth: showTwoButtons,
|
28
|
+
type: btnProps.type,
|
29
|
+
theme: "green",
|
30
|
+
icon: btnProps.icon,
|
31
|
+
href: btnProps.href,
|
32
|
+
target: btnProps.target,
|
33
|
+
download: btnProps.download,
|
34
|
+
showArrow: btnProps.showArrow,
|
35
|
+
rel: setRelAttribute(btnProps.rel, btnProps.target),
|
36
|
+
onClick: btnProps.onClick
|
37
|
+
}, btnProps.title);
|
38
|
+
};
|
39
|
+
|
40
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
41
|
+
className: cn({
|
42
|
+
'h-align': align
|
43
|
+
}, [className, classes.root]),
|
44
|
+
ref: rootRef
|
45
|
+
}), /*#__PURE__*/React.createElement("div", {
|
46
|
+
className: cn('buttons', {
|
47
|
+
'equal-width': showTwoButtons
|
48
|
+
})
|
49
|
+
}, !!button && renderButton(button, classes.button, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button), !!extraButton && renderButton(extraButton, classes.extraButton, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.extraButton)));
|
50
|
+
};
|
51
|
+
|
52
|
+
ButtonsBox.propTypes = {
|
53
|
+
dataAttrs: PropTypes.shape({
|
54
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
55
|
+
link: PropTypes.objectOf(PropTypes.string.isRequired),
|
56
|
+
button: PropTypes.objectOf(PropTypes.string.isRequired)
|
57
|
+
}),
|
58
|
+
className: PropTypes.string,
|
59
|
+
classes: PropTypes.shape({
|
60
|
+
root: PropTypes.string,
|
61
|
+
button: PropTypes.string,
|
62
|
+
link: PropTypes.string
|
63
|
+
}),
|
64
|
+
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
65
|
+
current: PropTypes.elementType
|
66
|
+
}), PropTypes.any])]),
|
67
|
+
align: PropTypes.oneOf(['center', 'left']),
|
68
|
+
button: PropTypes.shape({
|
69
|
+
type: PropTypes.oneOf(['primary', 'outline']),
|
70
|
+
icon: PropTypes.element,
|
71
|
+
title: PropTypes.string,
|
72
|
+
href: PropTypes.string,
|
73
|
+
target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
|
74
|
+
rel: PropTypes.string,
|
75
|
+
download: PropTypes.bool,
|
76
|
+
onClick: PropTypes.func
|
77
|
+
}).isRequired,
|
78
|
+
extraButton: PropTypes.shape({
|
79
|
+
type: PropTypes.oneOf(['primary', 'outline']),
|
80
|
+
icon: PropTypes.element,
|
81
|
+
title: PropTypes.string,
|
82
|
+
href: PropTypes.string,
|
83
|
+
target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
|
84
|
+
rel: PropTypes.string,
|
85
|
+
download: PropTypes.bool,
|
86
|
+
onClick: PropTypes.func
|
87
|
+
})
|
88
|
+
};
|
89
|
+
export default ButtonsBox;
|