@megafon/ui-core 3.1.0 → 3.3.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 +46 -0
- package/dist/es/components/Accordion/Accordion.css +1 -0
- package/dist/es/components/Badges/components/PriceBadge/PriceBadge.css +70 -0
- package/dist/es/components/Badges/components/PriceBadge/PriceBadge.d.ts +33 -0
- package/dist/es/components/Badges/components/PriceBadge/PriceBadge.js +113 -0
- package/dist/es/components/Badges/components/PromoBadge/PromoBadge.css +32 -0
- package/dist/es/components/Badges/components/PromoBadge/PromoBadge.d.ts +22 -0
- package/dist/es/components/Badges/components/PromoBadge/PromoBadge.js +38 -0
- package/dist/es/components/Carousel/Carousel.js +9 -3
- package/dist/es/components/Checkbox/Checkbox.css +3 -0
- package/dist/es/components/Collapse/Collapse.js +1 -0
- package/dist/es/components/Tile/Tile.d.ts +2 -0
- package/dist/es/components/Tile/Tile.js +7 -3
- package/dist/es/index.d.ts +2 -0
- package/dist/es/index.js +2 -0
- package/dist/lib/components/Accordion/Accordion.css +1 -0
- package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.css +70 -0
- package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.d.ts +33 -0
- package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.js +134 -0
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.css +32 -0
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.d.ts +22 -0
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.js +59 -0
- package/dist/lib/components/Carousel/Carousel.js +9 -3
- package/dist/lib/components/Checkbox/Checkbox.css +3 -0
- package/dist/lib/components/Collapse/Collapse.js +1 -0
- package/dist/lib/components/Tile/Tile.d.ts +2 -0
- package/dist/lib/components/Tile/Tile.js +7 -3
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +16 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,52 @@
|
|
|
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
|
+
## [3.3.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.3.0...@megafon/ui-core@3.3.1) (2022-03-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **collapse:** made collapse height 0 or auto on animation end ([c898d1e](https://github.com/MegafonWebLab/megafon-ui/commit/c898d1e84d3c92defa204c24125508655466d5cd))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.3.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.2.0...@megafon/ui-core@3.3.0) (2022-03-14)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **accordion:** remove outline for safari ([787b572](https://github.com/MegafonWebLab/megafon-ui/commit/787b5725ef962637401a0a3a1a8ae7ba0cece031))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **badges:** add new component PriceBadge ([9214baa](https://github.com/MegafonWebLab/megafon-ui/commit/9214baab003f958b916b728cf07e6f9db15173dd))
|
|
28
|
+
* **badges:** add new component PromoBadge ([6e550a0](https://github.com/MegafonWebLab/megafon-ui/commit/6e550a06fd2d0fb7b3dba488702f4a34f4f6d101))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# [3.2.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.1.0...@megafon/ui-core@3.2.0) (2022-02-28)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
* **checkbox:** delete outline focus effect ([ecd98e7](https://github.com/MegafonWebLab/megafon-ui/commit/ecd98e7129ddd305ce6e21c1c98cdacc3670ff92))
|
|
40
|
+
* **tile:** delete unnecessary symbol ([1f0ed90](https://github.com/MegafonWebLab/megafon-ui/commit/1f0ed9009ef2cb9e5562f257640a623eceae225e))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Features
|
|
44
|
+
|
|
45
|
+
* **carousel:** fix data-attribute passing for NavArrow ([af0d26e](https://github.com/MegafonWebLab/megafon-ui/commit/af0d26ef85a19cdb4fd863a45b2c2b2365d9c086))
|
|
46
|
+
* **tile:** add target props for link ([e49d040](https://github.com/MegafonWebLab/megafon-ui/commit/e49d0402725e88b9fd7d80fd418acd81bea321ba))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
6
52
|
# [3.1.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.2...@megafon/ui-core@3.1.0) (2022-02-22)
|
|
7
53
|
|
|
8
54
|
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
.mfui-price-badge {
|
|
2
|
+
font-size: 12px;
|
|
3
|
+
line-height: 16px;
|
|
4
|
+
display: -webkit-box;
|
|
5
|
+
display: -ms-flexbox;
|
|
6
|
+
display: flex;
|
|
7
|
+
-webkit-box-align: center;
|
|
8
|
+
-ms-flex-align: center;
|
|
9
|
+
align-items: center;
|
|
10
|
+
padding: 4px;
|
|
11
|
+
padding-right: 8px;
|
|
12
|
+
width: -webkit-fit-content;
|
|
13
|
+
width: -moz-fit-content;
|
|
14
|
+
width: fit-content;
|
|
15
|
+
height: 24px;
|
|
16
|
+
border-radius: 8px;
|
|
17
|
+
}
|
|
18
|
+
@media screen and (min-width: 1024px) {
|
|
19
|
+
.mfui-price-badge_adaptive {
|
|
20
|
+
font-size: 15px;
|
|
21
|
+
line-height: 24px;
|
|
22
|
+
padding: 4px 8px;
|
|
23
|
+
height: 32px;
|
|
24
|
+
border-radius: 12px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
.mfui-price-badge_theme_grey {
|
|
28
|
+
background-color: var(--spbSky0);
|
|
29
|
+
}
|
|
30
|
+
.mfui-price-badge_theme_grey .mfui-price-badge__text {
|
|
31
|
+
color: var(--spbSky3);
|
|
32
|
+
}
|
|
33
|
+
.mfui-price-badge_theme_grey .mfui-price-badge__icon {
|
|
34
|
+
fill: var(--spbSky3);
|
|
35
|
+
}
|
|
36
|
+
.mfui-price-badge_theme_orange {
|
|
37
|
+
background-color: var(--137C20);
|
|
38
|
+
}
|
|
39
|
+
.mfui-price-badge_theme_orange .mfui-price-badge__text {
|
|
40
|
+
color: var(--137C);
|
|
41
|
+
}
|
|
42
|
+
.mfui-price-badge_theme_orange .mfui-price-badge__icon {
|
|
43
|
+
fill: var(--137C);
|
|
44
|
+
}
|
|
45
|
+
.mfui-price-badge_theme_green {
|
|
46
|
+
background-color: var(--brandGreen20);
|
|
47
|
+
}
|
|
48
|
+
.mfui-price-badge_theme_green .mfui-price-badge__text {
|
|
49
|
+
color: var(--brandGreen);
|
|
50
|
+
}
|
|
51
|
+
.mfui-price-badge_theme_green .mfui-price-badge__icon {
|
|
52
|
+
fill: var(--brandGreen);
|
|
53
|
+
}
|
|
54
|
+
.mfui-price-badge_theme_red {
|
|
55
|
+
background-color: var(--fury20);
|
|
56
|
+
}
|
|
57
|
+
.mfui-price-badge_theme_red .mfui-price-badge__text {
|
|
58
|
+
color: var(--fury);
|
|
59
|
+
}
|
|
60
|
+
.mfui-price-badge_theme_red .mfui-price-badge__icon {
|
|
61
|
+
fill: var(--fury);
|
|
62
|
+
}
|
|
63
|
+
.mfui-price-badge__text {
|
|
64
|
+
font-family: inherit;
|
|
65
|
+
margin-left: 4px;
|
|
66
|
+
}
|
|
67
|
+
.mfui-price-badge__icon {
|
|
68
|
+
height: 20px;
|
|
69
|
+
width: 20px;
|
|
70
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './PriceBadge.less';
|
|
3
|
+
export declare const PriceBadgeTheme: {
|
|
4
|
+
readonly RED: "red";
|
|
5
|
+
readonly GREY: "grey";
|
|
6
|
+
readonly GREEN: "green";
|
|
7
|
+
readonly ORANGE: "orange";
|
|
8
|
+
};
|
|
9
|
+
export declare const PriceBadgeIcon: {
|
|
10
|
+
readonly TIMER: "timer";
|
|
11
|
+
readonly PRICE: "price";
|
|
12
|
+
readonly CHECK: "check";
|
|
13
|
+
readonly ATTENTION: "attention";
|
|
14
|
+
};
|
|
15
|
+
declare type PriceBadgeThemeType = typeof PriceBadgeTheme[keyof typeof PriceBadgeTheme];
|
|
16
|
+
declare type PriceBadgeIconType = typeof PriceBadgeIcon[keyof typeof PriceBadgeIcon];
|
|
17
|
+
export interface IPriceBadgeProps {
|
|
18
|
+
/** Адаптивный режим */
|
|
19
|
+
isAdaptive?: boolean;
|
|
20
|
+
/** Тип иконки */
|
|
21
|
+
iconType?: PriceBadgeIconType;
|
|
22
|
+
/** Цветовая тема */
|
|
23
|
+
theme?: PriceBadgeThemeType;
|
|
24
|
+
/** Дополнительный класс корневого элемента */
|
|
25
|
+
className?: string;
|
|
26
|
+
/** Дополнительные data-атрибуты к внутренним элементам */
|
|
27
|
+
dataAttrs?: {
|
|
28
|
+
root?: Record<string, string>;
|
|
29
|
+
};
|
|
30
|
+
children: JSX.Element[] | Element[] | JSX.Element | Element | string;
|
|
31
|
+
}
|
|
32
|
+
declare const PriceBadge: React.FC<IPriceBadgeProps>;
|
|
33
|
+
export default PriceBadge;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import "core-js/modules/es.object.values";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
5
|
+
import * as PropTypes from 'prop-types';
|
|
6
|
+
import "./PriceBadge.css";
|
|
7
|
+
|
|
8
|
+
var AttentionIcon = function AttentionIcon(props) {
|
|
9
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
10
|
+
viewBox: "0 0 20 20"
|
|
11
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
12
|
+
d: "M10 2c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8zm0 13c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7s-.1-.5-.3-.7c-.2-.2-.5-.3-.7-.3s-.5.1-.7.3c-.2.2-.3.4-.3.7s.1.5.3.7.5.3.7.3zM9 5v6h2V5H9z"
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var CheckIcon = function CheckIcon(props) {
|
|
17
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
18
|
+
viewBox: "0 0 20 20"
|
|
19
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
20
|
+
fillRule: "evenodd",
|
|
21
|
+
clipRule: "evenodd",
|
|
22
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zM7.295 9.467l1.77 1.77 3.66-5.22 1.31.918-4.745 6.79-3.126-3.127 1.131-1.13z"
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var PriceIcon = function PriceIcon(props) {
|
|
27
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
28
|
+
viewBox: "0 0 20 20"
|
|
29
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
30
|
+
fillRule: "evenodd",
|
|
31
|
+
clipRule: "evenodd",
|
|
32
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zM7.75 5.75H11a2.75 2.75 0 010 5.5H9.25V12h3v1.5h-3v1.75h-1.5V13.5h-1V12h1v-.75h-1v-1.5h1v-4zM11 7.25H9.25v2.5H11a1.25 1.25 0 000-2.5z"
|
|
33
|
+
}));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
var TimerIcon = function TimerIcon(props) {
|
|
37
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
38
|
+
viewBox: "0 0 20 20"
|
|
39
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
40
|
+
fillRule: "evenodd",
|
|
41
|
+
clipRule: "evenodd",
|
|
42
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm1-8.414V5H9v5.414l3 3L13.414 12 11 9.586z"
|
|
43
|
+
}));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export var PriceBadgeTheme = {
|
|
47
|
+
RED: 'red',
|
|
48
|
+
GREY: 'grey',
|
|
49
|
+
GREEN: 'green',
|
|
50
|
+
ORANGE: 'orange'
|
|
51
|
+
};
|
|
52
|
+
export var PriceBadgeIcon = {
|
|
53
|
+
TIMER: 'timer',
|
|
54
|
+
PRICE: 'price',
|
|
55
|
+
CHECK: 'check',
|
|
56
|
+
ATTENTION: 'attention'
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
var getPriceBadgeIcon = function getPriceBadgeIcon(iconType) {
|
|
60
|
+
switch (iconType) {
|
|
61
|
+
case PriceBadgeIcon.TIMER:
|
|
62
|
+
return TimerIcon;
|
|
63
|
+
|
|
64
|
+
case PriceBadgeIcon.PRICE:
|
|
65
|
+
return PriceIcon;
|
|
66
|
+
|
|
67
|
+
case PriceBadgeIcon.CHECK:
|
|
68
|
+
return CheckIcon;
|
|
69
|
+
|
|
70
|
+
case PriceBadgeIcon.ATTENTION:
|
|
71
|
+
return AttentionIcon;
|
|
72
|
+
|
|
73
|
+
default:
|
|
74
|
+
return TimerIcon;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
var cn = cnCreate('mfui-price-badge');
|
|
79
|
+
|
|
80
|
+
var PriceBadge = function PriceBadge(_ref) {
|
|
81
|
+
var _ref$iconType = _ref.iconType,
|
|
82
|
+
iconType = _ref$iconType === void 0 ? 'timer' : _ref$iconType,
|
|
83
|
+
_ref$isAdaptive = _ref.isAdaptive,
|
|
84
|
+
isAdaptive = _ref$isAdaptive === void 0 ? false : _ref$isAdaptive,
|
|
85
|
+
_ref$theme = _ref.theme,
|
|
86
|
+
theme = _ref$theme === void 0 ? 'grey' : _ref$theme,
|
|
87
|
+
className = _ref.className,
|
|
88
|
+
dataAttrs = _ref.dataAttrs,
|
|
89
|
+
children = _ref.children;
|
|
90
|
+
var Icon = getPriceBadgeIcon(iconType);
|
|
91
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
92
|
+
className: cn({
|
|
93
|
+
theme: theme,
|
|
94
|
+
adaptive: isAdaptive
|
|
95
|
+
}, className)
|
|
96
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
97
|
+
className: cn('icon')
|
|
98
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
99
|
+
className: cn('text')
|
|
100
|
+
}, children));
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
PriceBadge.propTypes = {
|
|
104
|
+
isAdaptive: PropTypes.bool,
|
|
105
|
+
iconType: PropTypes.oneOf(Object.values(PriceBadgeIcon)),
|
|
106
|
+
theme: PropTypes.oneOf(Object.values(PriceBadgeTheme)),
|
|
107
|
+
className: PropTypes.string,
|
|
108
|
+
dataAttrs: PropTypes.shape({
|
|
109
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired).isRequired
|
|
110
|
+
}),
|
|
111
|
+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element, PropTypes.string]).isRequired
|
|
112
|
+
};
|
|
113
|
+
export default PriceBadge;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.mfui-promo-badge {
|
|
2
|
+
display: -webkit-box;
|
|
3
|
+
display: -ms-flexbox;
|
|
4
|
+
display: flex;
|
|
5
|
+
-webkit-box-align: center;
|
|
6
|
+
-ms-flex-align: center;
|
|
7
|
+
align-items: center;
|
|
8
|
+
padding: 4px 12px;
|
|
9
|
+
width: -webkit-fit-content;
|
|
10
|
+
width: -moz-fit-content;
|
|
11
|
+
width: fit-content;
|
|
12
|
+
border-radius: 8px;
|
|
13
|
+
color: var(--base);
|
|
14
|
+
}
|
|
15
|
+
.mfui-promo-badge_type_hit {
|
|
16
|
+
background-color: var(--warmRedC);
|
|
17
|
+
}
|
|
18
|
+
.mfui-promo-badge_type_new {
|
|
19
|
+
background-color: var(--systemBlue);
|
|
20
|
+
}
|
|
21
|
+
.mfui-promo-badge_type_popular {
|
|
22
|
+
background-color: var(--137C);
|
|
23
|
+
}
|
|
24
|
+
.mfui-promo-badge_type_user-choice {
|
|
25
|
+
background-color: var(--reflexBlue);
|
|
26
|
+
}
|
|
27
|
+
.mfui-promo-badge__text {
|
|
28
|
+
font-family: inherit;
|
|
29
|
+
font-size: 12px;
|
|
30
|
+
line-height: 16px;
|
|
31
|
+
font-weight: 500;
|
|
32
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './PromoBadge.less';
|
|
3
|
+
export declare const PromoBadgeTypes: {
|
|
4
|
+
readonly HIT: "hit";
|
|
5
|
+
readonly NEW: "new";
|
|
6
|
+
readonly POPULAR: "popular";
|
|
7
|
+
readonly USER_CHOICE: "user-choice";
|
|
8
|
+
};
|
|
9
|
+
declare type PromoBadgeTypesType = typeof PromoBadgeTypes[keyof typeof PromoBadgeTypes];
|
|
10
|
+
export interface IPromoBadgeProps {
|
|
11
|
+
/** Тип промо-бэйджа */
|
|
12
|
+
type?: PromoBadgeTypesType;
|
|
13
|
+
/** Дополнительный класс корневого элемента */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** Дополнительные data-атрибуты к внутренним элементам */
|
|
16
|
+
dataAttrs?: {
|
|
17
|
+
root?: Record<string, string>;
|
|
18
|
+
};
|
|
19
|
+
children: JSX.Element[] | Element[] | JSX.Element | Element | string;
|
|
20
|
+
}
|
|
21
|
+
declare const PromoBadge: React.FC<IPromoBadgeProps>;
|
|
22
|
+
export default PromoBadge;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import "core-js/modules/es.object.values";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
5
|
+
import * as PropTypes from 'prop-types';
|
|
6
|
+
import "./PromoBadge.css";
|
|
7
|
+
export var PromoBadgeTypes = {
|
|
8
|
+
HIT: 'hit',
|
|
9
|
+
NEW: 'new',
|
|
10
|
+
POPULAR: 'popular',
|
|
11
|
+
USER_CHOICE: 'user-choice'
|
|
12
|
+
};
|
|
13
|
+
var cn = cnCreate('mfui-promo-badge');
|
|
14
|
+
|
|
15
|
+
var PromoBadge = function PromoBadge(_ref) {
|
|
16
|
+
var _ref$type = _ref.type,
|
|
17
|
+
type = _ref$type === void 0 ? 'hit' : _ref$type,
|
|
18
|
+
className = _ref.className,
|
|
19
|
+
children = _ref.children,
|
|
20
|
+
dataAttrs = _ref.dataAttrs;
|
|
21
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
22
|
+
className: cn({
|
|
23
|
+
type: type
|
|
24
|
+
}, className)
|
|
25
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
26
|
+
className: cn('text')
|
|
27
|
+
}, children));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
PromoBadge.propTypes = {
|
|
31
|
+
type: PropTypes.oneOf(Object.values(PromoBadgeTypes)),
|
|
32
|
+
className: PropTypes.string,
|
|
33
|
+
dataAttrs: PropTypes.shape({
|
|
34
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
35
|
+
}),
|
|
36
|
+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element, PropTypes.string]).isRequired
|
|
37
|
+
};
|
|
38
|
+
export default PromoBadge;
|
|
@@ -281,7 +281,10 @@ var Carousel = function Carousel(_ref) {
|
|
|
281
281
|
onFocus: handleSlideFocus(i),
|
|
282
282
|
onMouseDown: disableFocusOnSlideClick
|
|
283
283
|
}), child);
|
|
284
|
-
})), /*#__PURE__*/React.createElement(NavArrow,
|
|
284
|
+
})), /*#__PURE__*/React.createElement(NavArrow, {
|
|
285
|
+
dataAttrs: {
|
|
286
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.prev
|
|
287
|
+
},
|
|
285
288
|
className: cn('arrow', {
|
|
286
289
|
prev: true,
|
|
287
290
|
locked: isLocked
|
|
@@ -289,7 +292,10 @@ var Carousel = function Carousel(_ref) {
|
|
|
289
292
|
onClick: handlePrevClick,
|
|
290
293
|
disabled: !loop && isBeginning,
|
|
291
294
|
theme: ArrowTheme.PURPLE
|
|
292
|
-
})
|
|
295
|
+
}), /*#__PURE__*/React.createElement(NavArrow, {
|
|
296
|
+
dataAttrs: {
|
|
297
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.next
|
|
298
|
+
},
|
|
293
299
|
className: cn('arrow', {
|
|
294
300
|
next: true,
|
|
295
301
|
locked: isLocked
|
|
@@ -298,7 +304,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
298
304
|
onClick: handleNextClick,
|
|
299
305
|
disabled: !loop && isEnd,
|
|
300
306
|
theme: ArrowTheme.PURPLE
|
|
301
|
-
}))
|
|
307
|
+
}));
|
|
302
308
|
};
|
|
303
309
|
|
|
304
310
|
Carousel.propTypes = {
|
|
@@ -20,6 +20,8 @@ declare type ShadowType = typeof Shadow[keyof typeof Shadow];
|
|
|
20
20
|
export interface ITileProps {
|
|
21
21
|
/** Ссылка */
|
|
22
22
|
href?: string;
|
|
23
|
+
/** Атрибут для открытия ссылки */
|
|
24
|
+
target?: '_self' | '_blank';
|
|
23
25
|
/** Тема */
|
|
24
26
|
theme?: ThemeType;
|
|
25
27
|
/** Радиус границы */
|
|
@@ -33,7 +33,9 @@ var Tile = function Tile(_ref) {
|
|
|
33
33
|
_ref$isInteractive = _ref.isInteractive,
|
|
34
34
|
isInteractive = _ref$isInteractive === void 0 ? false : _ref$isInteractive,
|
|
35
35
|
onClick = _ref.onClick,
|
|
36
|
-
dataAttrs = _ref.dataAttrs
|
|
36
|
+
dataAttrs = _ref.dataAttrs,
|
|
37
|
+
_ref$target = _ref.target,
|
|
38
|
+
target = _ref$target === void 0 ? '_self' : _ref$target;
|
|
37
39
|
|
|
38
40
|
var handleClick = function handleClick(e) {
|
|
39
41
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
@@ -51,7 +53,8 @@ var Tile = function Tile(_ref) {
|
|
|
51
53
|
onClick: handleClick
|
|
52
54
|
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), href && /*#__PURE__*/React.createElement("a", {
|
|
53
55
|
href: href,
|
|
54
|
-
className: cn('link')
|
|
56
|
+
className: cn('link'),
|
|
57
|
+
target: target
|
|
55
58
|
}, children), !href && children);
|
|
56
59
|
};
|
|
57
60
|
|
|
@@ -65,6 +68,7 @@ Tile.propTypes = {
|
|
|
65
68
|
onClick: PropTypes.func,
|
|
66
69
|
dataAttrs: PropTypes.shape({
|
|
67
70
|
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
68
|
-
})
|
|
71
|
+
}),
|
|
72
|
+
target: PropTypes.oneOf(['_self', '_blank'])
|
|
69
73
|
};
|
|
70
74
|
export default Tile;
|
package/dist/es/index.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export { default as PaginationButtons } from './components/Pagination/components
|
|
|
28
28
|
export { default as PaginationNavigation } from './components/Pagination/components/PaginationNavigation/PaginationNavigation';
|
|
29
29
|
export { default as Paragraph } from './components/Paragraph/Paragraph';
|
|
30
30
|
export { default as Preloader } from './components/Preloader/Preloader';
|
|
31
|
+
export { default as PriceBadge } from './components/Badges/components/PriceBadge/PriceBadge';
|
|
32
|
+
export { default as PromoBadge } from './components/Badges/components/PromoBadge/PromoBadge';
|
|
31
33
|
export { default as RadioButton } from './components/RadioButton/RadioButton';
|
|
32
34
|
export { default as Search } from './components/Search/Search';
|
|
33
35
|
export { default as Select } from './components/Select/Select';
|
package/dist/es/index.js
CHANGED
|
@@ -28,6 +28,8 @@ export { default as PaginationButtons } from "./components/Pagination/components
|
|
|
28
28
|
export { default as PaginationNavigation } from "./components/Pagination/components/PaginationNavigation/PaginationNavigation";
|
|
29
29
|
export { default as Paragraph } from "./components/Paragraph/Paragraph";
|
|
30
30
|
export { default as Preloader } from "./components/Preloader/Preloader";
|
|
31
|
+
export { default as PriceBadge } from "./components/Badges/components/PriceBadge/PriceBadge";
|
|
32
|
+
export { default as PromoBadge } from "./components/Badges/components/PromoBadge/PromoBadge";
|
|
31
33
|
export { default as RadioButton } from "./components/RadioButton/RadioButton";
|
|
32
34
|
export { default as Search } from "./components/Search/Search";
|
|
33
35
|
export { default as Select } from "./components/Select/Select";
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
.mfui-price-badge {
|
|
2
|
+
font-size: 12px;
|
|
3
|
+
line-height: 16px;
|
|
4
|
+
display: -webkit-box;
|
|
5
|
+
display: -ms-flexbox;
|
|
6
|
+
display: flex;
|
|
7
|
+
-webkit-box-align: center;
|
|
8
|
+
-ms-flex-align: center;
|
|
9
|
+
align-items: center;
|
|
10
|
+
padding: 4px;
|
|
11
|
+
padding-right: 8px;
|
|
12
|
+
width: -webkit-fit-content;
|
|
13
|
+
width: -moz-fit-content;
|
|
14
|
+
width: fit-content;
|
|
15
|
+
height: 24px;
|
|
16
|
+
border-radius: 8px;
|
|
17
|
+
}
|
|
18
|
+
@media screen and (min-width: 1024px) {
|
|
19
|
+
.mfui-price-badge_adaptive {
|
|
20
|
+
font-size: 15px;
|
|
21
|
+
line-height: 24px;
|
|
22
|
+
padding: 4px 8px;
|
|
23
|
+
height: 32px;
|
|
24
|
+
border-radius: 12px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
.mfui-price-badge_theme_grey {
|
|
28
|
+
background-color: var(--spbSky0);
|
|
29
|
+
}
|
|
30
|
+
.mfui-price-badge_theme_grey .mfui-price-badge__text {
|
|
31
|
+
color: var(--spbSky3);
|
|
32
|
+
}
|
|
33
|
+
.mfui-price-badge_theme_grey .mfui-price-badge__icon {
|
|
34
|
+
fill: var(--spbSky3);
|
|
35
|
+
}
|
|
36
|
+
.mfui-price-badge_theme_orange {
|
|
37
|
+
background-color: var(--137C20);
|
|
38
|
+
}
|
|
39
|
+
.mfui-price-badge_theme_orange .mfui-price-badge__text {
|
|
40
|
+
color: var(--137C);
|
|
41
|
+
}
|
|
42
|
+
.mfui-price-badge_theme_orange .mfui-price-badge__icon {
|
|
43
|
+
fill: var(--137C);
|
|
44
|
+
}
|
|
45
|
+
.mfui-price-badge_theme_green {
|
|
46
|
+
background-color: var(--brandGreen20);
|
|
47
|
+
}
|
|
48
|
+
.mfui-price-badge_theme_green .mfui-price-badge__text {
|
|
49
|
+
color: var(--brandGreen);
|
|
50
|
+
}
|
|
51
|
+
.mfui-price-badge_theme_green .mfui-price-badge__icon {
|
|
52
|
+
fill: var(--brandGreen);
|
|
53
|
+
}
|
|
54
|
+
.mfui-price-badge_theme_red {
|
|
55
|
+
background-color: var(--fury20);
|
|
56
|
+
}
|
|
57
|
+
.mfui-price-badge_theme_red .mfui-price-badge__text {
|
|
58
|
+
color: var(--fury);
|
|
59
|
+
}
|
|
60
|
+
.mfui-price-badge_theme_red .mfui-price-badge__icon {
|
|
61
|
+
fill: var(--fury);
|
|
62
|
+
}
|
|
63
|
+
.mfui-price-badge__text {
|
|
64
|
+
font-family: inherit;
|
|
65
|
+
margin-left: 4px;
|
|
66
|
+
}
|
|
67
|
+
.mfui-price-badge__icon {
|
|
68
|
+
height: 20px;
|
|
69
|
+
width: 20px;
|
|
70
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './PriceBadge.less';
|
|
3
|
+
export declare const PriceBadgeTheme: {
|
|
4
|
+
readonly RED: "red";
|
|
5
|
+
readonly GREY: "grey";
|
|
6
|
+
readonly GREEN: "green";
|
|
7
|
+
readonly ORANGE: "orange";
|
|
8
|
+
};
|
|
9
|
+
export declare const PriceBadgeIcon: {
|
|
10
|
+
readonly TIMER: "timer";
|
|
11
|
+
readonly PRICE: "price";
|
|
12
|
+
readonly CHECK: "check";
|
|
13
|
+
readonly ATTENTION: "attention";
|
|
14
|
+
};
|
|
15
|
+
declare type PriceBadgeThemeType = typeof PriceBadgeTheme[keyof typeof PriceBadgeTheme];
|
|
16
|
+
declare type PriceBadgeIconType = typeof PriceBadgeIcon[keyof typeof PriceBadgeIcon];
|
|
17
|
+
export interface IPriceBadgeProps {
|
|
18
|
+
/** Адаптивный режим */
|
|
19
|
+
isAdaptive?: boolean;
|
|
20
|
+
/** Тип иконки */
|
|
21
|
+
iconType?: PriceBadgeIconType;
|
|
22
|
+
/** Цветовая тема */
|
|
23
|
+
theme?: PriceBadgeThemeType;
|
|
24
|
+
/** Дополнительный класс корневого элемента */
|
|
25
|
+
className?: string;
|
|
26
|
+
/** Дополнительные data-атрибуты к внутренним элементам */
|
|
27
|
+
dataAttrs?: {
|
|
28
|
+
root?: Record<string, string>;
|
|
29
|
+
};
|
|
30
|
+
children: JSX.Element[] | Element[] | JSX.Element | Element | string;
|
|
31
|
+
}
|
|
32
|
+
declare const PriceBadge: React.FC<IPriceBadgeProps>;
|
|
33
|
+
export default PriceBadge;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.PriceBadgeIcon = exports.PriceBadgeTheme = void 0;
|
|
9
|
+
|
|
10
|
+
require("core-js/modules/es.object.values");
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var React = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
var _uiHelpers = require("@megafon/ui-helpers");
|
|
17
|
+
|
|
18
|
+
var PropTypes = _interopRequireWildcard(require("prop-types"));
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
+
|
|
26
|
+
var AttentionIcon = function AttentionIcon(props) {
|
|
27
|
+
return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
|
|
28
|
+
viewBox: "0 0 20 20"
|
|
29
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
30
|
+
d: "M10 2c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8zm0 13c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7s-.1-.5-.3-.7c-.2-.2-.5-.3-.7-.3s-.5.1-.7.3c-.2.2-.3.4-.3.7s.1.5.3.7.5.3.7.3zM9 5v6h2V5H9z"
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var CheckIcon = function CheckIcon(props) {
|
|
35
|
+
return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
|
|
36
|
+
viewBox: "0 0 20 20"
|
|
37
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
38
|
+
fillRule: "evenodd",
|
|
39
|
+
clipRule: "evenodd",
|
|
40
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zM7.295 9.467l1.77 1.77 3.66-5.22 1.31.918-4.745 6.79-3.126-3.127 1.131-1.13z"
|
|
41
|
+
}));
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
var PriceIcon = function PriceIcon(props) {
|
|
45
|
+
return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
|
|
46
|
+
viewBox: "0 0 20 20"
|
|
47
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
48
|
+
fillRule: "evenodd",
|
|
49
|
+
clipRule: "evenodd",
|
|
50
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zM7.75 5.75H11a2.75 2.75 0 010 5.5H9.25V12h3v1.5h-3v1.75h-1.5V13.5h-1V12h1v-.75h-1v-1.5h1v-4zM11 7.25H9.25v2.5H11a1.25 1.25 0 000-2.5z"
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
var TimerIcon = function TimerIcon(props) {
|
|
55
|
+
return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
|
|
56
|
+
viewBox: "0 0 20 20"
|
|
57
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
58
|
+
fillRule: "evenodd",
|
|
59
|
+
clipRule: "evenodd",
|
|
60
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm1-8.414V5H9v5.414l3 3L13.414 12 11 9.586z"
|
|
61
|
+
}));
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
var PriceBadgeTheme = {
|
|
65
|
+
RED: 'red',
|
|
66
|
+
GREY: 'grey',
|
|
67
|
+
GREEN: 'green',
|
|
68
|
+
ORANGE: 'orange'
|
|
69
|
+
};
|
|
70
|
+
exports.PriceBadgeTheme = PriceBadgeTheme;
|
|
71
|
+
var PriceBadgeIcon = {
|
|
72
|
+
TIMER: 'timer',
|
|
73
|
+
PRICE: 'price',
|
|
74
|
+
CHECK: 'check',
|
|
75
|
+
ATTENTION: 'attention'
|
|
76
|
+
};
|
|
77
|
+
exports.PriceBadgeIcon = PriceBadgeIcon;
|
|
78
|
+
|
|
79
|
+
var getPriceBadgeIcon = function getPriceBadgeIcon(iconType) {
|
|
80
|
+
switch (iconType) {
|
|
81
|
+
case PriceBadgeIcon.TIMER:
|
|
82
|
+
return TimerIcon;
|
|
83
|
+
|
|
84
|
+
case PriceBadgeIcon.PRICE:
|
|
85
|
+
return PriceIcon;
|
|
86
|
+
|
|
87
|
+
case PriceBadgeIcon.CHECK:
|
|
88
|
+
return CheckIcon;
|
|
89
|
+
|
|
90
|
+
case PriceBadgeIcon.ATTENTION:
|
|
91
|
+
return AttentionIcon;
|
|
92
|
+
|
|
93
|
+
default:
|
|
94
|
+
return TimerIcon;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
var cn = (0, _uiHelpers.cnCreate)('mfui-price-badge');
|
|
99
|
+
|
|
100
|
+
var PriceBadge = function PriceBadge(_ref) {
|
|
101
|
+
var _ref$iconType = _ref.iconType,
|
|
102
|
+
iconType = _ref$iconType === void 0 ? 'timer' : _ref$iconType,
|
|
103
|
+
_ref$isAdaptive = _ref.isAdaptive,
|
|
104
|
+
isAdaptive = _ref$isAdaptive === void 0 ? false : _ref$isAdaptive,
|
|
105
|
+
_ref$theme = _ref.theme,
|
|
106
|
+
theme = _ref$theme === void 0 ? 'grey' : _ref$theme,
|
|
107
|
+
className = _ref.className,
|
|
108
|
+
dataAttrs = _ref.dataAttrs,
|
|
109
|
+
children = _ref.children;
|
|
110
|
+
var Icon = getPriceBadgeIcon(iconType);
|
|
111
|
+
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
112
|
+
className: cn({
|
|
113
|
+
theme: theme,
|
|
114
|
+
adaptive: isAdaptive
|
|
115
|
+
}, className)
|
|
116
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
117
|
+
className: cn('icon')
|
|
118
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
119
|
+
className: cn('text')
|
|
120
|
+
}, children));
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
PriceBadge.propTypes = {
|
|
124
|
+
isAdaptive: PropTypes.bool,
|
|
125
|
+
iconType: PropTypes.oneOf(Object.values(PriceBadgeIcon)),
|
|
126
|
+
theme: PropTypes.oneOf(Object.values(PriceBadgeTheme)),
|
|
127
|
+
className: PropTypes.string,
|
|
128
|
+
dataAttrs: PropTypes.shape({
|
|
129
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired).isRequired
|
|
130
|
+
}),
|
|
131
|
+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element, PropTypes.string]).isRequired
|
|
132
|
+
};
|
|
133
|
+
var _default = PriceBadge;
|
|
134
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.mfui-promo-badge {
|
|
2
|
+
display: -webkit-box;
|
|
3
|
+
display: -ms-flexbox;
|
|
4
|
+
display: flex;
|
|
5
|
+
-webkit-box-align: center;
|
|
6
|
+
-ms-flex-align: center;
|
|
7
|
+
align-items: center;
|
|
8
|
+
padding: 4px 12px;
|
|
9
|
+
width: -webkit-fit-content;
|
|
10
|
+
width: -moz-fit-content;
|
|
11
|
+
width: fit-content;
|
|
12
|
+
border-radius: 8px;
|
|
13
|
+
color: var(--base);
|
|
14
|
+
}
|
|
15
|
+
.mfui-promo-badge_type_hit {
|
|
16
|
+
background-color: var(--warmRedC);
|
|
17
|
+
}
|
|
18
|
+
.mfui-promo-badge_type_new {
|
|
19
|
+
background-color: var(--systemBlue);
|
|
20
|
+
}
|
|
21
|
+
.mfui-promo-badge_type_popular {
|
|
22
|
+
background-color: var(--137C);
|
|
23
|
+
}
|
|
24
|
+
.mfui-promo-badge_type_user-choice {
|
|
25
|
+
background-color: var(--reflexBlue);
|
|
26
|
+
}
|
|
27
|
+
.mfui-promo-badge__text {
|
|
28
|
+
font-family: inherit;
|
|
29
|
+
font-size: 12px;
|
|
30
|
+
line-height: 16px;
|
|
31
|
+
font-weight: 500;
|
|
32
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './PromoBadge.less';
|
|
3
|
+
export declare const PromoBadgeTypes: {
|
|
4
|
+
readonly HIT: "hit";
|
|
5
|
+
readonly NEW: "new";
|
|
6
|
+
readonly POPULAR: "popular";
|
|
7
|
+
readonly USER_CHOICE: "user-choice";
|
|
8
|
+
};
|
|
9
|
+
declare type PromoBadgeTypesType = typeof PromoBadgeTypes[keyof typeof PromoBadgeTypes];
|
|
10
|
+
export interface IPromoBadgeProps {
|
|
11
|
+
/** Тип промо-бэйджа */
|
|
12
|
+
type?: PromoBadgeTypesType;
|
|
13
|
+
/** Дополнительный класс корневого элемента */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** Дополнительные data-атрибуты к внутренним элементам */
|
|
16
|
+
dataAttrs?: {
|
|
17
|
+
root?: Record<string, string>;
|
|
18
|
+
};
|
|
19
|
+
children: JSX.Element[] | Element[] | JSX.Element | Element | string;
|
|
20
|
+
}
|
|
21
|
+
declare const PromoBadge: React.FC<IPromoBadgeProps>;
|
|
22
|
+
export default PromoBadge;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.PromoBadgeTypes = void 0;
|
|
9
|
+
|
|
10
|
+
require("core-js/modules/es.object.values");
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var React = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
var _uiHelpers = require("@megafon/ui-helpers");
|
|
17
|
+
|
|
18
|
+
var PropTypes = _interopRequireWildcard(require("prop-types"));
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
+
|
|
26
|
+
var PromoBadgeTypes = {
|
|
27
|
+
HIT: 'hit',
|
|
28
|
+
NEW: 'new',
|
|
29
|
+
POPULAR: 'popular',
|
|
30
|
+
USER_CHOICE: 'user-choice'
|
|
31
|
+
};
|
|
32
|
+
exports.PromoBadgeTypes = PromoBadgeTypes;
|
|
33
|
+
var cn = (0, _uiHelpers.cnCreate)('mfui-promo-badge');
|
|
34
|
+
|
|
35
|
+
var PromoBadge = function PromoBadge(_ref) {
|
|
36
|
+
var _ref$type = _ref.type,
|
|
37
|
+
type = _ref$type === void 0 ? 'hit' : _ref$type,
|
|
38
|
+
className = _ref.className,
|
|
39
|
+
children = _ref.children,
|
|
40
|
+
dataAttrs = _ref.dataAttrs;
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
42
|
+
className: cn({
|
|
43
|
+
type: type
|
|
44
|
+
}, className)
|
|
45
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
46
|
+
className: cn('text')
|
|
47
|
+
}, children));
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
PromoBadge.propTypes = {
|
|
51
|
+
type: PropTypes.oneOf(Object.values(PromoBadgeTypes)),
|
|
52
|
+
className: PropTypes.string,
|
|
53
|
+
dataAttrs: PropTypes.shape({
|
|
54
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
55
|
+
}),
|
|
56
|
+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element, PropTypes.string]).isRequired
|
|
57
|
+
};
|
|
58
|
+
var _default = PromoBadge;
|
|
59
|
+
exports["default"] = _default;
|
|
@@ -311,7 +311,10 @@ var Carousel = function Carousel(_ref) {
|
|
|
311
311
|
onFocus: handleSlideFocus(i),
|
|
312
312
|
onMouseDown: disableFocusOnSlideClick
|
|
313
313
|
}), child);
|
|
314
|
-
})), /*#__PURE__*/React.createElement(_NavArrow["default"],
|
|
314
|
+
})), /*#__PURE__*/React.createElement(_NavArrow["default"], {
|
|
315
|
+
dataAttrs: {
|
|
316
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.prev
|
|
317
|
+
},
|
|
315
318
|
className: cn('arrow', {
|
|
316
319
|
prev: true,
|
|
317
320
|
locked: isLocked
|
|
@@ -319,7 +322,10 @@ var Carousel = function Carousel(_ref) {
|
|
|
319
322
|
onClick: handlePrevClick,
|
|
320
323
|
disabled: !loop && isBeginning,
|
|
321
324
|
theme: _NavArrow.Theme.PURPLE
|
|
322
|
-
})
|
|
325
|
+
}), /*#__PURE__*/React.createElement(_NavArrow["default"], {
|
|
326
|
+
dataAttrs: {
|
|
327
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.next
|
|
328
|
+
},
|
|
323
329
|
className: cn('arrow', {
|
|
324
330
|
next: true,
|
|
325
331
|
locked: isLocked
|
|
@@ -328,7 +334,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
328
334
|
onClick: handleNextClick,
|
|
329
335
|
disabled: !loop && isEnd,
|
|
330
336
|
theme: _NavArrow.Theme.PURPLE
|
|
331
|
-
}))
|
|
337
|
+
}));
|
|
332
338
|
};
|
|
333
339
|
|
|
334
340
|
Carousel.propTypes = {
|
|
@@ -20,6 +20,8 @@ declare type ShadowType = typeof Shadow[keyof typeof Shadow];
|
|
|
20
20
|
export interface ITileProps {
|
|
21
21
|
/** Ссылка */
|
|
22
22
|
href?: string;
|
|
23
|
+
/** Атрибут для открытия ссылки */
|
|
24
|
+
target?: '_self' | '_blank';
|
|
23
25
|
/** Тема */
|
|
24
26
|
theme?: ThemeType;
|
|
25
27
|
/** Радиус границы */
|
|
@@ -49,7 +49,9 @@ var Tile = function Tile(_ref) {
|
|
|
49
49
|
_ref$isInteractive = _ref.isInteractive,
|
|
50
50
|
isInteractive = _ref$isInteractive === void 0 ? false : _ref$isInteractive,
|
|
51
51
|
onClick = _ref.onClick,
|
|
52
|
-
dataAttrs = _ref.dataAttrs
|
|
52
|
+
dataAttrs = _ref.dataAttrs,
|
|
53
|
+
_ref$target = _ref.target,
|
|
54
|
+
target = _ref$target === void 0 ? '_self' : _ref$target;
|
|
53
55
|
|
|
54
56
|
var handleClick = function handleClick(e) {
|
|
55
57
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
@@ -67,7 +69,8 @@ var Tile = function Tile(_ref) {
|
|
|
67
69
|
onClick: handleClick
|
|
68
70
|
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), href && /*#__PURE__*/_react["default"].createElement("a", {
|
|
69
71
|
href: href,
|
|
70
|
-
className: cn('link')
|
|
72
|
+
className: cn('link'),
|
|
73
|
+
target: target
|
|
71
74
|
}, children), !href && children);
|
|
72
75
|
};
|
|
73
76
|
|
|
@@ -81,7 +84,8 @@ Tile.propTypes = {
|
|
|
81
84
|
onClick: _propTypes["default"].func,
|
|
82
85
|
dataAttrs: _propTypes["default"].shape({
|
|
83
86
|
root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
|
|
84
|
-
})
|
|
87
|
+
}),
|
|
88
|
+
target: _propTypes["default"].oneOf(['_self', '_blank'])
|
|
85
89
|
};
|
|
86
90
|
var _default = Tile;
|
|
87
91
|
exports["default"] = _default;
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export { default as PaginationButtons } from './components/Pagination/components
|
|
|
28
28
|
export { default as PaginationNavigation } from './components/Pagination/components/PaginationNavigation/PaginationNavigation';
|
|
29
29
|
export { default as Paragraph } from './components/Paragraph/Paragraph';
|
|
30
30
|
export { default as Preloader } from './components/Preloader/Preloader';
|
|
31
|
+
export { default as PriceBadge } from './components/Badges/components/PriceBadge/PriceBadge';
|
|
32
|
+
export { default as PromoBadge } from './components/Badges/components/PromoBadge/PromoBadge';
|
|
31
33
|
export { default as RadioButton } from './components/RadioButton/RadioButton';
|
|
32
34
|
export { default as Search } from './components/Search/Search';
|
|
33
35
|
export { default as Select } from './components/Select/Select';
|
package/dist/lib/index.js
CHANGED
|
@@ -183,6 +183,18 @@ Object.defineProperty(exports, "Preloader", {
|
|
|
183
183
|
return _Preloader["default"];
|
|
184
184
|
}
|
|
185
185
|
});
|
|
186
|
+
Object.defineProperty(exports, "PriceBadge", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function get() {
|
|
189
|
+
return _PriceBadge["default"];
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(exports, "PromoBadge", {
|
|
193
|
+
enumerable: true,
|
|
194
|
+
get: function get() {
|
|
195
|
+
return _PromoBadge["default"];
|
|
196
|
+
}
|
|
197
|
+
});
|
|
186
198
|
Object.defineProperty(exports, "RadioButton", {
|
|
187
199
|
enumerable: true,
|
|
188
200
|
get: function get() {
|
|
@@ -316,6 +328,10 @@ var _Paragraph = _interopRequireDefault(require("./components/Paragraph/Paragrap
|
|
|
316
328
|
|
|
317
329
|
var _Preloader = _interopRequireDefault(require("./components/Preloader/Preloader"));
|
|
318
330
|
|
|
331
|
+
var _PriceBadge = _interopRequireDefault(require("./components/Badges/components/PriceBadge/PriceBadge"));
|
|
332
|
+
|
|
333
|
+
var _PromoBadge = _interopRequireDefault(require("./components/Badges/components/PromoBadge/PromoBadge"));
|
|
334
|
+
|
|
319
335
|
var _RadioButton = _interopRequireDefault(require("./components/RadioButton/RadioButton"));
|
|
320
336
|
|
|
321
337
|
var _Search = _interopRequireDefault(require("./components/Search/Search"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@megafon/ui-core",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"styles"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@babel/preset-env": "^7.8.6",
|
|
55
55
|
"@babel/preset-react": "^7.8.3",
|
|
56
56
|
"@babel/preset-typescript": "^7.8.3",
|
|
57
|
-
"@megafon/ui-icons": "^1.0
|
|
57
|
+
"@megafon/ui-icons": "^1.1.0",
|
|
58
58
|
"@svgr/core": "^2.4.1",
|
|
59
59
|
"@testing-library/react-hooks": "^7.0.1",
|
|
60
60
|
"@types/enzyme": "^3.10.5",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"dependencies": {
|
|
87
87
|
"@babel/runtime": "^7.8.4",
|
|
88
88
|
"@datepicker-react/hooks": "^2.7.0",
|
|
89
|
-
"@megafon/ui-helpers": "^2.0
|
|
89
|
+
"@megafon/ui-helpers": "^2.1.0",
|
|
90
90
|
"@popperjs/core": "^2.5.3",
|
|
91
91
|
"core-js": "^3.6.4",
|
|
92
92
|
"date-fns": "^2.16.1",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"react-popper": "^2.2.3",
|
|
98
98
|
"swiper": "^6.5.6"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "4ef906c6961b5da2721dcde19062766c4fe8ba84"
|
|
101
101
|
}
|