@megafon/ui-core 3.12.0 → 4.0.0-beta.10
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 +106 -0
- package/dist/es/colors/Colors.css +4 -0
- package/dist/es/components/Accordion/Accordion.css +59 -22
- package/dist/es/components/Accordion/Accordion.js +12 -17
- package/dist/es/components/Badges/components/PriceBadge/PriceBadge.css +1 -1
- package/dist/es/components/Badges/components/PromoBadge/PromoBadge.css +1 -1
- package/dist/es/components/Badges/components/TimerBadge/TimerBadge.css +1 -1
- package/dist/es/components/Button/Button.css +5 -5
- package/dist/es/components/Calendar/components/Day/Day.css +1 -1
- package/dist/es/components/Calendar/components/Month/Month.css +1 -1
- package/dist/es/components/Caption/Caption.css +48 -0
- package/dist/es/components/Caption/Caption.d.ts +31 -0
- package/dist/es/components/Caption/Caption.js +51 -0
- package/dist/es/components/Header/Header.css +3 -0
- package/dist/es/components/Header/Header.d.ts +2 -0
- package/dist/es/components/Header/Header.js +7 -1
- package/dist/es/components/Notification/Notification.css +9 -5
- package/dist/es/components/Notification/Notification.js +2 -7
- package/dist/es/components/Paragraph/Paragraph.css +8 -5
- package/dist/es/components/Paragraph/Paragraph.d.ts +4 -3
- package/dist/es/components/Paragraph/Paragraph.js +6 -5
- package/dist/es/components/RadioButton/RadioButton.css +1 -1
- package/dist/es/components/Search/Search.css +129 -9
- package/dist/es/components/Search/Search.d.ts +2 -0
- package/dist/es/components/Search/Search.js +20 -7
- package/dist/es/components/Select/Select.css +165 -30
- package/dist/es/components/Select/Select.js +25 -18
- package/dist/es/components/Switcher/Switcher.css +1 -1
- package/dist/es/components/Tabs/Tabs.css +140 -143
- package/dist/es/components/Tabs/Tabs.d.ts +9 -8
- package/dist/es/components/Tabs/Tabs.js +14 -18
- package/dist/es/components/TextField/TextField.css +221 -92
- package/dist/es/components/TextField/TextField.js +161 -71
- package/dist/es/constants/throttleTime.d.ts +1 -0
- package/dist/es/constants/throttleTime.js +2 -1
- package/dist/es/index.d.ts +1 -1
- package/dist/es/index.js +1 -1
- package/dist/lib/colors/Colors.css +4 -0
- package/dist/lib/components/Accordion/Accordion.css +59 -22
- package/dist/lib/components/Accordion/Accordion.js +12 -17
- package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.css +1 -1
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.css +1 -1
- package/dist/lib/components/Badges/components/TimerBadge/TimerBadge.css +1 -1
- package/dist/lib/components/Button/Button.css +5 -5
- package/dist/lib/components/Calendar/components/Day/Day.css +1 -1
- package/dist/lib/components/Calendar/components/Month/Month.css +1 -1
- package/dist/lib/components/Caption/Caption.css +48 -0
- package/dist/lib/components/Caption/Caption.d.ts +31 -0
- package/dist/lib/components/{InputLabel/InputLabel.js → Caption/Caption.js} +38 -10
- package/dist/lib/components/Header/Header.css +3 -0
- package/dist/lib/components/Header/Header.d.ts +2 -0
- package/dist/lib/components/Header/Header.js +7 -1
- package/dist/lib/components/Notification/Notification.css +9 -5
- package/dist/lib/components/Notification/Notification.js +2 -8
- package/dist/lib/components/Paragraph/Paragraph.css +8 -5
- package/dist/lib/components/Paragraph/Paragraph.d.ts +4 -3
- package/dist/lib/components/Paragraph/Paragraph.js +6 -5
- package/dist/lib/components/RadioButton/RadioButton.css +1 -1
- package/dist/lib/components/Search/Search.css +129 -9
- package/dist/lib/components/Search/Search.d.ts +2 -0
- package/dist/lib/components/Search/Search.js +20 -8
- package/dist/lib/components/Select/Select.css +165 -30
- package/dist/lib/components/Select/Select.js +25 -19
- package/dist/lib/components/Switcher/Switcher.css +1 -1
- package/dist/lib/components/Tabs/Tabs.css +140 -143
- package/dist/lib/components/Tabs/Tabs.d.ts +9 -8
- package/dist/lib/components/Tabs/Tabs.js +16 -20
- package/dist/lib/components/TextField/TextField.css +221 -92
- package/dist/lib/components/TextField/TextField.js +164 -71
- package/dist/lib/constants/throttleTime.d.ts +1 -0
- package/dist/lib/constants/throttleTime.js +2 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +8 -8
- package/package.json +3 -3
- package/styles/base.less +4 -1
- package/dist/es/components/InputLabel/InputLabel.css +0 -5
- package/dist/es/components/InputLabel/InputLabel.d.ts +0 -10
- package/dist/es/components/InputLabel/InputLabel.js +0 -24
- package/dist/lib/components/InputLabel/InputLabel.css +0 -5
- package/dist/lib/components/InputLabel/InputLabel.d.ts +0 -10
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
}
|
|
28
28
|
.mfui-button_size-all_extra-small .mfui-button__inner {
|
|
29
29
|
font-size: 12px;
|
|
30
|
-
line-height:
|
|
30
|
+
line-height: 18px;
|
|
31
31
|
min-width: 26px;
|
|
32
32
|
height: 26px;
|
|
33
33
|
}
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
}
|
|
66
66
|
.mfui-button_size-wide_extra-small .mfui-button__inner {
|
|
67
67
|
font-size: 12px;
|
|
68
|
-
line-height:
|
|
68
|
+
line-height: 18px;
|
|
69
69
|
min-width: 26px;
|
|
70
70
|
height: 26px;
|
|
71
71
|
}
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
}
|
|
105
105
|
.mfui-button_size-desktop_extra-small .mfui-button__inner {
|
|
106
106
|
font-size: 12px;
|
|
107
|
-
line-height:
|
|
107
|
+
line-height: 18px;
|
|
108
108
|
min-width: 26px;
|
|
109
109
|
height: 26px;
|
|
110
110
|
}
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
}
|
|
144
144
|
.mfui-button_size-tablet_extra-small .mfui-button__inner {
|
|
145
145
|
font-size: 12px;
|
|
146
|
-
line-height:
|
|
146
|
+
line-height: 18px;
|
|
147
147
|
min-width: 26px;
|
|
148
148
|
height: 26px;
|
|
149
149
|
}
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
}
|
|
183
183
|
.mfui-button_size-mobile_extra-small .mfui-button__inner {
|
|
184
184
|
font-size: 12px;
|
|
185
|
-
line-height:
|
|
185
|
+
line-height: 18px;
|
|
186
186
|
min-width: 26px;
|
|
187
187
|
height: 26px;
|
|
188
188
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.mfui-caption {
|
|
2
|
+
font-family: inherit;
|
|
3
|
+
font-size: 12px;
|
|
4
|
+
line-height: 18px;
|
|
5
|
+
margin: 0;
|
|
6
|
+
}
|
|
7
|
+
.mfui-caption_variant_normal {
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
}
|
|
10
|
+
.mfui-caption_variant_medium {
|
|
11
|
+
font-weight: 600;
|
|
12
|
+
}
|
|
13
|
+
.mfui-caption_space_wide {
|
|
14
|
+
line-height: 18px;
|
|
15
|
+
}
|
|
16
|
+
.mfui-caption_space_tight {
|
|
17
|
+
line-height: 14px;
|
|
18
|
+
}
|
|
19
|
+
.mfui-caption_align_left {
|
|
20
|
+
text-align: left;
|
|
21
|
+
}
|
|
22
|
+
.mfui-caption_align_center {
|
|
23
|
+
text-align: center;
|
|
24
|
+
}
|
|
25
|
+
.mfui-caption_align_right {
|
|
26
|
+
text-align: right;
|
|
27
|
+
}
|
|
28
|
+
.mfui-caption_has-margin {
|
|
29
|
+
margin: 0 0 16px;
|
|
30
|
+
}
|
|
31
|
+
.mfui-caption_color_inherit {
|
|
32
|
+
color: inherit;
|
|
33
|
+
}
|
|
34
|
+
.mfui-caption_color_default {
|
|
35
|
+
color: var(--content);
|
|
36
|
+
}
|
|
37
|
+
.mfui-caption_color_gray {
|
|
38
|
+
color: var(--spbSky3);
|
|
39
|
+
}
|
|
40
|
+
.mfui-caption_color_white {
|
|
41
|
+
color: var(--stcWhite);
|
|
42
|
+
}
|
|
43
|
+
.mfui-caption_color_green {
|
|
44
|
+
color: var(--brandGreen);
|
|
45
|
+
}
|
|
46
|
+
.mfui-caption_color_purple {
|
|
47
|
+
color: var(--brandPurple);
|
|
48
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './Caption.less';
|
|
3
|
+
declare const COLORS: {
|
|
4
|
+
readonly INHERIT: "inherit";
|
|
5
|
+
readonly DEFAULT: "default";
|
|
6
|
+
readonly GRAY: "gray";
|
|
7
|
+
readonly WHITE: "white";
|
|
8
|
+
readonly GREEN: "green";
|
|
9
|
+
readonly PURPLE: "purple";
|
|
10
|
+
};
|
|
11
|
+
declare type ColorType = typeof COLORS[keyof typeof COLORS];
|
|
12
|
+
export interface ICaptionProps {
|
|
13
|
+
/** Выравнивание по горизонтали */
|
|
14
|
+
align?: 'left' | 'center' | 'right';
|
|
15
|
+
/** Поведение текста при встраивании в широкий или узкий контейнер */
|
|
16
|
+
space?: 'wide' | 'tight';
|
|
17
|
+
/** Начертание шрифта: обычный или полужирный */
|
|
18
|
+
variant?: 'normal' | 'medium';
|
|
19
|
+
/** Вертикальный отступ */
|
|
20
|
+
hasMargin?: boolean;
|
|
21
|
+
/** Цвет текста */
|
|
22
|
+
color?: ColorType;
|
|
23
|
+
/** Дополнительный класс корневого элемента */
|
|
24
|
+
className?: string;
|
|
25
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
26
|
+
dataAttrs?: {
|
|
27
|
+
root?: Record<string, string>;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
declare const Caption: React.FC<ICaptionProps>;
|
|
31
|
+
export default Caption;
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
+
require("core-js/modules/es.object.values");
|
|
11
|
+
|
|
10
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
13
|
|
|
12
14
|
var React = _interopRequireWildcard(require("react"));
|
|
@@ -21,23 +23,49 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
25
|
|
|
24
|
-
var
|
|
26
|
+
var COLORS = {
|
|
27
|
+
INHERIT: 'inherit',
|
|
28
|
+
DEFAULT: 'default',
|
|
29
|
+
GRAY: 'gray',
|
|
30
|
+
WHITE: 'white',
|
|
31
|
+
GREEN: 'green',
|
|
32
|
+
PURPLE: 'purple'
|
|
33
|
+
};
|
|
34
|
+
var cn = (0, _uiHelpers.cnCreate)('mfui-caption');
|
|
25
35
|
|
|
26
|
-
var
|
|
27
|
-
var
|
|
36
|
+
var Caption = function Caption(_ref) {
|
|
37
|
+
var align = _ref.align,
|
|
38
|
+
_ref$color = _ref.color,
|
|
39
|
+
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
40
|
+
_ref$space = _ref.space,
|
|
41
|
+
space = _ref$space === void 0 ? 'wide' : _ref$space,
|
|
42
|
+
_ref$variant = _ref.variant,
|
|
43
|
+
variant = _ref$variant === void 0 ? 'normal' : _ref$variant,
|
|
44
|
+
className = _ref.className,
|
|
45
|
+
_ref$hasMargin = _ref.hasMargin,
|
|
46
|
+
hasMargin = _ref$hasMargin === void 0 ? true : _ref$hasMargin,
|
|
28
47
|
dataAttrs = _ref.dataAttrs,
|
|
29
48
|
children = _ref.children;
|
|
30
|
-
return /*#__PURE__*/React.createElement("
|
|
31
|
-
|
|
32
|
-
|
|
49
|
+
return /*#__PURE__*/React.createElement("p", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
50
|
+
className: cn({
|
|
51
|
+
align: align,
|
|
52
|
+
color: color,
|
|
53
|
+
space: space,
|
|
54
|
+
variant: variant,
|
|
55
|
+
'has-margin': hasMargin
|
|
56
|
+
}, className)
|
|
33
57
|
}), children);
|
|
34
58
|
};
|
|
35
59
|
|
|
36
|
-
|
|
37
|
-
htmlFor: PropTypes.string,
|
|
60
|
+
Caption.propTypes = {
|
|
38
61
|
dataAttrs: PropTypes.shape({
|
|
39
62
|
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
40
|
-
})
|
|
63
|
+
}),
|
|
64
|
+
align: PropTypes.oneOf(['left', 'center', 'right']),
|
|
65
|
+
space: PropTypes.oneOf(['wide', 'tight']),
|
|
66
|
+
variant: PropTypes.oneOf(['normal', 'medium']),
|
|
67
|
+
hasMargin: PropTypes.bool,
|
|
68
|
+
color: PropTypes.oneOf(Object.values(COLORS))
|
|
41
69
|
};
|
|
42
|
-
var _default =
|
|
70
|
+
var _default = Caption;
|
|
43
71
|
exports["default"] = _default;
|
|
@@ -3,6 +3,8 @@ import './Header.less';
|
|
|
3
3
|
interface IHeaderProps {
|
|
4
4
|
/** Тег */
|
|
5
5
|
as?: 'h1' | 'h2' | 'h3' | 'h5';
|
|
6
|
+
/** Поведение текста при встраивании в широкий или узкий контейнер (только для h5) */
|
|
7
|
+
space?: 'wide' | 'tight';
|
|
6
8
|
/** Цвет */
|
|
7
9
|
color?: 'default' | 'black' | 'white' | 'green' | 'purple' | 'blue' | 'inherit';
|
|
8
10
|
/** Включить отступ */
|
|
@@ -27,6 +27,8 @@ var Header = function Header(_ref) {
|
|
|
27
27
|
var addition = _ref.addition,
|
|
28
28
|
_ref$as = _ref.as,
|
|
29
29
|
level = _ref$as === void 0 ? 'h1' : _ref$as,
|
|
30
|
+
_ref$space = _ref.space,
|
|
31
|
+
space = _ref$space === void 0 ? 'wide' : _ref$space,
|
|
30
32
|
children = _ref.children,
|
|
31
33
|
className = _ref.className,
|
|
32
34
|
_ref$color = _ref.color,
|
|
@@ -37,12 +39,15 @@ var Header = function Header(_ref) {
|
|
|
37
39
|
margin = _ref.margin,
|
|
38
40
|
onClick = _ref.onClick;
|
|
39
41
|
var ElementType = level;
|
|
42
|
+
var hasVariousSpaces = level === 'h5';
|
|
43
|
+
var spaceLevel = hasVariousSpaces && space;
|
|
40
44
|
return /*#__PURE__*/React.createElement(ElementType, (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
41
45
|
className: cn({
|
|
42
46
|
color: color,
|
|
43
47
|
margin: margin,
|
|
44
48
|
level: level,
|
|
45
|
-
'h-align': hAlign
|
|
49
|
+
'h-align': hAlign,
|
|
50
|
+
space: spaceLevel
|
|
46
51
|
}, className),
|
|
47
52
|
onClick: onClick
|
|
48
53
|
}), children, addition && /*#__PURE__*/React.createElement("div", {
|
|
@@ -53,6 +58,7 @@ var Header = function Header(_ref) {
|
|
|
53
58
|
Header.propTypes = {
|
|
54
59
|
as: PropTypes.oneOf(['h1', 'h2', 'h3', 'h5']),
|
|
55
60
|
color: PropTypes.oneOf(['default', 'black', 'white', 'green', 'purple', 'blue', 'inherit']),
|
|
61
|
+
space: PropTypes.oneOf(['wide', 'tight']),
|
|
56
62
|
margin: PropTypes.bool,
|
|
57
63
|
addition: PropTypes.element,
|
|
58
64
|
hAlign: PropTypes.oneOf(['inherit', 'left', 'center', 'right']),
|
|
@@ -22,12 +22,16 @@ h5 {
|
|
|
22
22
|
display: flex;
|
|
23
23
|
}
|
|
24
24
|
.mfui-notification__title {
|
|
25
|
-
|
|
25
|
+
display: block;
|
|
26
|
+
margin-bottom: 4px;
|
|
26
27
|
color: var(--content);
|
|
28
|
+
font-weight: 500;
|
|
29
|
+
font-size: 15px;
|
|
30
|
+
line-height: 18px;
|
|
27
31
|
}
|
|
28
32
|
@media screen and (min-width: 1280px) {
|
|
29
33
|
.mfui-notification__title {
|
|
30
|
-
|
|
34
|
+
line-height: 24px;
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
37
|
.mfui-notification__title_close-padding {
|
|
@@ -35,7 +39,7 @@ h5 {
|
|
|
35
39
|
}
|
|
36
40
|
.mfui-notification__text {
|
|
37
41
|
font-size: 12px;
|
|
38
|
-
line-height:
|
|
42
|
+
line-height: 18px;
|
|
39
43
|
position: relative;
|
|
40
44
|
max-width: 100%;
|
|
41
45
|
margin: 0;
|
|
@@ -168,7 +172,7 @@ h5 {
|
|
|
168
172
|
@media screen and (max-width: 767px) {
|
|
169
173
|
.mfui-notification__link {
|
|
170
174
|
font-size: 12px;
|
|
171
|
-
line-height:
|
|
175
|
+
line-height: 18px;
|
|
172
176
|
}
|
|
173
177
|
}
|
|
174
178
|
.mfui-notification__link-arrow,
|
|
@@ -209,7 +213,7 @@ h5 {
|
|
|
209
213
|
@media screen and (max-width: 767px) {
|
|
210
214
|
.mfui-notification__collapse-button {
|
|
211
215
|
font-size: 12px;
|
|
212
|
-
line-height:
|
|
216
|
+
line-height: 18px;
|
|
213
217
|
}
|
|
214
218
|
}
|
|
215
219
|
.mfui-notification__collapse_hidden {
|
|
@@ -25,8 +25,6 @@ var PropTypes = _interopRequireWildcard(require("prop-types"));
|
|
|
25
25
|
|
|
26
26
|
var _Button = _interopRequireDefault(require("../Button/Button"));
|
|
27
27
|
|
|
28
|
-
var _Header = _interopRequireDefault(require("../Header/Header"));
|
|
29
|
-
|
|
30
28
|
var _TextLink = _interopRequireDefault(require("../TextLink/TextLink"));
|
|
31
29
|
|
|
32
30
|
var _Tile = _interopRequireDefault(require("../Tile/Tile"));
|
|
@@ -325,13 +323,9 @@ var Notification = function Notification(_ref) {
|
|
|
325
323
|
className: cn('content', [contentClass])
|
|
326
324
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
327
325
|
className: cn('text-container')
|
|
328
|
-
}, title && /*#__PURE__*/_react["default"].createElement(
|
|
329
|
-
dataAttrs: {
|
|
330
|
-
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.title
|
|
331
|
-
},
|
|
332
|
-
as: "h5",
|
|
326
|
+
}, title && /*#__PURE__*/_react["default"].createElement("span", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.title), {
|
|
333
327
|
className: cn('title')
|
|
334
|
-
}, title), /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
|
328
|
+
}), title), /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
|
335
329
|
ref: wrapTextRef
|
|
336
330
|
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.text), {
|
|
337
331
|
className: cn('text', {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
.mfui-paragraph {
|
|
2
2
|
font-family: inherit;
|
|
3
|
+
font-size: 15px;
|
|
4
|
+
line-height: 24px;
|
|
3
5
|
margin: 0;
|
|
4
6
|
font-weight: 400;
|
|
5
7
|
}
|
|
@@ -12,13 +14,11 @@
|
|
|
12
14
|
.mfui-paragraph_align_right {
|
|
13
15
|
text-align: right;
|
|
14
16
|
}
|
|
15
|
-
.mfui-
|
|
16
|
-
font-size: 15px;
|
|
17
|
+
.mfui-paragraph_space_wide {
|
|
17
18
|
line-height: 24px;
|
|
18
19
|
}
|
|
19
|
-
.mfui-
|
|
20
|
-
|
|
21
|
-
line-height: 16px;
|
|
20
|
+
.mfui-paragraph_space_tight {
|
|
21
|
+
line-height: 18px;
|
|
22
22
|
}
|
|
23
23
|
.mfui-paragraph_has-margin {
|
|
24
24
|
margin: 0 0 16px;
|
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
.mfui-paragraph_color_default {
|
|
30
30
|
color: var(--content);
|
|
31
31
|
}
|
|
32
|
+
.mfui-paragraph_color_gray {
|
|
33
|
+
color: var(--spbSky3);
|
|
34
|
+
}
|
|
32
35
|
.mfui-paragraph_color_white {
|
|
33
36
|
color: var(--stcWhite);
|
|
34
37
|
}
|
|
@@ -3,6 +3,7 @@ import './Paragraph.less';
|
|
|
3
3
|
declare const COLORS: {
|
|
4
4
|
readonly INHERIT: "inherit";
|
|
5
5
|
readonly DEFAULT: "default";
|
|
6
|
+
readonly GRAY: "gray";
|
|
6
7
|
readonly WHITE: "white";
|
|
7
8
|
readonly GREEN: "green";
|
|
8
9
|
readonly PURPLE: "purple";
|
|
@@ -11,9 +12,9 @@ declare type ColorType = typeof COLORS[keyof typeof COLORS];
|
|
|
11
12
|
export interface IParagraphProps {
|
|
12
13
|
/** Выравнивание по горизонтали */
|
|
13
14
|
align?: 'left' | 'center' | 'right';
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
/** Вертикальный отступ
|
|
15
|
+
/** Поведение текста при встраивании в широкий или узкий контейнер */
|
|
16
|
+
space?: 'wide' | 'tight';
|
|
17
|
+
/** Вертикальный отступ */
|
|
17
18
|
hasMargin?: boolean;
|
|
18
19
|
/** Цвет текста */
|
|
19
20
|
color?: ColorType;
|
|
@@ -26,6 +26,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
26
26
|
var COLORS = {
|
|
27
27
|
INHERIT: 'inherit',
|
|
28
28
|
DEFAULT: 'default',
|
|
29
|
+
GRAY: 'gray',
|
|
29
30
|
WHITE: 'white',
|
|
30
31
|
GREEN: 'green',
|
|
31
32
|
PURPLE: 'purple'
|
|
@@ -33,11 +34,11 @@ var COLORS = {
|
|
|
33
34
|
var cn = (0, _uiHelpers.cnCreate)('mfui-paragraph');
|
|
34
35
|
|
|
35
36
|
var Paragraph = function Paragraph(_ref) {
|
|
36
|
-
var
|
|
37
|
-
size = _ref$size === void 0 ? 'regular' : _ref$size,
|
|
38
|
-
align = _ref.align,
|
|
37
|
+
var align = _ref.align,
|
|
39
38
|
_ref$color = _ref.color,
|
|
40
39
|
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
40
|
+
_ref$space = _ref.space,
|
|
41
|
+
space = _ref$space === void 0 ? 'wide' : _ref$space,
|
|
41
42
|
className = _ref.className,
|
|
42
43
|
_ref$hasMargin = _ref.hasMargin,
|
|
43
44
|
hasMargin = _ref$hasMargin === void 0 ? true : _ref$hasMargin,
|
|
@@ -45,9 +46,9 @@ var Paragraph = function Paragraph(_ref) {
|
|
|
45
46
|
children = _ref.children;
|
|
46
47
|
return /*#__PURE__*/React.createElement("p", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
47
48
|
className: cn({
|
|
48
|
-
size: size,
|
|
49
49
|
align: align,
|
|
50
50
|
color: color,
|
|
51
|
+
space: space,
|
|
51
52
|
'has-margin': hasMargin
|
|
52
53
|
}, className)
|
|
53
54
|
}), children);
|
|
@@ -58,7 +59,7 @@ Paragraph.propTypes = {
|
|
|
58
59
|
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
59
60
|
}),
|
|
60
61
|
align: PropTypes.oneOf(['left', 'center', 'right']),
|
|
61
|
-
|
|
62
|
+
space: PropTypes.oneOf(['wide', 'tight']),
|
|
62
63
|
hasMargin: PropTypes.bool,
|
|
63
64
|
color: PropTypes.oneOf(Object.values(COLORS))
|
|
64
65
|
};
|
|
@@ -1,11 +1,37 @@
|
|
|
1
|
+
@-webkit-keyframes listAppear {
|
|
2
|
+
from {
|
|
3
|
+
-webkit-transform: translateY(-25px);
|
|
4
|
+
transform: translateY(-25px);
|
|
5
|
+
opacity: 0;
|
|
6
|
+
}
|
|
7
|
+
to {
|
|
8
|
+
-webkit-transform: translateY(0);
|
|
9
|
+
transform: translateY(0);
|
|
10
|
+
opacity: 1;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
@keyframes listAppear {
|
|
14
|
+
from {
|
|
15
|
+
-webkit-transform: translateY(-25px);
|
|
16
|
+
transform: translateY(-25px);
|
|
17
|
+
opacity: 0;
|
|
18
|
+
}
|
|
19
|
+
to {
|
|
20
|
+
-webkit-transform: translateY(0);
|
|
21
|
+
transform: translateY(0);
|
|
22
|
+
opacity: 1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
1
25
|
.mfui-search {
|
|
2
|
-
font-family: inherit;
|
|
3
|
-
font-size: 15px;
|
|
4
|
-
line-height: 24px;
|
|
5
26
|
position: relative;
|
|
6
27
|
z-index: auto;
|
|
28
|
+
-webkit-box-sizing: border-box;
|
|
29
|
+
box-sizing: border-box;
|
|
7
30
|
min-height: 40px;
|
|
8
31
|
color: var(--content);
|
|
32
|
+
font-family: inherit;
|
|
33
|
+
font-size: 15px;
|
|
34
|
+
line-height: 24px;
|
|
9
35
|
}
|
|
10
36
|
.mfui-search__require-mark {
|
|
11
37
|
margin-left: 1px;
|
|
@@ -22,20 +48,106 @@
|
|
|
22
48
|
-webkit-box-sizing: border-box;
|
|
23
49
|
box-sizing: border-box;
|
|
24
50
|
width: 100%;
|
|
25
|
-
height:
|
|
26
|
-
padding: 0 16px 0
|
|
51
|
+
height: 60px;
|
|
52
|
+
padding: 0 16px 0 16px;
|
|
27
53
|
border: 1px solid var(--spbSky2);
|
|
54
|
+
border-radius: 12px;
|
|
28
55
|
background-color: var(--base);
|
|
29
56
|
outline: none;
|
|
30
57
|
cursor: pointer;
|
|
58
|
+
-webkit-transition: border-color 0.3s;
|
|
59
|
+
transition: border-color 0.3s;
|
|
31
60
|
-webkit-user-select: none;
|
|
32
61
|
-moz-user-select: none;
|
|
33
62
|
-ms-user-select: none;
|
|
34
63
|
user-select: none;
|
|
35
64
|
}
|
|
65
|
+
.mfui-search__control:not(.mfui-search__control_success):not(.mfui-search__control_error):hover {
|
|
66
|
+
border-color: var(--content);
|
|
67
|
+
}
|
|
68
|
+
.mfui-search__control_success {
|
|
69
|
+
border-color: var(--brandGreen);
|
|
70
|
+
}
|
|
36
71
|
.mfui-search__control_error {
|
|
37
72
|
border-color: var(--fury);
|
|
38
73
|
}
|
|
74
|
+
.mfui-search__search-wrapper {
|
|
75
|
+
position: relative;
|
|
76
|
+
display: block;
|
|
77
|
+
width: 100%;
|
|
78
|
+
cursor: text;
|
|
79
|
+
}
|
|
80
|
+
.mfui-search__search-wrapper_labeled {
|
|
81
|
+
padding-top: 22px;
|
|
82
|
+
}
|
|
83
|
+
.mfui-search__label {
|
|
84
|
+
position: absolute;
|
|
85
|
+
top: 17px;
|
|
86
|
+
z-index: 1;
|
|
87
|
+
display: block;
|
|
88
|
+
overflow: auto;
|
|
89
|
+
color: var(--spbSky3);
|
|
90
|
+
-webkit-transition: top 0.5s, -webkit-transform 0.5s;
|
|
91
|
+
transition: top 0.5s, -webkit-transform 0.5s;
|
|
92
|
+
transition: transform 0.5s, top 0.5s;
|
|
93
|
+
transition: transform 0.5s, top 0.5s, -webkit-transform 0.5s;
|
|
94
|
+
pointer-events: none;
|
|
95
|
+
font-family: inherit;
|
|
96
|
+
font-size: 15px;
|
|
97
|
+
line-height: 24px;
|
|
98
|
+
}
|
|
99
|
+
.mfui-search__search-field::-webkit-input-placeholder {
|
|
100
|
+
color: var(--spbSky3);
|
|
101
|
+
opacity: 0;
|
|
102
|
+
-webkit-transition: opacity 0.2s;
|
|
103
|
+
transition: opacity 0.2s;
|
|
104
|
+
}
|
|
105
|
+
.mfui-search__search-field:-moz-placeholder {
|
|
106
|
+
color: var(--spbSky3);
|
|
107
|
+
opacity: 0;
|
|
108
|
+
-webkit-transition: opacity 0.2s;
|
|
109
|
+
transition: opacity 0.2s;
|
|
110
|
+
}
|
|
111
|
+
.mfui-search__search-field:-ms-input-placeholder {
|
|
112
|
+
color: var(--spbSky3);
|
|
113
|
+
opacity: 0;
|
|
114
|
+
-webkit-transition: opacity 0.2s;
|
|
115
|
+
transition: opacity 0.2s;
|
|
116
|
+
}
|
|
117
|
+
.mfui-search__search-field::-moz-placeholder {
|
|
118
|
+
color: var(--spbSky3);
|
|
119
|
+
opacity: 0;
|
|
120
|
+
-webkit-transition: opacity 0.2s;
|
|
121
|
+
transition: opacity 0.2s;
|
|
122
|
+
}
|
|
123
|
+
.mfui-search__search-field::-ms-input-placeholder {
|
|
124
|
+
color: var(--spbSky3);
|
|
125
|
+
opacity: 0;
|
|
126
|
+
-webkit-transition: opacity 0.2s;
|
|
127
|
+
transition: opacity 0.2s;
|
|
128
|
+
}
|
|
129
|
+
.mfui-search__search-field::placeholder {
|
|
130
|
+
color: var(--spbSky3);
|
|
131
|
+
opacity: 0;
|
|
132
|
+
-webkit-transition: opacity 0.2s;
|
|
133
|
+
transition: opacity 0.2s;
|
|
134
|
+
}
|
|
135
|
+
.mfui-search__search-wrapper_labeled .mfui-search__search-field:focus::-webkit-input-placeholder {
|
|
136
|
+
opacity: 1;
|
|
137
|
+
}
|
|
138
|
+
.mfui-search__search-wrapper_labeled .mfui-search__search-field:focus:-moz-placeholder {
|
|
139
|
+
opacity: 1;
|
|
140
|
+
}
|
|
141
|
+
.mfui-search__search-wrapper_labeled .mfui-search__search-field:focus:-ms-input-placeholder {
|
|
142
|
+
opacity: 1;
|
|
143
|
+
}
|
|
144
|
+
.mfui-search__search-field_filled + .mfui-search__label,
|
|
145
|
+
.mfui-search__search-field:focus + .mfui-search__label {
|
|
146
|
+
-webkit-transform: scale(0.8) translate(-12.5%, -75%);
|
|
147
|
+
transform: scale(0.8) translate(-12.5%, -75%);
|
|
148
|
+
-webkit-transition-duration: 0.2s, 0.01s;
|
|
149
|
+
transition-duration: 0.2s, 0.01s;
|
|
150
|
+
}
|
|
39
151
|
.mfui-search__search-field {
|
|
40
152
|
position: relative;
|
|
41
153
|
z-index: 1;
|
|
@@ -44,6 +156,7 @@
|
|
|
44
156
|
flex-grow: 1;
|
|
45
157
|
-webkit-box-sizing: border-box;
|
|
46
158
|
box-sizing: border-box;
|
|
159
|
+
width: 100%;
|
|
47
160
|
height: 100%;
|
|
48
161
|
padding: 0;
|
|
49
162
|
border: none;
|
|
@@ -73,9 +186,10 @@
|
|
|
73
186
|
left: -1px;
|
|
74
187
|
z-index: 0;
|
|
75
188
|
display: none;
|
|
189
|
+
border-radius: 12px;
|
|
76
190
|
background-color: var(--base);
|
|
77
|
-
-webkit-box-shadow: 0
|
|
78
|
-
box-shadow: 0
|
|
191
|
+
-webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
192
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
79
193
|
}
|
|
80
194
|
.mfui-search__icon {
|
|
81
195
|
display: block;
|
|
@@ -105,12 +219,13 @@
|
|
|
105
219
|
-webkit-box-sizing: border-box;
|
|
106
220
|
box-sizing: border-box;
|
|
107
221
|
max-height: 368px;
|
|
108
|
-
padding:
|
|
222
|
+
padding: 16px;
|
|
109
223
|
overflow-y: auto;
|
|
110
224
|
}
|
|
111
225
|
.mfui-search__list-item {
|
|
112
226
|
font-family: inherit;
|
|
113
227
|
padding: 8px 32px;
|
|
228
|
+
border-radius: 16px;
|
|
114
229
|
background-color: var(--base);
|
|
115
230
|
cursor: pointer;
|
|
116
231
|
}
|
|
@@ -141,7 +256,12 @@
|
|
|
141
256
|
}
|
|
142
257
|
.mfui-search_open .mfui-search__list {
|
|
143
258
|
display: block;
|
|
144
|
-
|
|
259
|
+
-webkit-animation-name: listAppear;
|
|
260
|
+
animation-name: listAppear;
|
|
261
|
+
-webkit-animation-duration: 0.3s;
|
|
262
|
+
animation-duration: 0.3s;
|
|
263
|
+
-webkit-animation-timing-function: ease-in-out;
|
|
264
|
+
animation-timing-function: ease-in-out;
|
|
145
265
|
}
|
|
146
266
|
.mfui-search_open {
|
|
147
267
|
z-index: 12;
|
|
@@ -24,6 +24,8 @@ export interface ISearchProps {
|
|
|
24
24
|
value?: string;
|
|
25
25
|
/** Заголовок поля */
|
|
26
26
|
label?: string;
|
|
27
|
+
/** HTML идентификатор поля поиска */
|
|
28
|
+
searchId?: string;
|
|
27
29
|
/** Текст внутри поля по умолчанию */
|
|
28
30
|
placeholder?: string;
|
|
29
31
|
/** Запрещает отрисовку иконки */
|