@megafon/ui-core 8.1.0 → 8.2.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/dist/es/components/Badges/StatusBadge/StatusBadge.css +1 -0
- package/dist/es/components/Badges/StatusBadge/StatusBadge.d.ts +39 -0
- package/dist/es/components/Badges/StatusBadge/StatusBadge.js +156 -0
- package/dist/es/components/ContentView/ContentView.css +1 -1
- package/dist/es/components/Search/Search.css +1 -1
- package/dist/es/components/Search/Search.d.ts +2 -0
- package/dist/es/components/Search/Search.js +6 -1
- package/dist/es/components/Sliders/SliderRatio/SliderRatio.css +1 -1
- package/dist/es/components/Tabs/Tabs.js +7 -3
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +1 -0
- package/dist/lib/components/Badges/StatusBadge/StatusBadge.css +1 -0
- package/dist/lib/components/Badges/StatusBadge/StatusBadge.d.ts +39 -0
- package/dist/lib/components/Badges/StatusBadge/StatusBadge.js +165 -0
- package/dist/lib/components/ContentView/ContentView.css +1 -1
- package/dist/lib/components/Search/Search.css +1 -1
- package/dist/lib/components/Search/Search.d.ts +2 -0
- package/dist/lib/components/Search/Search.js +6 -1
- package/dist/lib/components/Sliders/SliderRatio/SliderRatio.css +1 -1
- package/dist/lib/components/Tabs/Tabs.js +6 -2
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +7 -0
- package/package.json +3 -3
- package/styles/colors.css +1 -1
- package/dist/es/components/Avatar/i/placeholder.svg +0 -4
- package/dist/es/components/Search/i/textarea-resizer.svg +0 -4
- package/dist/es/components/Selector/i/check.svg +0 -3
- package/dist/es/components/TextField/i/textarea-resizer.svg +0 -4
- package/dist/es/components/UploadForm/UploadFileItem/components/_UploadFileItemIcon/i/attach.svg +0 -3
- package/dist/es/components/UploadForm/UploadFileItem/components/_UploadFileItemIcon/i/excel.svg +0 -25
- package/dist/es/components/UploadForm/UploadFileItem/components/_UploadFileItemIcon/i/image.svg +0 -3
- package/dist/es/components/UploadForm/UploadFileItem/components/_UploadFileItemIcon/i/pdf.svg +0 -4
- package/dist/es/components/UploadForm/UploadFileItem/components/_UploadFileItemIcon/i/power.svg +0 -21
- package/dist/es/components/UploadForm/UploadFileItem/components/_UploadFileItemIcon/i/word.svg +0 -22
- package/dist/lib/components/Avatar/i/placeholder.svg +0 -4
- package/dist/lib/components/Search/i/textarea-resizer.svg +0 -4
- package/dist/lib/components/Selector/i/check.svg +0 -3
- package/dist/lib/components/TextField/i/textarea-resizer.svg +0 -4
- package/dist/lib/components/UploadForm/UploadFileItem/components/_UploadFileItemIcon/i/attach.svg +0 -3
- package/dist/lib/components/UploadForm/UploadFileItem/components/_UploadFileItemIcon/i/excel.svg +0 -25
- package/dist/lib/components/UploadForm/UploadFileItem/components/_UploadFileItemIcon/i/image.svg +0 -3
- package/dist/lib/components/UploadForm/UploadFileItem/components/_UploadFileItemIcon/i/pdf.svg +0 -4
- package/dist/lib/components/UploadForm/UploadFileItem/components/_UploadFileItemIcon/i/power.svg +0 -21
- package/dist/lib/components/UploadForm/UploadFileItem/components/_UploadFileItemIcon/i/word.svg +0 -22
- /package/dist/es/components/ContentView/{i → img}/alarm.png +0 -0
- /package/dist/es/components/ContentView/{i → img}/empty.png +0 -0
- /package/dist/es/components/ContentView/{i → img}/error.png +0 -0
- /package/dist/es/components/ContentView/{i → img}/fail.png +0 -0
- /package/dist/es/components/ContentView/{i → img}/searchNoResult.png +0 -0
- /package/dist/es/components/ContentView/{i → img}/submit.png +0 -0
- /package/dist/es/components/ContentView/{i → img}/success.png +0 -0
- /package/dist/es/components/ContentView/{i → img}/update.png +0 -0
- /package/dist/es/components/ContentView/{i → img}/waiting.png +0 -0
- /package/dist/es/components/Sliders/SliderRatio/{i → img}/thumb.png +0 -0
- /package/dist/lib/components/ContentView/{i → img}/alarm.png +0 -0
- /package/dist/lib/components/ContentView/{i → img}/empty.png +0 -0
- /package/dist/lib/components/ContentView/{i → img}/error.png +0 -0
- /package/dist/lib/components/ContentView/{i → img}/fail.png +0 -0
- /package/dist/lib/components/ContentView/{i → img}/searchNoResult.png +0 -0
- /package/dist/lib/components/ContentView/{i → img}/submit.png +0 -0
- /package/dist/lib/components/ContentView/{i → img}/success.png +0 -0
- /package/dist/lib/components/ContentView/{i → img}/update.png +0 -0
- /package/dist/lib/components/ContentView/{i → img}/waiting.png +0 -0
- /package/dist/lib/components/Sliders/SliderRatio/{i → img}/thumb.png +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-status-badge__container{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:12px;line-height:18px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--content);font-weight:400;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.mfui-status-badge__text{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mfui-status-badge__arrow,.mfui-status-badge__icon{height:20px;width:20px}.mfui-status-badge__icon{margin-right:2px}@media screen and (min-width:1024px){.mfui-status-badge_adaptive .mfui-status-badge__container{font-size:15px;line-height:24px}}.mfui-status-badge_tooltip .mfui-status-badge__container{cursor:pointer}.mfui-status-badge__tooltip{width:288px}.mfui-status-badge_view_dot .mfui-status-badge__container{gap:8px}.mfui-status-badge_view_dot .mfui-status-badge__container:before{border-radius:50%;content:"";height:8px;width:8px}.mfui-status-badge_view_dot.mfui-status-badge_tooltip .mfui-status-badge__text{-webkit-text-decoration:underline dashed var(--spbSky3);text-decoration:underline dashed var(--spbSky3);text-decoration-thickness:1px;text-underline-offset:3px;-webkit-transition:-webkit-text-decoration .3s ease-out;transition:-webkit-text-decoration .3s ease-out;transition:text-decoration .3s ease-out;transition:text-decoration .3s ease-out,-webkit-text-decoration .3s ease-out}@media (pointer:fine){.mfui-status-badge_view_dot.mfui-status-badge_tooltip .mfui-status-badge__container:hover .mfui-status-badge__text{-webkit-text-decoration:underline dashed var(--content);text-decoration:underline dashed var(--content);text-decoration-thickness:1px}.mfui-status-badge_view_dot.mfui-status-badge_tooltip .mfui-status-badge__container:hover:before{-webkit-animation:pulse .8s ease-out;animation:pulse .8s ease-out}}@media screen and (min-width:1024px){.mfui-status-badge_view_dot.mfui-status-badge_adaptive.mfui-status-badge_tooltip .mfui-status-badge__text{text-underline-offset:5px}}.mfui-status-badge_view_dot.mfui-status-badge_theme_green .mfui-status-badge__container:before{background-color:var(--brandGreen)}.mfui-status-badge_view_dot.mfui-status-badge_theme_blue .mfui-status-badge__container:before{background-color:var(--sky)}.mfui-status-badge_view_dot.mfui-status-badge_theme_gray .mfui-status-badge__container:before{background-color:var(--spbSky3)}.mfui-status-badge_view_dot.mfui-status-badge_theme_orange .mfui-status-badge__container:before{background-color:var(--137C)}.mfui-status-badge_view_dot.mfui-status-badge_theme_red .mfui-status-badge__container:before{background-color:var(--fury)}.mfui-status-badge_view_icon .mfui-status-badge__container{border:1px solid var(--spbSky1);border-radius:8px;padding:1px 7px 1px 1px}.mfui-status-badge_view_icon .mfui-status-badge__arrow{rotate:180deg;-webkit-transition:rotate .3s ease-out,fill .3s ease-out;transition:rotate .3s ease-out,fill .3s ease-out;fill:var(--spbSky3)}.mfui-status-badge_view_icon.mfui-status-badge_opened .mfui-status-badge__arrow{rotate:1turn}@media (pointer:fine){.mfui-status-badge_view_icon .mfui-status-badge__container:hover .mfui-status-badge__arrow{fill:var(--content)}}.mfui-status-badge_view_icon.mfui-status-badge_tooltip .mfui-status-badge__container{padding-right:1px}@media screen and (min-width:1024px){.mfui-status-badge_view_icon.mfui-status-badge_adaptive .mfui-status-badge__container{padding:3px 10px 3px 5px}.mfui-status-badge_view_icon.mfui-status-badge_adaptive .mfui-status-badge__icon{margin-right:4px}.mfui-status-badge_view_icon.mfui-status-badge_adaptive .mfui-status-badge__text{margin-top:-1px}.mfui-status-badge_view_icon.mfui-status-badge_adaptive.mfui-status-badge_tooltip .mfui-status-badge__container{padding-right:5px}}.mfui-status-badge_view_icon.mfui-status-badge_theme_green .mfui-status-badge__icon{fill:var(--brandGreen)}.mfui-status-badge_view_icon.mfui-status-badge_theme_blue .mfui-status-badge__icon{fill:var(--sky)}.mfui-status-badge_view_icon.mfui-status-badge_theme_gray .mfui-status-badge__icon{fill:var(--spbSky3)}.mfui-status-badge_view_icon.mfui-status-badge_theme_orange .mfui-status-badge__icon{fill:var(--137C)}.mfui-status-badge_view_icon.mfui-status-badge_theme_red .mfui-status-badge__icon{fill:var(--fury)}@-webkit-keyframes pulse{0%{opacity:1;scale:1}30%{opacity:.7}50%{opacity:1;scale:1.3}70%{opacity:.7}to{opacity:1;scale:1}}@keyframes pulse{0%{opacity:1;scale:1}30%{opacity:.7}50%{opacity:1;scale:1.3}70%{opacity:.7}to{opacity:1;scale:1}}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Tooltip from '../../Tooltip/Tooltip';
|
|
3
|
+
import './StatusBadge.scss';
|
|
4
|
+
type TooltipPropsType = Pick<React.ComponentProps<typeof Tooltip>, 'title' | 'text' | 'buttonText' | 'placement' | 'isPortal' | 'portalSelector' | 'isHiddenResize' | 'onClick' | 'onOpen' | 'onClose' | 'onCloseButtonClick'>;
|
|
5
|
+
export interface IStatusBadgeProps {
|
|
6
|
+
/** Вид компонента */
|
|
7
|
+
view?: 'icon' | 'dot';
|
|
8
|
+
/** Тема компонента */
|
|
9
|
+
theme?: 'green' | 'blue' | 'gray' | 'orange' | 'red';
|
|
10
|
+
/** Тип иконки (для view = icon) */
|
|
11
|
+
iconType?: 'timer' | 'price' | 'checkInvert' | 'attention' | 'info' | 'profileFull';
|
|
12
|
+
/** Адаптивный режим */
|
|
13
|
+
isAdaptive?: boolean;
|
|
14
|
+
/** Тултип */
|
|
15
|
+
tooltip?: TooltipPropsType;
|
|
16
|
+
/** Дополнительный класс корневого элемента */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Дополнительные классы для внутренних элементов */
|
|
19
|
+
classes?: {
|
|
20
|
+
root?: string;
|
|
21
|
+
container?: string;
|
|
22
|
+
tooltip?: string;
|
|
23
|
+
tooltipButton?: string;
|
|
24
|
+
tooltipCloseButton?: string;
|
|
25
|
+
};
|
|
26
|
+
/** Дополнительные data-атрибуты к внутренним элементам */
|
|
27
|
+
dataAttrs?: {
|
|
28
|
+
root?: Record<string, string>;
|
|
29
|
+
container?: Record<string, string>;
|
|
30
|
+
icon?: Record<string, string>;
|
|
31
|
+
arrow?: Record<string, string>;
|
|
32
|
+
tooltip?: Record<string, string>;
|
|
33
|
+
tooltipButton?: Record<string, string>;
|
|
34
|
+
tooltipCloseButton?: Record<string, string>;
|
|
35
|
+
};
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
declare const StatusBadge: React.FC<IStatusBadgeProps>;
|
|
39
|
+
export default StatusBadge;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
5
|
+
import Tooltip from "../../Tooltip/Tooltip";
|
|
6
|
+
import "./StatusBadge.css";
|
|
7
|
+
var ProfileFullIcon = function ProfileFullIcon(props) {
|
|
8
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
9
|
+
viewBox: "0 0 20 20"
|
|
10
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
11
|
+
d: "M5.22 18h9.55L16 13.47A8.28 8.28 0 0010 11a8.302 8.302 0 00-6 2.5L5.22 18zM14 6a4 4 0 10-8 0 4 4 0 008 0z"
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
var ArrowIcon = function ArrowIcon(props) {
|
|
15
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
16
|
+
viewBox: "0 0 20 20"
|
|
17
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
18
|
+
d: "M13 12l-3-3-3 3-1-1 4-4 4 4z"
|
|
19
|
+
}));
|
|
20
|
+
};
|
|
21
|
+
var AttentionIcon = function AttentionIcon(props) {
|
|
22
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
23
|
+
viewBox: "0 0 20 20"
|
|
24
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
25
|
+
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"
|
|
26
|
+
}));
|
|
27
|
+
};
|
|
28
|
+
var CheckInvertIcon = function CheckInvertIcon(props) {
|
|
29
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
30
|
+
viewBox: "0 0 20 20"
|
|
31
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
32
|
+
fillRule: "evenodd",
|
|
33
|
+
clipRule: "evenodd",
|
|
34
|
+
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"
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
var InfoIcon = function InfoIcon(props) {
|
|
38
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
39
|
+
viewBox: "0 0 20 20"
|
|
40
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
41
|
+
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 5c.6 0 1-.4 1-1s-.4-1-1-1-1 .4-1 1 .4 1 1 1zm1 8V9H9v6h2z"
|
|
42
|
+
}));
|
|
43
|
+
};
|
|
44
|
+
var PriceIcon = function PriceIcon(props) {
|
|
45
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
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
|
+
var TimerIcon = function TimerIcon(props) {
|
|
54
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
55
|
+
viewBox: "0 0 20 20"
|
|
56
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
57
|
+
fillRule: "evenodd",
|
|
58
|
+
clipRule: "evenodd",
|
|
59
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm1-8.414V5H9v5.414l3 3L13.414 12 11 9.586z"
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
62
|
+
var statusIconsMap = {
|
|
63
|
+
attention: AttentionIcon,
|
|
64
|
+
checkInvert: CheckInvertIcon,
|
|
65
|
+
info: InfoIcon,
|
|
66
|
+
price: PriceIcon,
|
|
67
|
+
profileFull: ProfileFullIcon,
|
|
68
|
+
timer: TimerIcon
|
|
69
|
+
};
|
|
70
|
+
var cn = cnCreate('mfui-status-badge');
|
|
71
|
+
var StatusBadge = function StatusBadge(_ref) {
|
|
72
|
+
var _ref$view = _ref.view,
|
|
73
|
+
view = _ref$view === void 0 ? 'dot' : _ref$view,
|
|
74
|
+
_ref$theme = _ref.theme,
|
|
75
|
+
theme = _ref$theme === void 0 ? 'green' : _ref$theme,
|
|
76
|
+
_ref$isAdaptive = _ref.isAdaptive,
|
|
77
|
+
isAdaptive = _ref$isAdaptive === void 0 ? false : _ref$isAdaptive,
|
|
78
|
+
_ref$iconType = _ref.iconType,
|
|
79
|
+
iconType = _ref$iconType === void 0 ? 'timer' : _ref$iconType,
|
|
80
|
+
tooltip = _ref.tooltip,
|
|
81
|
+
children = _ref.children,
|
|
82
|
+
className = _ref.className,
|
|
83
|
+
classes = _ref.classes,
|
|
84
|
+
dataAttrs = _ref.dataAttrs;
|
|
85
|
+
var triggerRef = React.useRef(null);
|
|
86
|
+
var _React$useState = React.useState(false),
|
|
87
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
88
|
+
isOpened = _React$useState2[0],
|
|
89
|
+
setIsOpened = _React$useState2[1];
|
|
90
|
+
var showIcon = view === 'icon';
|
|
91
|
+
var showArrow = showIcon && !!tooltip;
|
|
92
|
+
var StatusIconElement = statusIconsMap[iconType];
|
|
93
|
+
var handleOpen = React.useCallback(function (e) {
|
|
94
|
+
var _a;
|
|
95
|
+
setIsOpened(true);
|
|
96
|
+
(_a = tooltip === null || tooltip === void 0 ? void 0 : tooltip.onOpen) === null || _a === void 0 ? void 0 : _a.call(tooltip, e);
|
|
97
|
+
}, [tooltip]);
|
|
98
|
+
var handleClose = React.useCallback(function (e) {
|
|
99
|
+
var _a;
|
|
100
|
+
setIsOpened(false);
|
|
101
|
+
(_a = tooltip === null || tooltip === void 0 ? void 0 : tooltip.onClose) === null || _a === void 0 ? void 0 : _a.call(tooltip, e);
|
|
102
|
+
}, [tooltip]);
|
|
103
|
+
var handleCloseButtonClick = React.useCallback(function (e) {
|
|
104
|
+
var _a;
|
|
105
|
+
setIsOpened(false);
|
|
106
|
+
(_a = tooltip === null || tooltip === void 0 ? void 0 : tooltip.onCloseButtonClick) === null || _a === void 0 ? void 0 : _a.call(tooltip, e);
|
|
107
|
+
}, [tooltip]);
|
|
108
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
109
|
+
className: cn({
|
|
110
|
+
view: view,
|
|
111
|
+
theme: theme,
|
|
112
|
+
adaptive: isAdaptive,
|
|
113
|
+
tooltip: !!tooltip,
|
|
114
|
+
opened: isOpened
|
|
115
|
+
}, [className, classes === null || classes === void 0 ? void 0 : classes.root])
|
|
116
|
+
}), /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.container), {
|
|
117
|
+
className: cn('container', [classes === null || classes === void 0 ? void 0 : classes.container]),
|
|
118
|
+
ref: triggerRef
|
|
119
|
+
}), showIcon && /*#__PURE__*/React.createElement(StatusIconElement, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.icon), {
|
|
120
|
+
className: cn('icon')
|
|
121
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
122
|
+
className: cn('text')
|
|
123
|
+
}, children), showArrow && /*#__PURE__*/React.createElement(ArrowIcon, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrow), {
|
|
124
|
+
className: cn('arrow')
|
|
125
|
+
}))), !!tooltip && /*#__PURE__*/React.createElement(Tooltip, {
|
|
126
|
+
className: cn('tooltip'),
|
|
127
|
+
title: tooltip.title,
|
|
128
|
+
text: tooltip.text,
|
|
129
|
+
buttonText: tooltip.buttonText,
|
|
130
|
+
isHiddenResize: tooltip.isHiddenResize,
|
|
131
|
+
isPortal: tooltip.isPortal,
|
|
132
|
+
portalSelector: tooltip.portalSelector,
|
|
133
|
+
triggerElement: triggerRef,
|
|
134
|
+
hasCloseButton: true,
|
|
135
|
+
placement: tooltip.placement || 'bottom',
|
|
136
|
+
fallbackPlacements: ['top', 'left', 'right'],
|
|
137
|
+
offset: "small",
|
|
138
|
+
triggerEvent: "click",
|
|
139
|
+
colorTheme: "blue",
|
|
140
|
+
onClick: tooltip.onClick,
|
|
141
|
+
onCloseButtonClick: handleCloseButtonClick,
|
|
142
|
+
onClose: handleClose,
|
|
143
|
+
onOpen: handleOpen,
|
|
144
|
+
dataAttrs: {
|
|
145
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.tooltip,
|
|
146
|
+
button: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.tooltipButton,
|
|
147
|
+
close: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.tooltipCloseButton
|
|
148
|
+
},
|
|
149
|
+
classes: {
|
|
150
|
+
root: classes === null || classes === void 0 ? void 0 : classes.tooltip,
|
|
151
|
+
button: classes === null || classes === void 0 ? void 0 : classes.tooltipButton,
|
|
152
|
+
close: classes === null || classes === void 0 ? void 0 : classes.tooltipCloseButton
|
|
153
|
+
}
|
|
154
|
+
}));
|
|
155
|
+
};
|
|
156
|
+
export default StatusBadge;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}.mfui-content-view{color:var(--content);min-width:240px;padding:0 16px;text-align:center}.mfui-content-view__image{max-width:144px}.mfui-content-view__bg-image,.mfui-content-view__image{display:inline-block;margin-bottom:24px;vertical-align:top}.mfui-content-view__bg-image{background-repeat:no-repeat;background-size:100%;height:144px;width:144px}.mfui-content-view__bg-image_type_waiting{background-image:url(
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-content-view{color:var(--content);min-width:240px;padding:0 16px;text-align:center}.mfui-content-view__image{max-width:144px}.mfui-content-view__bg-image,.mfui-content-view__image{display:inline-block;margin-bottom:24px;vertical-align:top}.mfui-content-view__bg-image{background-repeat:no-repeat;background-size:100%;height:144px;width:144px}.mfui-content-view__bg-image_type_waiting{background-image:url(img/waiting.png)}.mfui-content-view__bg-image_type_error{background-image:url(img/error.png)}.mfui-content-view__bg-image_type_submit{background-image:url(img/submit.png)}.mfui-content-view__bg-image_type_success{background-image:url(img/success.png)}.mfui-content-view__bg-image_type_fail{background-image:url(img/fail.png)}.mfui-content-view__bg-image_type_update{background-image:url(img/update.png)}.mfui-content-view__bg-image_type_alarm{background-image:url(img/alarm.png)}.mfui-content-view__bg-image_type_empty{background-image:url(img/empty.png)}.mfui-content-view__bg-image_type_searchNoResult{background-image:url(img/searchNoResult.png)}.mfui-content-view__title{font-size:18px;font-weight:500;line-height:24px}@media screen and (min-width:768px){.mfui-content-view__title{font-size:20px;letter-spacing:.5px;line-height:28px}}.mfui-content-view__text{font-size:15px;font-weight:400;line-height:24px;margin-top:4px}.mfui-content-view__buttons{gap:12px;padding-top:32px}.mfui-content-view__buttons,.mfui-content-view_fullscreen{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-content-view_fullscreen{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;min-height:100%}.mfui-content-view_fullscreen .mfui-content-view__content{margin-top:auto}.mfui-content-view_fullscreen .mfui-content-view__buttons{margin-top:auto;padding-bottom:24px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}@-webkit-keyframes listAppear{0%{opacity:0;-webkit-transform:translateY(-25px);transform:translateY(-25px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes listAppear{0%{opacity:0;-webkit-transform:translateY(-25px);transform:translateY(-25px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.mfui-search{-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--content);font-family:inherit;font-size:15px;line-height:24px;min-height:40px;position:relative;z-index:auto}.mfui-search__require-mark{color:var(--fury);font-size:20px;line-height:0;margin-left:1px}.mfui-search__control{border:1px solid;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;outline:none;position:relative;-webkit-transition:border-color .3s;transition:border-color .3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;z-index:1}.mfui-search__field_labeled::-webkit-input-placeholder{color:var(--spbSky3);opacity:0;-webkit-transition:opacity .2s;transition:opacity .2s}.mfui-search__field_labeled::-moz-placeholder{color:var(--spbSky3);opacity:0;-moz-transition:opacity .2s;transition:opacity .2s}.mfui-search__field_labeled:-ms-input-placeholder{color:var(--spbSky3);opacity:0;-ms-transition:opacity .2s;transition:opacity .2s}.mfui-search__field_labeled::-ms-input-placeholder{color:var(--spbSky3);opacity:0;-ms-transition:opacity .2s;transition:opacity .2s}.mfui-search__field_labeled::placeholder{color:var(--spbSky3);opacity:0;-webkit-transition:opacity .2s;transition:opacity .2s}.mfui-search__field:focus::-webkit-input-placeholder{opacity:1}.mfui-search__field:focus::-moz-placeholder{opacity:1}.mfui-search__field:focus:-ms-input-placeholder{opacity:1}.mfui-search__field:focus::-ms-input-placeholder{opacity:1}.mfui-search__field:focus::placeholder{opacity:1}.mfui-search__field{display:block;position:relative;z-index:1;-webkit-box-flex:1;-ms-flex-positive:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;border-radius:0;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;caret-color:var(--brandGreen);color:var(--content);cursor:text;flex-grow:1;font-family:inherit;font-size:100%;height:100%;line-height:24px;opacity:1;outline:none;overflow:auto;padding:0;resize:none;width:100%}@media screen and (max-width:767px){.mfui-search__field{width:90%}}.mfui-search__label{color:var(--spbSky3);display:block;font-family:inherit;font-size:15px;line-height:24px;overflow:auto;pointer-events:none;position:absolute;-webkit-transition:scale .5s,top .01s,-webkit-transform .5s;transition:scale .5s,top .01s,-webkit-transform .5s;transition:transform .5s,scale .5s,top .01s;transition:transform .5s,scale .5s,top .01s,-webkit-transform .5s;z-index:1}.mfui-search__list{background-color:var(--base);border-radius:12px;-webkit-box-shadow:0 4px 12px rgba(0,0,0,.08);box-shadow:0 4px 12px rgba(0,0,0,.08);display:none;left:-1px;position:absolute;right:-1px;top:calc(100% + 1px);z-index:0}.mfui-search__clear,.mfui-search__submit-button{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;background-color:transparent;border:none;cursor:pointer;height:100%;justify-content:center;padding:0;text-align:center}.mfui-search__list-inner{-webkit-box-sizing:border-box;box-sizing:border-box;max-height:368px;overflow-y:auto;padding:16px}.mfui-search__list-item{background-color:var(--base);border-radius:16px;cursor:pointer;font-family:inherit;padding-bottom:12px;padding-top:12px}.mfui-search__list-item_paddings_large{padding-left:32px;padding-right:32px}.mfui-search__list-item_paddings_small{padding-left:12px;padding-right:12px}.mfui-search__popular-item{background-color:var(--base);border-radius:16px;cursor:pointer;min-height:48px;padding-left:12px;padding-right:16px;text-decoration:none}.mfui-search__popular-icon,.mfui-search__popular-item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-search__popular-icon{-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:center;-ms-flex-pack:center;height:32px;justify-content:center;margin-right:16px;width:32px}.mfui-search__list-item_active,.mfui-search__popular-item_active{background-color:var(--spbSky0)}.mfui-search__item-title,.mfui-search__popular-item-title{position:relative;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:hidden;white-space:nowrap}.mfui-search__item-title:after,.mfui-search__popular-item-title:after{background:var(--base);bottom:0;content:"";-webkit-mask-image:-webkit-gradient(linear,left top,right top,from(hsla(0,0%,100%,0)),to(var(--base)));-webkit-mask-image:linear-gradient(to right,hsla(0,0%,100%,0) 0,var(--base) 100%);mask-image:-webkit-gradient(linear,left top,right top,from(hsla(0,0%,100%,0)),to(var(--spbSky0)));mask-image:linear-gradient(to right,hsla(0,0%,100%,0) 0,var(--spbSky0) 100%);position:absolute;right:0;top:0;width:40px}.mfui-search__list-item_active .mfui-search__item-title:after,.mfui-search__popular-item_active .mfui-search__popular-item-title:after{background:var(--spbSky0);-webkit-mask-image:-webkit-gradient(linear,left top,right top,from(hsla(0,0%,100%,0)),to(var(--spbSky0)));-webkit-mask-image:linear-gradient(to right,hsla(0,0%,100%,0) 0,var(--spbSky0) 100%);mask-image:-webkit-gradient(linear,left top,right top,from(hsla(0,0%,100%,0)),to(var(--spbSky0)));mask-image:linear-gradient(to right,hsla(0,0%,100%,0) 0,var(--spbSky0) 100%)}.mfui-search__highlighted-fragment{font-weight:700}.mfui-search__notice{font-size:12px;line-height:16px;margin-top:4px}.mfui-search__notice_error{color:var(--fury)}.mfui-search__notice_success{color:var(--brandGreen)}.mfui-search__icons{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%}.mfui-search__list_not-found{cursor:default}.mfui-search__not-found-text{background-color:var(--base);color:var(--spbSky3);font-family:inherit;padding:12px 32px}.mfui-search__not-found-text_show-popular{border-bottom:1px solid var(--spbSky2);padding:0 0 16px}.mfui-search__popular-title{padding-bottom:8px;padding-top:16px}.mfui-search_open{z-index:12}.mfui-search_open .mfui-search__list{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-name:listAppear;animation-name:listAppear;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;display:block}.mfui-search_type_textfield .mfui-search__control{background-color:var(--base);border-color:var(--spbSky2);border-radius:12px;height:60px;padding:0 16px}.mfui-search_type_textfield .mfui-search__control:hover,.mfui-search_type_textfield .mfui-search__control_focused{border-color:var(--content)}.mfui-search_type_textfield .mfui-search__label{top:17px}.mfui-search_type_textfield .mfui-search__field:focus+.mfui-search__label,.mfui-search_type_textfield .mfui-search__field_filled+.mfui-search__label{-webkit-transform:scale(.8) translate(-12.5%,-75%);transform:scale(.8) translate(-12.5%,-75%);-webkit-transition:scale .2s,top .01s,-webkit-transform .2s;transition:scale .2s,top .01s,-webkit-transform .2s;transition:transform .2s,scale .2s,top .01s;transition:transform .2s,scale .2s,top .01s,-webkit-transform .2s}.mfui-search_type_textfield .mfui-search__field_labeled{padding-bottom:9px;padding-top:25px}.mfui-search_type_textfield .mfui-search__submit-icon{height:32px;width:32px;fill:var(--content)}.mfui-search_textarea .mfui-search__control{height:auto;min-height:60px}.mfui-search_textarea .mfui-search__field{-webkit-box-sizing:content-box;box-sizing:content-box;max-height:204px;padding-bottom:9px;padding-top:17px;scrollbar-color:var(--spbSky2) transparent;scrollbar-width:thin}.mfui-search_textarea .mfui-search__field_labeled{padding-bottom:9px;padding-top:25px}.mfui-search_textarea .mfui-search__icons{height:58px;margin-left:8px}.mfui-search_textarea .mfui-search__field_resized{-webkit-transition:height .1s;transition:height .1s;will-change:height}.mfui-search__textarea-wrapper{position:relative;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:hidden;width:100%}.mfui-search_type_textfield.mfui-search_disabled .mfui-search__control{background-color:var(--spbSky1);border-color:var(--spbSky1)}.mfui-search_type_textfield.mfui-search_disabled .mfui-search__submit-icon{opacity:.5;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mfui-search_type_compact .mfui-search__control{background-color:var(--spbSky0);border-color:var(--spbSky0);border-radius:24px;height:40px;padding:0 12px;-webkit-transition:background-color,border-color .3s;transition:background-color,border-color .3s}.mfui-search_type_compact .mfui-search__control:hover{background-color:var(--spbSky1)}.mfui-search_type_compact .mfui-search__field{height:100%;padding:8px 0 8px 12px}.mfui-search_type_compact .mfui-search__label{left:44px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.mfui-search_type_compact .mfui-search__field:focus+.mfui-search__label,.mfui-search_type_compact .mfui-search__field_filled+.mfui-search__label{opacity:0}.mfui-search_type_compact .mfui-search__submit-icon{height:20px;width:20px;fill:var(--spbSky3)}.mfui-search_type_compact .mfui-search__clear{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;background-color:transparent;border:none;cursor:pointer;height:24px;justify-content:center;margin-left:12px;padding:0;width:24px}.mfui-search_type_compact .mfui-search__clear-icon{height:24px;width:24px;fill:var(--spbSky3)}.mfui-search_type_compact .mfui-search__clear-icon:hover{fill:var(--content)}.mfui-search_type_compact .mfui-search__clear-icon:active{fill:var(--buttonDown)}.mfui-search_type_compact.mfui-search_open .mfui-search__control{background-color:var(--spbSky1)}.mfui-search_type_compact.mfui-search_open .mfui-search__submit-icon{fill:var(--content)}.mfui-search_disabled .mfui-search__control{cursor:default;pointer-events:none}.mfui-search_disabled .mfui-search__submit-icon{opacity:.5;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mfui-search_error .mfui-search__control{border-color:var(--fury)}.mfui-search_success .mfui-search__control{border-color:var(--brandGreen)}.mfui-search__resizer{bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;right:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-sizing:content-box;box-sizing:content-box;cursor:ns-resize;height:12px;justify-content:center;padding:4px;width:12px}.mfui-search__resizer svg{-webkit-transition:stroke .3s;transition:stroke .3s;stroke:var(--spbSky2)}.mfui-search__resizer:active svg,.mfui-search__resizer:hover svg{stroke:var(--spbSky3)}
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}@-webkit-keyframes listAppear{0%{opacity:0;-webkit-transform:translateY(-25px);transform:translateY(-25px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes listAppear{0%{opacity:0;-webkit-transform:translateY(-25px);transform:translateY(-25px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.mfui-search{-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--content);font-family:inherit;font-size:15px;line-height:24px;min-height:40px;position:relative;z-index:auto}.mfui-search__require-mark{color:var(--fury);font-size:20px;line-height:0;margin-left:1px}.mfui-search__control{border:1px solid;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;outline:none;position:relative;-webkit-transition:border-color .3s;transition:border-color .3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;z-index:1}.mfui-search__field_labeled::-webkit-input-placeholder{color:var(--spbSky3);opacity:0;-webkit-transition:opacity .2s;transition:opacity .2s}.mfui-search__field_labeled::-moz-placeholder{color:var(--spbSky3);opacity:0;-moz-transition:opacity .2s;transition:opacity .2s}.mfui-search__field_labeled:-ms-input-placeholder{color:var(--spbSky3);opacity:0;-ms-transition:opacity .2s;transition:opacity .2s}.mfui-search__field_labeled::-ms-input-placeholder{color:var(--spbSky3);opacity:0;-ms-transition:opacity .2s;transition:opacity .2s}.mfui-search__field_labeled::placeholder{color:var(--spbSky3);opacity:0;-webkit-transition:opacity .2s;transition:opacity .2s}.mfui-search__field:focus::-webkit-input-placeholder{opacity:1}.mfui-search__field:focus::-moz-placeholder{opacity:1}.mfui-search__field:focus:-ms-input-placeholder{opacity:1}.mfui-search__field:focus::-ms-input-placeholder{opacity:1}.mfui-search__field:focus::placeholder{opacity:1}.mfui-search__field{display:block;position:relative;z-index:1;-webkit-box-flex:1;-ms-flex-positive:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;border-radius:0;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;caret-color:var(--brandGreen);color:var(--content);cursor:text;flex-grow:1;font-family:inherit;font-size:100%;height:100%;line-height:24px;opacity:1;outline:none;overflow:auto;padding:0;resize:none;width:100%}@media screen and (max-width:767px){.mfui-search__field{width:90%}}.mfui-search__label{color:var(--spbSky3);display:block;font-family:inherit;font-size:15px;line-height:24px;overflow:auto;pointer-events:none;position:absolute;-webkit-transition:scale .5s,top .01s,-webkit-transform .5s;transition:scale .5s,top .01s,-webkit-transform .5s;transition:transform .5s,scale .5s,top .01s;transition:transform .5s,scale .5s,top .01s,-webkit-transform .5s;z-index:1}.mfui-search__list{background-color:var(--base);border-radius:12px;-webkit-box-shadow:0 4px 12px rgba(0,0,0,.08);box-shadow:0 4px 12px rgba(0,0,0,.08);display:none;left:-1px;position:absolute;right:-1px;top:calc(100% + 1px);z-index:0}.mfui-search__clear,.mfui-search__submit-button{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;background-color:transparent;border:none;cursor:pointer;height:100%;justify-content:center;padding:0;text-align:center}.mfui-search__list-inner{-webkit-box-sizing:border-box;box-sizing:border-box;max-height:368px;overflow-y:auto;padding:16px;scrollbar-width:none}.mfui-search__list-inner::-webkit-scrollbar{display:none}.mfui-search__list-item{background-color:var(--base);border-radius:16px;cursor:pointer;font-family:inherit;padding-bottom:12px;padding-top:12px}.mfui-search__list-item_paddings_large{padding-left:32px;padding-right:32px}.mfui-search__list-item_paddings_small{padding-left:12px;padding-right:12px}.mfui-search__popular-item{background-color:var(--base);border-radius:16px;cursor:pointer;min-height:48px;padding-left:12px;padding-right:16px;text-decoration:none}.mfui-search__popular-icon,.mfui-search__popular-item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-search__popular-icon{-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:center;-ms-flex-pack:center;height:32px;justify-content:center;margin-right:16px;width:32px}.mfui-search__list-item_active,.mfui-search__popular-item_active{background-color:var(--spbSky0)}.mfui-search__item-title,.mfui-search__popular-item-title{position:relative;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:hidden;white-space:nowrap}.mfui-search__item-title:after,.mfui-search__popular-item-title:after{background:var(--base);bottom:0;content:"";-webkit-mask-image:-webkit-gradient(linear,left top,right top,from(hsla(0,0%,100%,0)),to(var(--base)));-webkit-mask-image:linear-gradient(to right,hsla(0,0%,100%,0) 0,var(--base) 100%);mask-image:-webkit-gradient(linear,left top,right top,from(hsla(0,0%,100%,0)),to(var(--spbSky0)));mask-image:linear-gradient(to right,hsla(0,0%,100%,0) 0,var(--spbSky0) 100%);position:absolute;right:0;top:0;width:40px}.mfui-search__list-item_active .mfui-search__item-title:after,.mfui-search__popular-item_active .mfui-search__popular-item-title:after{background:var(--spbSky0);-webkit-mask-image:-webkit-gradient(linear,left top,right top,from(hsla(0,0%,100%,0)),to(var(--spbSky0)));-webkit-mask-image:linear-gradient(to right,hsla(0,0%,100%,0) 0,var(--spbSky0) 100%);mask-image:-webkit-gradient(linear,left top,right top,from(hsla(0,0%,100%,0)),to(var(--spbSky0)));mask-image:linear-gradient(to right,hsla(0,0%,100%,0) 0,var(--spbSky0) 100%)}.mfui-search__highlighted-fragment{font-weight:700}.mfui-search__notice{font-size:12px;line-height:16px;margin-top:4px}.mfui-search__notice_error{color:var(--fury)}.mfui-search__notice_success{color:var(--brandGreen)}.mfui-search__icons{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%}.mfui-search__list_not-found{cursor:default}.mfui-search__not-found-text{background-color:var(--base);color:var(--spbSky3);font-family:inherit;padding:12px 32px}.mfui-search__not-found-text_show-popular{border-bottom:1px solid var(--spbSky2);padding:0 0 16px}.mfui-search__popular-title{padding-bottom:8px;padding-top:16px}.mfui-search_open{z-index:12}.mfui-search_open .mfui-search__list{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-name:listAppear;animation-name:listAppear;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;display:block}.mfui-search_type_textfield .mfui-search__control{background-color:var(--base);border-color:var(--spbSky2);border-radius:12px;height:60px;padding:0 16px}.mfui-search_type_textfield .mfui-search__control:hover,.mfui-search_type_textfield .mfui-search__control_focused{border-color:var(--content)}.mfui-search_type_textfield .mfui-search__label{top:17px}.mfui-search_type_textfield .mfui-search__field:focus+.mfui-search__label,.mfui-search_type_textfield .mfui-search__field_filled+.mfui-search__label{-webkit-transform:scale(.8) translate(-12.5%,-75%);transform:scale(.8) translate(-12.5%,-75%);-webkit-transition:scale .2s,top .01s,-webkit-transform .2s;transition:scale .2s,top .01s,-webkit-transform .2s;transition:transform .2s,scale .2s,top .01s;transition:transform .2s,scale .2s,top .01s,-webkit-transform .2s}.mfui-search_type_textfield .mfui-search__field_labeled{padding-bottom:9px;padding-top:25px}.mfui-search_type_textfield .mfui-search__submit-icon{height:32px;width:32px;fill:var(--content)}.mfui-search_textarea .mfui-search__control{height:auto;min-height:60px}.mfui-search_textarea .mfui-search__field{-webkit-box-sizing:content-box;box-sizing:content-box;max-height:204px;padding-bottom:9px;padding-top:17px;scrollbar-color:var(--spbSky2) transparent;scrollbar-width:thin}.mfui-search_textarea .mfui-search__field_labeled{padding-bottom:9px;padding-top:25px}.mfui-search_textarea .mfui-search__icons{height:58px;margin-left:8px}.mfui-search_textarea .mfui-search__field_resized{-webkit-transition:height .1s;transition:height .1s;will-change:height}.mfui-search__textarea-wrapper{position:relative;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:hidden;width:100%}.mfui-search_type_textfield.mfui-search_disabled .mfui-search__control{background-color:var(--spbSky1);border-color:var(--spbSky1)}.mfui-search_type_textfield.mfui-search_disabled .mfui-search__submit-icon{opacity:.5;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mfui-search_type_compact .mfui-search__control{background-color:var(--spbSky0);border-color:var(--spbSky0);border-radius:24px;height:40px;padding:0 12px;-webkit-transition:background-color,border-color .3s;transition:background-color,border-color .3s}.mfui-search_type_compact .mfui-search__control:hover{background-color:var(--spbSky1)}.mfui-search_type_compact .mfui-search__field{height:100%;padding:8px 0 8px 12px}.mfui-search_type_compact .mfui-search__label{left:44px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.mfui-search_type_compact .mfui-search__field:focus+.mfui-search__label,.mfui-search_type_compact .mfui-search__field_filled+.mfui-search__label{opacity:0}.mfui-search_type_compact .mfui-search__submit-icon{height:20px;width:20px;fill:var(--spbSky3)}.mfui-search_type_compact .mfui-search__clear{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;background-color:transparent;border:none;cursor:pointer;height:24px;justify-content:center;margin-left:12px;padding:0;width:24px}.mfui-search_type_compact .mfui-search__clear-icon{height:24px;width:24px;fill:var(--spbSky3)}.mfui-search_type_compact .mfui-search__clear-icon:hover{fill:var(--content)}.mfui-search_type_compact .mfui-search__clear-icon:active{fill:var(--buttonDown)}.mfui-search_type_compact.mfui-search_open .mfui-search__control{background-color:var(--spbSky1)}.mfui-search_type_compact.mfui-search_open .mfui-search__submit-icon{fill:var(--content)}.mfui-search_disabled .mfui-search__control{cursor:default;pointer-events:none}.mfui-search_disabled .mfui-search__submit-icon{opacity:.5;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mfui-search_error .mfui-search__control{border-color:var(--fury)}.mfui-search_success .mfui-search__control{border-color:var(--brandGreen)}.mfui-search__resizer{bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;right:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-sizing:content-box;box-sizing:content-box;cursor:ns-resize;height:12px;justify-content:center;padding:4px;width:12px}.mfui-search__resizer svg{-webkit-transition:stroke .3s;transition:stroke .3s;stroke:var(--spbSky2)}.mfui-search__resizer:active svg,.mfui-search__resizer:hover svg{stroke:var(--spbSky3)}
|
|
@@ -70,6 +70,8 @@ export interface ISearchProps {
|
|
|
70
70
|
noticeText?: string | JSX.Element;
|
|
71
71
|
/** Максимальное вводимое количество текста */
|
|
72
72
|
maxLength?: number;
|
|
73
|
+
/** Максимальная высота для скролла */
|
|
74
|
+
maxHeightScrollBar?: number;
|
|
73
75
|
/** Отключение поля ввода */
|
|
74
76
|
disabled?: boolean;
|
|
75
77
|
/** Делает поле обязательным */
|
|
@@ -17,6 +17,7 @@ import throttleTime from "../../constants/throttleTime";
|
|
|
17
17
|
import Caption from "../Caption/Caption";
|
|
18
18
|
import Header from "../Header/Header";
|
|
19
19
|
import Preloader from "../Preloader/Preloader";
|
|
20
|
+
import ScrollBar from "../ScrollBar/ScrollBar";
|
|
20
21
|
import "./Search.css";
|
|
21
22
|
var SearchIcon16 = function SearchIcon16(props) {
|
|
22
23
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
@@ -86,6 +87,8 @@ var Search = function Search(_ref) {
|
|
|
86
87
|
required = _ref.required,
|
|
87
88
|
noticeText = _ref.noticeText,
|
|
88
89
|
maxLength = _ref.maxLength,
|
|
90
|
+
_ref$maxHeightScrollB = _ref.maxHeightScrollBar,
|
|
91
|
+
maxHeightScrollBar = _ref$maxHeightScrollB === void 0 ? 350 : _ref$maxHeightScrollB,
|
|
89
92
|
className = _ref.className,
|
|
90
93
|
classes = _ref.classes,
|
|
91
94
|
_ref$type = _ref.type,
|
|
@@ -425,6 +428,8 @@ var Search = function Search(_ref) {
|
|
|
425
428
|
ref: listRef
|
|
426
429
|
}, /*#__PURE__*/React.createElement("div", {
|
|
427
430
|
className: cn('list-inner', [classes === null || classes === void 0 ? void 0 : classes.listInner])
|
|
431
|
+
}, /*#__PURE__*/React.createElement(ScrollBar, {
|
|
432
|
+
maxHeight: maxHeightScrollBar
|
|
428
433
|
}, items.map(function (_ref2, i) {
|
|
429
434
|
var itemValue = _ref2.value,
|
|
430
435
|
searchView = _ref2.searchView,
|
|
@@ -442,7 +447,7 @@ var Search = function Search(_ref) {
|
|
|
442
447
|
}), /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.itemTitle, i + 1), {
|
|
443
448
|
className: cn('item-title', [classes === null || classes === void 0 ? void 0 : classes.listItemTitle])
|
|
444
449
|
}), searchView || highlightString(itemValue)));
|
|
445
|
-
})));
|
|
450
|
+
}))));
|
|
446
451
|
};
|
|
447
452
|
var renderPopularItems = function renderPopularItems() {
|
|
448
453
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}.mfui-slider-ratio{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.mfui-slider-ratio__head{font-size:15px;font-weight:500;line-height:24px;margin-bottom:8px}.mfui-slider-ratio__display-values{display:grid;grid-template-columns:45% 45%;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-top:8px;width:100%}.mfui-slider-ratio__range-container{position:relative;width:100%}.mfui-slider-ratio__range-input{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--brandPurple);background-image:-webkit-gradient(linear,left top,left bottom,from(var(--brandGreen)),to(var(--brandGreen)));background-image:linear-gradient(var(--brandGreen),var(--brandGreen));background-repeat:no-repeat;border-radius:100px;cursor:pointer;display:block;height:12px;margin:6px 0;outline:none;pointer-events:none;position:relative;width:100%;z-index:1}.mfui-slider-ratio__range-input:focus{outline:none}.mfui-slider-ratio__range-input::-webkit-slider-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-image:url(
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-slider-ratio{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.mfui-slider-ratio__head{font-size:15px;font-weight:500;line-height:24px;margin-bottom:8px}.mfui-slider-ratio__display-values{display:grid;grid-template-columns:45% 45%;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-top:8px;width:100%}.mfui-slider-ratio__range-container{position:relative;width:100%}.mfui-slider-ratio__range-input{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--brandPurple);background-image:-webkit-gradient(linear,left top,left bottom,from(var(--brandGreen)),to(var(--brandGreen)));background-image:linear-gradient(var(--brandGreen),var(--brandGreen));background-repeat:no-repeat;border-radius:100px;cursor:pointer;display:block;height:12px;margin:6px 0;outline:none;pointer-events:none;position:relative;width:100%;z-index:1}.mfui-slider-ratio__range-input:focus{outline:none}.mfui-slider-ratio__range-input::-webkit-slider-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-image:url(img/thumb.png);background-repeat:no-repeat;background-size:100% 100%;border:none;border-radius:50%;-webkit-box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:0 2px 6px rgba(0,0,0,.16);height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-ratio__range-input::-moz-range-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-image:url(img/thumb.png);background-repeat:no-repeat;background-size:100% 100%;border:none;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-ratio__range-input::-ms-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-image:url(img/thumb.png);background-repeat:no-repeat;background-size:100% 100%;border:none;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-ratio__range-input::-webkit-slider-runnable-track{-webkit-appearance:none;background:transparent;border:none;-webkit-box-shadow:none;box-shadow:none}.mfui-slider-ratio__range-input::-moz-range-track{-webkit-appearance:none;background:transparent;border:none;box-shadow:none}.mfui-slider-ratio__range-input::-ms-track{-webkit-appearance:none;background:transparent;border:none;box-shadow:none}.mfui-slider-ratio__range-track{cursor:pointer;height:100%;position:absolute;top:0;width:100%;z-index:0}.mfui-slider-ratio__scale{bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;left:calc(var(--thumbSize)/2);position:absolute;right:calc(var(--thumbSize)/2);top:0;z-index:2;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;pointer-events:none}.mfui-slider-ratio__scale-item{background-color:var(--stcWhite);border-radius:50%;height:4px;width:4px}.mfui-slider-ratio__scale-item:first-child{margin-left:-2px}.mfui-slider-ratio__scale-item:last-child{margin-right:-2px}.mfui-slider-ratio_disabled .mfui-slider-ratio__head{color:var(--spbSky3)}.mfui-slider-ratio_disabled .mfui-slider-ratio__range-input{background-color:var(--spbSky1);background-image:-webkit-gradient(linear,left top,left bottom,from(var(--spbSky0)),to(var(--spbSky0)));background-image:linear-gradient(var(--spbSky0),var(--spbSky0));cursor:default}.mfui-slider-ratio_disabled .mfui-slider-ratio__range-input::-webkit-slider-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-color:var(--spbSky2);background-image:url(img/thumb.png);background-image:none;background-repeat:no-repeat;background-size:100% 100%;border:none;border-radius:50%;-webkit-box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:0 2px 6px rgba(0,0,0,.16);-webkit-box-shadow:none;box-shadow:none;height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-ratio_disabled .mfui-slider-ratio__range-input::-moz-range-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-color:var(--spbSky2);background-image:url(img/thumb.png);background-image:none;background-repeat:no-repeat;background-size:100% 100%;border:none;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:none;height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-ratio_disabled .mfui-slider-ratio__range-input::-ms-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-color:var(--spbSky2);background-image:url(img/thumb.png);background-image:none;background-repeat:no-repeat;background-size:100% 100%;border:none;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:none;height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-ratio_disabled .mfui-slider-ratio__range-track{cursor:default}.mfui-slider-ratio_disabled .mfui-slider-ratio__scale{display:none}
|
|
@@ -12,7 +12,7 @@ import "core-js/modules/es.regexp.sticky.js";
|
|
|
12
12
|
import "core-js/modules/web.dom-collections.for-each.js";
|
|
13
13
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
14
14
|
import * as React from 'react';
|
|
15
|
-
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
15
|
+
import { breakpoints, cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
16
16
|
import throttle from 'lodash.throttle';
|
|
17
17
|
import usePrevious from "../../hooks/usePrevious";
|
|
18
18
|
import NotificationBadge from "../Badges/NotificationBadge/NotificationBadge";
|
|
@@ -33,7 +33,7 @@ try {
|
|
|
33
33
|
SwiperSlide = SwiperAll.SwiperSlide;
|
|
34
34
|
} catch (e) {
|
|
35
35
|
// eslint-disable-next-line no-console
|
|
36
|
-
console.warn("\n WARNING: megafon/ui-core is using the latest version of swiper
|
|
36
|
+
console.warn("\n WARNING: megafon/ui-core is using the latest version of swiper.\n For more information about server-side rendering\n please check the Tabs component documentation at:\n https://ui.megafon.ru/components/tabs\n ");
|
|
37
37
|
}
|
|
38
38
|
export var TabAlign = {
|
|
39
39
|
LEFT: 'left',
|
|
@@ -219,7 +219,11 @@ var Tabs = function Tabs(_ref) {
|
|
|
219
219
|
if (outerIndex === undefined) {
|
|
220
220
|
setInnerIndex(index);
|
|
221
221
|
}
|
|
222
|
-
|
|
222
|
+
if (index > 0 && window.innerWidth > breakpoints.MOBILE_BIG_END) {
|
|
223
|
+
swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.slideTo(index - 1);
|
|
224
|
+
} else {
|
|
225
|
+
swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.slideTo(index);
|
|
226
|
+
}
|
|
223
227
|
};
|
|
224
228
|
}, [onTabClick, outerIndex, swiperInstance]);
|
|
225
229
|
var handleSwiper = React.useCallback(function (swiper) {
|
package/dist/es/index.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ export { default as SliderScale } from './components/Sliders/components/SliderSc
|
|
|
62
62
|
export { default as slidesSettings } from './components/Banner/slidesSettings';
|
|
63
63
|
export { default as Snackbar } from './components/Snackbar/Snackbar';
|
|
64
64
|
export { default as SnackbarTimer } from './components/Snackbar/SnackbarTimer/SnackbarTimer';
|
|
65
|
+
export { default as StatusBadge } from './components/Badges/StatusBadge/StatusBadge';
|
|
65
66
|
export { default as Switcher } from './components/Switcher/Switcher';
|
|
66
67
|
export { default as Tab } from './components/Tabs/Tab';
|
|
67
68
|
export { default as Tabs } from './components/Tabs/Tabs';
|
package/dist/es/index.js
CHANGED
|
@@ -62,6 +62,7 @@ export { default as SliderScale } from "./components/Sliders/components/SliderSc
|
|
|
62
62
|
export { default as slidesSettings } from "./components/Banner/slidesSettings";
|
|
63
63
|
export { default as Snackbar } from "./components/Snackbar/Snackbar";
|
|
64
64
|
export { default as SnackbarTimer } from "./components/Snackbar/SnackbarTimer/SnackbarTimer";
|
|
65
|
+
export { default as StatusBadge } from "./components/Badges/StatusBadge/StatusBadge";
|
|
65
66
|
export { default as Switcher } from "./components/Switcher/Switcher";
|
|
66
67
|
export { default as Tab } from "./components/Tabs/Tab";
|
|
67
68
|
export { default as Tabs } from "./components/Tabs/Tabs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-status-badge__container{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:12px;line-height:18px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--content);font-weight:400;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.mfui-status-badge__text{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mfui-status-badge__arrow,.mfui-status-badge__icon{height:20px;width:20px}.mfui-status-badge__icon{margin-right:2px}@media screen and (min-width:1024px){.mfui-status-badge_adaptive .mfui-status-badge__container{font-size:15px;line-height:24px}}.mfui-status-badge_tooltip .mfui-status-badge__container{cursor:pointer}.mfui-status-badge__tooltip{width:288px}.mfui-status-badge_view_dot .mfui-status-badge__container{gap:8px}.mfui-status-badge_view_dot .mfui-status-badge__container:before{border-radius:50%;content:"";height:8px;width:8px}.mfui-status-badge_view_dot.mfui-status-badge_tooltip .mfui-status-badge__text{-webkit-text-decoration:underline dashed var(--spbSky3);text-decoration:underline dashed var(--spbSky3);text-decoration-thickness:1px;text-underline-offset:3px;-webkit-transition:-webkit-text-decoration .3s ease-out;transition:-webkit-text-decoration .3s ease-out;transition:text-decoration .3s ease-out;transition:text-decoration .3s ease-out,-webkit-text-decoration .3s ease-out}@media (pointer:fine){.mfui-status-badge_view_dot.mfui-status-badge_tooltip .mfui-status-badge__container:hover .mfui-status-badge__text{-webkit-text-decoration:underline dashed var(--content);text-decoration:underline dashed var(--content);text-decoration-thickness:1px}.mfui-status-badge_view_dot.mfui-status-badge_tooltip .mfui-status-badge__container:hover:before{-webkit-animation:pulse .8s ease-out;animation:pulse .8s ease-out}}@media screen and (min-width:1024px){.mfui-status-badge_view_dot.mfui-status-badge_adaptive.mfui-status-badge_tooltip .mfui-status-badge__text{text-underline-offset:5px}}.mfui-status-badge_view_dot.mfui-status-badge_theme_green .mfui-status-badge__container:before{background-color:var(--brandGreen)}.mfui-status-badge_view_dot.mfui-status-badge_theme_blue .mfui-status-badge__container:before{background-color:var(--sky)}.mfui-status-badge_view_dot.mfui-status-badge_theme_gray .mfui-status-badge__container:before{background-color:var(--spbSky3)}.mfui-status-badge_view_dot.mfui-status-badge_theme_orange .mfui-status-badge__container:before{background-color:var(--137C)}.mfui-status-badge_view_dot.mfui-status-badge_theme_red .mfui-status-badge__container:before{background-color:var(--fury)}.mfui-status-badge_view_icon .mfui-status-badge__container{border:1px solid var(--spbSky1);border-radius:8px;padding:1px 7px 1px 1px}.mfui-status-badge_view_icon .mfui-status-badge__arrow{rotate:180deg;-webkit-transition:rotate .3s ease-out,fill .3s ease-out;transition:rotate .3s ease-out,fill .3s ease-out;fill:var(--spbSky3)}.mfui-status-badge_view_icon.mfui-status-badge_opened .mfui-status-badge__arrow{rotate:1turn}@media (pointer:fine){.mfui-status-badge_view_icon .mfui-status-badge__container:hover .mfui-status-badge__arrow{fill:var(--content)}}.mfui-status-badge_view_icon.mfui-status-badge_tooltip .mfui-status-badge__container{padding-right:1px}@media screen and (min-width:1024px){.mfui-status-badge_view_icon.mfui-status-badge_adaptive .mfui-status-badge__container{padding:3px 10px 3px 5px}.mfui-status-badge_view_icon.mfui-status-badge_adaptive .mfui-status-badge__icon{margin-right:4px}.mfui-status-badge_view_icon.mfui-status-badge_adaptive .mfui-status-badge__text{margin-top:-1px}.mfui-status-badge_view_icon.mfui-status-badge_adaptive.mfui-status-badge_tooltip .mfui-status-badge__container{padding-right:5px}}.mfui-status-badge_view_icon.mfui-status-badge_theme_green .mfui-status-badge__icon{fill:var(--brandGreen)}.mfui-status-badge_view_icon.mfui-status-badge_theme_blue .mfui-status-badge__icon{fill:var(--sky)}.mfui-status-badge_view_icon.mfui-status-badge_theme_gray .mfui-status-badge__icon{fill:var(--spbSky3)}.mfui-status-badge_view_icon.mfui-status-badge_theme_orange .mfui-status-badge__icon{fill:var(--137C)}.mfui-status-badge_view_icon.mfui-status-badge_theme_red .mfui-status-badge__icon{fill:var(--fury)}@-webkit-keyframes pulse{0%{opacity:1;scale:1}30%{opacity:.7}50%{opacity:1;scale:1.3}70%{opacity:.7}to{opacity:1;scale:1}}@keyframes pulse{0%{opacity:1;scale:1}30%{opacity:.7}50%{opacity:1;scale:1.3}70%{opacity:.7}to{opacity:1;scale:1}}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Tooltip from '../../Tooltip/Tooltip';
|
|
3
|
+
import './StatusBadge.scss';
|
|
4
|
+
type TooltipPropsType = Pick<React.ComponentProps<typeof Tooltip>, 'title' | 'text' | 'buttonText' | 'placement' | 'isPortal' | 'portalSelector' | 'isHiddenResize' | 'onClick' | 'onOpen' | 'onClose' | 'onCloseButtonClick'>;
|
|
5
|
+
export interface IStatusBadgeProps {
|
|
6
|
+
/** Вид компонента */
|
|
7
|
+
view?: 'icon' | 'dot';
|
|
8
|
+
/** Тема компонента */
|
|
9
|
+
theme?: 'green' | 'blue' | 'gray' | 'orange' | 'red';
|
|
10
|
+
/** Тип иконки (для view = icon) */
|
|
11
|
+
iconType?: 'timer' | 'price' | 'checkInvert' | 'attention' | 'info' | 'profileFull';
|
|
12
|
+
/** Адаптивный режим */
|
|
13
|
+
isAdaptive?: boolean;
|
|
14
|
+
/** Тултип */
|
|
15
|
+
tooltip?: TooltipPropsType;
|
|
16
|
+
/** Дополнительный класс корневого элемента */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Дополнительные классы для внутренних элементов */
|
|
19
|
+
classes?: {
|
|
20
|
+
root?: string;
|
|
21
|
+
container?: string;
|
|
22
|
+
tooltip?: string;
|
|
23
|
+
tooltipButton?: string;
|
|
24
|
+
tooltipCloseButton?: string;
|
|
25
|
+
};
|
|
26
|
+
/** Дополнительные data-атрибуты к внутренним элементам */
|
|
27
|
+
dataAttrs?: {
|
|
28
|
+
root?: Record<string, string>;
|
|
29
|
+
container?: Record<string, string>;
|
|
30
|
+
icon?: Record<string, string>;
|
|
31
|
+
arrow?: Record<string, string>;
|
|
32
|
+
tooltip?: Record<string, string>;
|
|
33
|
+
tooltipButton?: Record<string, string>;
|
|
34
|
+
tooltipCloseButton?: Record<string, string>;
|
|
35
|
+
};
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
declare const StatusBadge: React.FC<IStatusBadgeProps>;
|
|
39
|
+
export default StatusBadge;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _uiHelpers = require("@megafon/ui-helpers");
|
|
12
|
+
var _Tooltip = _interopRequireDefault(require("../../Tooltip/Tooltip"));
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
|
+
var ProfileFullIcon = function ProfileFullIcon(props) {
|
|
17
|
+
return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
|
|
18
|
+
viewBox: "0 0 20 20"
|
|
19
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
20
|
+
d: "M5.22 18h9.55L16 13.47A8.28 8.28 0 0010 11a8.302 8.302 0 00-6 2.5L5.22 18zM14 6a4 4 0 10-8 0 4 4 0 008 0z"
|
|
21
|
+
}));
|
|
22
|
+
};
|
|
23
|
+
var ArrowIcon = function ArrowIcon(props) {
|
|
24
|
+
return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
|
|
25
|
+
viewBox: "0 0 20 20"
|
|
26
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
27
|
+
d: "M13 12l-3-3-3 3-1-1 4-4 4 4z"
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
30
|
+
var AttentionIcon = function AttentionIcon(props) {
|
|
31
|
+
return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
|
|
32
|
+
viewBox: "0 0 20 20"
|
|
33
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
34
|
+
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"
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
var CheckInvertIcon = function CheckInvertIcon(props) {
|
|
38
|
+
return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
|
|
39
|
+
viewBox: "0 0 20 20"
|
|
40
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
41
|
+
fillRule: "evenodd",
|
|
42
|
+
clipRule: "evenodd",
|
|
43
|
+
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"
|
|
44
|
+
}));
|
|
45
|
+
};
|
|
46
|
+
var InfoIcon = function InfoIcon(props) {
|
|
47
|
+
return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
|
|
48
|
+
viewBox: "0 0 20 20"
|
|
49
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
50
|
+
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 5c.6 0 1-.4 1-1s-.4-1-1-1-1 .4-1 1 .4 1 1 1zm1 8V9H9v6h2z"
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
var PriceIcon = function PriceIcon(props) {
|
|
54
|
+
return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
|
|
55
|
+
viewBox: "0 0 20 20"
|
|
56
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
57
|
+
fillRule: "evenodd",
|
|
58
|
+
clipRule: "evenodd",
|
|
59
|
+
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"
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
62
|
+
var TimerIcon = function TimerIcon(props) {
|
|
63
|
+
return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
|
|
64
|
+
viewBox: "0 0 20 20"
|
|
65
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
66
|
+
fillRule: "evenodd",
|
|
67
|
+
clipRule: "evenodd",
|
|
68
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm1-8.414V5H9v5.414l3 3L13.414 12 11 9.586z"
|
|
69
|
+
}));
|
|
70
|
+
};
|
|
71
|
+
var statusIconsMap = {
|
|
72
|
+
attention: AttentionIcon,
|
|
73
|
+
checkInvert: CheckInvertIcon,
|
|
74
|
+
info: InfoIcon,
|
|
75
|
+
price: PriceIcon,
|
|
76
|
+
profileFull: ProfileFullIcon,
|
|
77
|
+
timer: TimerIcon
|
|
78
|
+
};
|
|
79
|
+
var cn = (0, _uiHelpers.cnCreate)('mfui-status-badge');
|
|
80
|
+
var StatusBadge = function StatusBadge(_ref) {
|
|
81
|
+
var _ref$view = _ref.view,
|
|
82
|
+
view = _ref$view === void 0 ? 'dot' : _ref$view,
|
|
83
|
+
_ref$theme = _ref.theme,
|
|
84
|
+
theme = _ref$theme === void 0 ? 'green' : _ref$theme,
|
|
85
|
+
_ref$isAdaptive = _ref.isAdaptive,
|
|
86
|
+
isAdaptive = _ref$isAdaptive === void 0 ? false : _ref$isAdaptive,
|
|
87
|
+
_ref$iconType = _ref.iconType,
|
|
88
|
+
iconType = _ref$iconType === void 0 ? 'timer' : _ref$iconType,
|
|
89
|
+
tooltip = _ref.tooltip,
|
|
90
|
+
children = _ref.children,
|
|
91
|
+
className = _ref.className,
|
|
92
|
+
classes = _ref.classes,
|
|
93
|
+
dataAttrs = _ref.dataAttrs;
|
|
94
|
+
var triggerRef = React.useRef(null);
|
|
95
|
+
var _React$useState = React.useState(false),
|
|
96
|
+
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
97
|
+
isOpened = _React$useState2[0],
|
|
98
|
+
setIsOpened = _React$useState2[1];
|
|
99
|
+
var showIcon = view === 'icon';
|
|
100
|
+
var showArrow = showIcon && !!tooltip;
|
|
101
|
+
var StatusIconElement = statusIconsMap[iconType];
|
|
102
|
+
var handleOpen = React.useCallback(function (e) {
|
|
103
|
+
var _a;
|
|
104
|
+
setIsOpened(true);
|
|
105
|
+
(_a = tooltip === null || tooltip === void 0 ? void 0 : tooltip.onOpen) === null || _a === void 0 ? void 0 : _a.call(tooltip, e);
|
|
106
|
+
}, [tooltip]);
|
|
107
|
+
var handleClose = React.useCallback(function (e) {
|
|
108
|
+
var _a;
|
|
109
|
+
setIsOpened(false);
|
|
110
|
+
(_a = tooltip === null || tooltip === void 0 ? void 0 : tooltip.onClose) === null || _a === void 0 ? void 0 : _a.call(tooltip, e);
|
|
111
|
+
}, [tooltip]);
|
|
112
|
+
var handleCloseButtonClick = React.useCallback(function (e) {
|
|
113
|
+
var _a;
|
|
114
|
+
setIsOpened(false);
|
|
115
|
+
(_a = tooltip === null || tooltip === void 0 ? void 0 : tooltip.onCloseButtonClick) === null || _a === void 0 ? void 0 : _a.call(tooltip, e);
|
|
116
|
+
}, [tooltip]);
|
|
117
|
+
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
118
|
+
className: cn({
|
|
119
|
+
view: view,
|
|
120
|
+
theme: theme,
|
|
121
|
+
adaptive: isAdaptive,
|
|
122
|
+
tooltip: !!tooltip,
|
|
123
|
+
opened: isOpened
|
|
124
|
+
}, [className, classes === null || classes === void 0 ? void 0 : classes.root])
|
|
125
|
+
}), /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.container), {
|
|
126
|
+
className: cn('container', [classes === null || classes === void 0 ? void 0 : classes.container]),
|
|
127
|
+
ref: triggerRef
|
|
128
|
+
}), showIcon && /*#__PURE__*/React.createElement(StatusIconElement, (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.icon), {
|
|
129
|
+
className: cn('icon')
|
|
130
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
131
|
+
className: cn('text')
|
|
132
|
+
}, children), showArrow && /*#__PURE__*/React.createElement(ArrowIcon, (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrow), {
|
|
133
|
+
className: cn('arrow')
|
|
134
|
+
}))), !!tooltip && /*#__PURE__*/React.createElement(_Tooltip["default"], {
|
|
135
|
+
className: cn('tooltip'),
|
|
136
|
+
title: tooltip.title,
|
|
137
|
+
text: tooltip.text,
|
|
138
|
+
buttonText: tooltip.buttonText,
|
|
139
|
+
isHiddenResize: tooltip.isHiddenResize,
|
|
140
|
+
isPortal: tooltip.isPortal,
|
|
141
|
+
portalSelector: tooltip.portalSelector,
|
|
142
|
+
triggerElement: triggerRef,
|
|
143
|
+
hasCloseButton: true,
|
|
144
|
+
placement: tooltip.placement || 'bottom',
|
|
145
|
+
fallbackPlacements: ['top', 'left', 'right'],
|
|
146
|
+
offset: "small",
|
|
147
|
+
triggerEvent: "click",
|
|
148
|
+
colorTheme: "blue",
|
|
149
|
+
onClick: tooltip.onClick,
|
|
150
|
+
onCloseButtonClick: handleCloseButtonClick,
|
|
151
|
+
onClose: handleClose,
|
|
152
|
+
onOpen: handleOpen,
|
|
153
|
+
dataAttrs: {
|
|
154
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.tooltip,
|
|
155
|
+
button: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.tooltipButton,
|
|
156
|
+
close: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.tooltipCloseButton
|
|
157
|
+
},
|
|
158
|
+
classes: {
|
|
159
|
+
root: classes === null || classes === void 0 ? void 0 : classes.tooltip,
|
|
160
|
+
button: classes === null || classes === void 0 ? void 0 : classes.tooltipButton,
|
|
161
|
+
close: classes === null || classes === void 0 ? void 0 : classes.tooltipCloseButton
|
|
162
|
+
}
|
|
163
|
+
}));
|
|
164
|
+
};
|
|
165
|
+
var _default = exports["default"] = StatusBadge;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}.mfui-content-view{color:var(--content);min-width:240px;padding:0 16px;text-align:center}.mfui-content-view__image{max-width:144px}.mfui-content-view__bg-image,.mfui-content-view__image{display:inline-block;margin-bottom:24px;vertical-align:top}.mfui-content-view__bg-image{background-repeat:no-repeat;background-size:100%;height:144px;width:144px}.mfui-content-view__bg-image_type_waiting{background-image:url(
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-content-view{color:var(--content);min-width:240px;padding:0 16px;text-align:center}.mfui-content-view__image{max-width:144px}.mfui-content-view__bg-image,.mfui-content-view__image{display:inline-block;margin-bottom:24px;vertical-align:top}.mfui-content-view__bg-image{background-repeat:no-repeat;background-size:100%;height:144px;width:144px}.mfui-content-view__bg-image_type_waiting{background-image:url(img/waiting.png)}.mfui-content-view__bg-image_type_error{background-image:url(img/error.png)}.mfui-content-view__bg-image_type_submit{background-image:url(img/submit.png)}.mfui-content-view__bg-image_type_success{background-image:url(img/success.png)}.mfui-content-view__bg-image_type_fail{background-image:url(img/fail.png)}.mfui-content-view__bg-image_type_update{background-image:url(img/update.png)}.mfui-content-view__bg-image_type_alarm{background-image:url(img/alarm.png)}.mfui-content-view__bg-image_type_empty{background-image:url(img/empty.png)}.mfui-content-view__bg-image_type_searchNoResult{background-image:url(img/searchNoResult.png)}.mfui-content-view__title{font-size:18px;font-weight:500;line-height:24px}@media screen and (min-width:768px){.mfui-content-view__title{font-size:20px;letter-spacing:.5px;line-height:28px}}.mfui-content-view__text{font-size:15px;font-weight:400;line-height:24px;margin-top:4px}.mfui-content-view__buttons{gap:12px;padding-top:32px}.mfui-content-view__buttons,.mfui-content-view_fullscreen{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-content-view_fullscreen{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;min-height:100%}.mfui-content-view_fullscreen .mfui-content-view__content{margin-top:auto}.mfui-content-view_fullscreen .mfui-content-view__buttons{margin-top:auto;padding-bottom:24px}
|