@megafon/ui-core 2.2.0 → 3.0.0-beta.3
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 +74 -0
- package/dist/es/colors/ColorItem/ColorItem.css +1 -8
- package/dist/es/colors/ColorItem/ColorItem.js +1 -1
- package/dist/es/colors/Colors.css +3 -11
- package/dist/es/colors/Colors.js +51 -4
- package/dist/es/colors/colorsData.js +78 -71
- package/dist/es/components/Accordion/Accordion.css +6 -12
- package/dist/es/components/Accordion/Accordion.d.ts +1 -1
- package/dist/es/components/Accordion/Accordion.js +10 -5
- package/dist/es/components/Banner/Banner.css +2 -9
- package/dist/es/components/Banner/BannerDot.css +4 -11
- package/dist/es/components/Button/Button.css +83 -74
- package/dist/es/components/Calendar/Calendar.css +0 -7
- package/dist/es/components/Calendar/components/Day/Day.css +10 -17
- package/dist/es/components/Calendar/components/Month/Month.css +3 -10
- package/dist/es/components/Calendar/components/Month/Month.js +21 -5
- package/dist/es/components/Carousel/Carousel.css +4 -11
- package/dist/es/components/Checkbox/Checkbox.css +18 -25
- package/dist/es/components/Checkbox/Checkbox.d.ts +3 -25
- package/dist/es/components/Checkbox/Checkbox.js +71 -89
- package/dist/es/components/ContentArea/ContentArea.css +61 -20
- package/dist/es/components/ContentArea/ContentArea.d.ts +0 -1
- package/dist/es/components/ContentArea/ContentArea.js +0 -1
- package/dist/es/components/Counter/Counter.css +61 -11
- package/dist/es/components/Grid/Grid.css +47 -0
- package/dist/es/components/Grid/GridColumn.css +0 -7
- package/dist/es/components/Header/Header.css +8 -12
- package/dist/es/components/Header/Header.d.ts +1 -1
- package/dist/es/components/Header/Header.js +2 -2
- package/dist/es/components/InputLabel/InputLabel.css +0 -7
- package/dist/es/components/List/List.css +9 -13
- package/dist/es/components/List/List.d.ts +1 -1
- package/dist/es/components/List/List.js +2 -2
- package/dist/es/components/List/ListItem.css +0 -7
- package/dist/es/components/Logo/Logo.css +0 -7
- package/dist/es/components/Logo/Logo.js +4 -8
- package/dist/es/components/NavArrow/NavArrow.css +5 -12
- package/dist/es/components/Notification/Notification.css +88 -24
- package/dist/es/components/Pagination/Pagination.css +0 -7
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.css +56 -9
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.css +47 -0
- package/dist/es/components/Paragraph/Paragraph.css +7 -17
- package/dist/es/components/Paragraph/Paragraph.d.ts +0 -1
- package/dist/es/components/Paragraph/Paragraph.js +1 -2
- package/dist/es/components/Preloader/Preloader.css +5 -12
- package/dist/es/components/RadioButton/RadioButton.css +7 -14
- package/dist/es/components/Search/Search.css +20 -25
- package/dist/es/components/Select/Select.css +29 -35
- package/dist/es/components/Select/Select.d.ts +1 -1
- package/dist/es/components/Switcher/Switcher.css +18 -28
- package/dist/es/components/Tabs/Tabs.css +30 -37
- package/dist/es/components/TextField/TextField.css +27 -33
- package/dist/es/components/TextLink/TextLink.css +10 -14
- package/dist/es/components/TextLink/TextLink.d.ts +1 -1
- package/dist/es/components/TextLink/TextLink.js +1 -1
- package/dist/es/components/Tile/Tile.css +2 -8
- package/dist/es/components/Tooltip/Tooltip.css +1 -8
- package/dist/es/components/Tooltip/Tooltip.d.ts +3 -2
- package/dist/es/components/Tooltip/Tooltip.js +2 -9
- package/dist/lib/colors/ColorItem/ColorItem.css +1 -8
- package/dist/lib/colors/ColorItem/ColorItem.js +1 -1
- package/dist/lib/colors/Colors.css +3 -11
- package/dist/lib/colors/Colors.js +53 -4
- package/dist/lib/colors/colorsData.js +78 -71
- package/dist/lib/components/Accordion/Accordion.css +6 -12
- package/dist/lib/components/Accordion/Accordion.d.ts +1 -1
- package/dist/lib/components/Accordion/Accordion.js +9 -4
- package/dist/lib/components/Banner/Banner.css +2 -9
- package/dist/lib/components/Banner/BannerDot.css +4 -11
- package/dist/lib/components/Button/Button.css +83 -74
- package/dist/lib/components/Calendar/Calendar.css +0 -7
- package/dist/lib/components/Calendar/components/Day/Day.css +10 -17
- package/dist/lib/components/Calendar/components/Month/Month.css +3 -10
- package/dist/lib/components/Calendar/components/Month/Month.js +20 -4
- package/dist/lib/components/Carousel/Carousel.css +4 -11
- package/dist/lib/components/Checkbox/Checkbox.css +18 -25
- package/dist/lib/components/Checkbox/Checkbox.d.ts +3 -25
- package/dist/lib/components/Checkbox/Checkbox.js +76 -124
- package/dist/lib/components/ContentArea/ContentArea.css +61 -20
- package/dist/lib/components/ContentArea/ContentArea.d.ts +0 -1
- package/dist/lib/components/ContentArea/ContentArea.js +0 -1
- package/dist/lib/components/Counter/Counter.css +61 -11
- package/dist/lib/components/Grid/Grid.css +47 -0
- package/dist/lib/components/Grid/GridColumn.css +0 -7
- package/dist/lib/components/Header/Header.css +8 -12
- package/dist/lib/components/Header/Header.d.ts +1 -1
- package/dist/lib/components/Header/Header.js +2 -2
- package/dist/lib/components/InputLabel/InputLabel.css +0 -7
- package/dist/lib/components/List/List.css +9 -13
- package/dist/lib/components/List/List.d.ts +1 -1
- package/dist/lib/components/List/List.js +2 -2
- package/dist/lib/components/List/ListItem.css +0 -7
- package/dist/lib/components/Logo/Logo.css +0 -7
- package/dist/lib/components/Logo/Logo.js +4 -8
- package/dist/lib/components/NavArrow/NavArrow.css +5 -12
- package/dist/lib/components/Notification/Notification.css +88 -24
- package/dist/lib/components/Pagination/Pagination.css +0 -7
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.css +56 -9
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.css +47 -0
- package/dist/lib/components/Paragraph/Paragraph.css +7 -17
- package/dist/lib/components/Paragraph/Paragraph.d.ts +0 -1
- package/dist/lib/components/Paragraph/Paragraph.js +1 -2
- package/dist/lib/components/Preloader/Preloader.css +5 -12
- package/dist/lib/components/RadioButton/RadioButton.css +7 -14
- package/dist/lib/components/Search/Search.css +20 -25
- package/dist/lib/components/Select/Select.css +29 -35
- package/dist/lib/components/Select/Select.d.ts +1 -1
- package/dist/lib/components/Switcher/Switcher.css +18 -28
- package/dist/lib/components/Tabs/Tabs.css +30 -37
- package/dist/lib/components/TextField/TextField.css +27 -33
- package/dist/lib/components/TextLink/TextLink.css +10 -14
- package/dist/lib/components/TextLink/TextLink.d.ts +1 -1
- package/dist/lib/components/TextLink/TextLink.js +1 -1
- package/dist/lib/components/Tile/Tile.css +2 -8
- package/dist/lib/components/Tooltip/Tooltip.css +1 -8
- package/dist/lib/components/Tooltip/Tooltip.d.ts +3 -2
- package/dist/lib/components/Tooltip/Tooltip.js +1 -8
- package/package.json +4 -4
- package/styles/base.css +54 -0
- package/styles/base.less +61 -73
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-text-link {
|
|
9
2
|
font-family: inherit;
|
|
10
3
|
font-size: inherit;
|
|
@@ -34,20 +27,23 @@ h5 {
|
|
|
34
27
|
.mfui-text-link_underline-style_none:hover {
|
|
35
28
|
text-decoration: none;
|
|
36
29
|
}
|
|
30
|
+
.mfui-text-link_color_default {
|
|
31
|
+
color: var(--content);
|
|
32
|
+
}
|
|
33
|
+
.mfui-text-link_color_black {
|
|
34
|
+
color: var(--stcBlack);
|
|
35
|
+
}
|
|
37
36
|
.mfui-text-link_color_white {
|
|
38
|
-
color:
|
|
37
|
+
color: var(--stcWhite);
|
|
39
38
|
}
|
|
40
39
|
.mfui-text-link_color_blue {
|
|
41
|
-
color:
|
|
40
|
+
color: var(--systemBlue);
|
|
42
41
|
}
|
|
43
42
|
.mfui-text-link_color_green {
|
|
44
|
-
color:
|
|
45
|
-
}
|
|
46
|
-
.mfui-text-link_color_black {
|
|
47
|
-
color: #333333;
|
|
43
|
+
color: var(--brandGreen);
|
|
48
44
|
}
|
|
49
45
|
.mfui-text-link_color_gray {
|
|
50
|
-
color:
|
|
46
|
+
color: var(--spbSky3);
|
|
51
47
|
}
|
|
52
48
|
.mfui-text-link_color_inherit {
|
|
53
49
|
color: inherit;
|
|
@@ -3,7 +3,7 @@ import './TextLink.less';
|
|
|
3
3
|
import { ILinkProps } from '../Link/Link';
|
|
4
4
|
export interface ITextLinkProps extends ILinkProps {
|
|
5
5
|
/** Цвет */
|
|
6
|
-
color?: 'white' | 'black' | 'gray' | '
|
|
6
|
+
color?: 'default' | 'white' | 'black' | 'gray' | 'green' | 'blue' | 'inherit';
|
|
7
7
|
/** Отображение подчеркивания */
|
|
8
8
|
underlineVisibility?: 'hover' | 'always';
|
|
9
9
|
/** Стиль подчеркивания */
|
|
@@ -31,7 +31,7 @@ var TextLink = function TextLink(_ref) {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
TextLink.propTypes = {
|
|
34
|
-
color: PropTypes.oneOf(['
|
|
34
|
+
color: PropTypes.oneOf(['default', 'white', 'black', 'gray', 'green', 'inherit']),
|
|
35
35
|
underlineVisibility: PropTypes.oneOf(['hover', 'always']),
|
|
36
36
|
underlineStyle: PropTypes.oneOf(['solid', 'dashed', 'border', 'none']),
|
|
37
37
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element), PropTypes.element, PropTypes.string, PropTypes.node])
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-tooltip {
|
|
9
2
|
z-index: 100;
|
|
10
3
|
visibility: hidden;
|
|
@@ -48,7 +41,7 @@ h5 {
|
|
|
48
41
|
left: 0;
|
|
49
42
|
-webkit-transform: rotate(45deg);
|
|
50
43
|
transform: rotate(45deg);
|
|
51
|
-
background-color:
|
|
44
|
+
background-color: var(--base);
|
|
52
45
|
}
|
|
53
46
|
.mfui-tooltip__arrow-shadow {
|
|
54
47
|
width: 12px;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { AccessibilityEventTypeNative } from '@megafon/ui-helpers';
|
|
2
3
|
import './Tooltip.less';
|
|
3
4
|
export declare const Placement: {
|
|
4
5
|
readonly LEFT: "left";
|
|
@@ -46,9 +47,9 @@ export interface ITooltipProps {
|
|
|
46
47
|
contentShadow?: string;
|
|
47
48
|
};
|
|
48
49
|
/** Обработчик на открытие */
|
|
49
|
-
onOpen?: (e:
|
|
50
|
+
onOpen?: (e: AccessibilityEventTypeNative) => void;
|
|
50
51
|
/** Обработчик на закрытие */
|
|
51
|
-
onClose?: (e:
|
|
52
|
+
onClose?: (e: AccessibilityEventTypeNative | FocusEvent) => void;
|
|
52
53
|
}
|
|
53
54
|
declare const Tooltip: React.FC<ITooltipProps>;
|
|
54
55
|
export default Tooltip;
|
|
@@ -4,15 +4,13 @@ import _typeof from "@babel/runtime/helpers/typeof";
|
|
|
4
4
|
import _extends from "@babel/runtime/helpers/extends";
|
|
5
5
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
6
6
|
import React, { useState, useCallback, useEffect, useMemo } from 'react';
|
|
7
|
-
import { cnCreate, detectTouch } from '@megafon/ui-helpers';
|
|
7
|
+
import { cnCreate, detectTouch, checkNativeEventIsClickOrEnterPress } from '@megafon/ui-helpers';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import { usePopper } from 'react-popper';
|
|
10
10
|
import Tile from "../Tile/Tile";
|
|
11
11
|
import "./Tooltip.css";
|
|
12
12
|
var TOOLTIP_PADDING_FOR_FLIP = 14;
|
|
13
13
|
var MOUSE_KEY = 'mousedown';
|
|
14
|
-
var KEYBOARD_ENTER_KEY = 'Enter';
|
|
15
|
-
var KEYBOARD_NUMPAD_ENTER_KEY = 'NumpadEnter';
|
|
16
14
|
var TOUCH_KEY = 'touchstart';
|
|
17
15
|
export var Placement = {
|
|
18
16
|
LEFT: 'left',
|
|
@@ -20,11 +18,6 @@ export var Placement = {
|
|
|
20
18
|
RIGHT: 'right',
|
|
21
19
|
BOTTOM: 'bottom'
|
|
22
20
|
};
|
|
23
|
-
|
|
24
|
-
var checkEventIsClickOrEnterPress = function checkEventIsClickOrEnterPress(e) {
|
|
25
|
-
return e.type === TOUCH_KEY || e.type === MOUSE_KEY || e.code === KEYBOARD_ENTER_KEY || e.code === KEYBOARD_NUMPAD_ENTER_KEY;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
21
|
export var Paddings = {
|
|
29
22
|
NONE: 'none',
|
|
30
23
|
SMALL: 'small',
|
|
@@ -142,7 +135,7 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
142
135
|
}
|
|
143
136
|
}, [isOpen, onOpen, setIsOpen]);
|
|
144
137
|
var handleClick = useCallback(function (e) {
|
|
145
|
-
if (!
|
|
138
|
+
if (!checkNativeEventIsClickOrEnterPress(e)) {
|
|
146
139
|
return;
|
|
147
140
|
}
|
|
148
141
|
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.color-item {
|
|
9
2
|
display: -webkit-box;
|
|
10
3
|
display: -ms-flexbox;
|
|
@@ -46,7 +39,7 @@ h5 {
|
|
|
46
39
|
line-height: 20px;
|
|
47
40
|
}
|
|
48
41
|
.color-item__code {
|
|
49
|
-
color:
|
|
42
|
+
color: var(--spbSky3);
|
|
50
43
|
font-size: 12px;
|
|
51
44
|
line-height: 18px;
|
|
52
45
|
}
|
|
@@ -37,7 +37,7 @@ var ColorItem = function ColorItem(_ref) {
|
|
|
37
37
|
}), !!parentColorCode && /*#__PURE__*/React.createElement("div", {
|
|
38
38
|
className: cn('parent-color'),
|
|
39
39
|
style: {
|
|
40
|
-
background: parentColorCode
|
|
40
|
+
background: "var(--".concat(parentColorCode, ")")
|
|
41
41
|
}
|
|
42
42
|
})), /*#__PURE__*/React.createElement("span", {
|
|
43
43
|
className: cn('name')
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.colors__inner {
|
|
9
2
|
margin: 0 -80px;
|
|
10
3
|
padding: 56px 80px 40px;
|
|
11
|
-
background-color:
|
|
4
|
+
background-color: var(--spbSky0);
|
|
12
5
|
}
|
|
13
6
|
@media screen and (max-width: 1120px) {
|
|
14
7
|
.colors__inner {
|
|
@@ -90,7 +83,6 @@ h5 {
|
|
|
90
83
|
.colors__description {
|
|
91
84
|
position: relative;
|
|
92
85
|
padding-top: 15px;
|
|
93
|
-
color: #33333380;
|
|
94
86
|
font-size: 12px;
|
|
95
87
|
line-height: 18px;
|
|
96
88
|
text-align: center;
|
|
@@ -198,7 +190,7 @@ h5 {
|
|
|
198
190
|
display: block;
|
|
199
191
|
width: 100%;
|
|
200
192
|
height: 1px;
|
|
201
|
-
background-color:
|
|
193
|
+
background-color: var(--spbSky2);
|
|
202
194
|
-webkit-transform: translateY(-50%);
|
|
203
195
|
transform: translateY(-50%);
|
|
204
196
|
}
|
|
@@ -209,7 +201,7 @@ h5 {
|
|
|
209
201
|
position: absolute;
|
|
210
202
|
width: 1px;
|
|
211
203
|
height: 4px;
|
|
212
|
-
background-color:
|
|
204
|
+
background-color: var(--spbSky2);
|
|
213
205
|
}
|
|
214
206
|
.colors__underline:after,
|
|
215
207
|
.colors__underline:before {
|
|
@@ -11,10 +11,14 @@ require("core-js/modules/es.symbol");
|
|
|
11
11
|
|
|
12
12
|
require("core-js/modules/es.symbol.description");
|
|
13
13
|
|
|
14
|
+
require("core-js/modules/es.array.includes");
|
|
15
|
+
|
|
14
16
|
require("core-js/modules/es.array.map");
|
|
15
17
|
|
|
16
18
|
require("core-js/modules/es.function.name");
|
|
17
19
|
|
|
20
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
21
|
+
|
|
18
22
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
19
23
|
|
|
20
24
|
var React = _interopRequireWildcard(require("react"));
|
|
@@ -130,10 +134,55 @@ var basic = _colorsData["default"].basic,
|
|
|
130
134
|
gradientColors = _colorsData["default"].gradientColors,
|
|
131
135
|
staticColors = _colorsData["default"].staticColors,
|
|
132
136
|
staticOpacity = _colorsData["default"].staticOpacity,
|
|
133
|
-
soft = _colorsData["default"].soft;
|
|
137
|
+
soft = _colorsData["default"].soft; // TODO: refactor this
|
|
138
|
+
|
|
139
|
+
var getThemeFromLocalStorage = function getThemeFromLocalStorage() {
|
|
140
|
+
var theme = 'light';
|
|
141
|
+
|
|
142
|
+
if (typeof window !== 'undefined') {
|
|
143
|
+
var localStorageTheme = String(window.localStorage.getItem('theme'));
|
|
144
|
+
|
|
145
|
+
if (['light', 'dark'].includes(localStorageTheme)) {
|
|
146
|
+
theme = localStorageTheme;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return theme;
|
|
151
|
+
};
|
|
152
|
+
|
|
134
153
|
var cn = (0, _uiHelpers.cnCreate)('colors');
|
|
135
154
|
|
|
136
155
|
var Colors = function Colors() {
|
|
156
|
+
var _React$useState = React.useState(getThemeFromLocalStorage()),
|
|
157
|
+
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
158
|
+
setCurrentTheme = _React$useState2[1];
|
|
159
|
+
|
|
160
|
+
var getCurrentColorValue = function getCurrentColorValue(code) {
|
|
161
|
+
return typeof document !== 'undefined' ? document.documentElement.style.getPropertyValue("--".concat(code)) : '';
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
React.useEffect(function () {
|
|
165
|
+
// theme switcher from src/gatsby-theme-docz/components/SideBar/index.tsx
|
|
166
|
+
var themeSwitcher = document.querySelector('[data-current-theme]');
|
|
167
|
+
|
|
168
|
+
if (themeSwitcher) {
|
|
169
|
+
var themeSwitcherObserver = new MutationObserver(function (mutationsList) {
|
|
170
|
+
var data = mutationsList[0];
|
|
171
|
+
setCurrentTheme(data.oldValue === 'light' ? 'dark' : 'light');
|
|
172
|
+
});
|
|
173
|
+
var config = {
|
|
174
|
+
attributeOldValue: true,
|
|
175
|
+
attributeFilter: ['data-current-theme']
|
|
176
|
+
};
|
|
177
|
+
themeSwitcherObserver.observe(themeSwitcher, config);
|
|
178
|
+
return function () {
|
|
179
|
+
return themeSwitcherObserver.disconnect();
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return undefined;
|
|
184
|
+
}, []);
|
|
185
|
+
|
|
137
186
|
var renderUnderline = function renderUnderline() {
|
|
138
187
|
return /*#__PURE__*/React.createElement("div", {
|
|
139
188
|
className: cn('underline')
|
|
@@ -169,7 +218,7 @@ var Colors = function Colors() {
|
|
|
169
218
|
return /*#__PURE__*/React.createElement(_ColorItem["default"], {
|
|
170
219
|
className: cn('item'),
|
|
171
220
|
colorName: name,
|
|
172
|
-
colorCode: code,
|
|
221
|
+
colorCode: getCurrentColorValue(code),
|
|
173
222
|
key: name,
|
|
174
223
|
border: border
|
|
175
224
|
});
|
|
@@ -199,7 +248,7 @@ var Colors = function Colors() {
|
|
|
199
248
|
return /*#__PURE__*/React.createElement(_ColorItem["default"], {
|
|
200
249
|
className: cn('item'),
|
|
201
250
|
colorName: name,
|
|
202
|
-
colorCode: code,
|
|
251
|
+
colorCode: getCurrentColorValue(code),
|
|
203
252
|
gradient: gradient,
|
|
204
253
|
key: name,
|
|
205
254
|
border: border
|
|
@@ -231,7 +280,7 @@ var Colors = function Colors() {
|
|
|
231
280
|
soft: true
|
|
232
281
|
}),
|
|
233
282
|
colorName: name,
|
|
234
|
-
colorCode: code,
|
|
283
|
+
colorCode: getCurrentColorValue(code),
|
|
235
284
|
parentColorCode: parentColor,
|
|
236
285
|
key: name
|
|
237
286
|
});
|
|
@@ -10,34 +10,35 @@ var colors = {
|
|
|
10
10
|
colorsGroup: [{
|
|
11
11
|
description: 'Основные цвета бренда',
|
|
12
12
|
colors: [{
|
|
13
|
-
name: 'Green',
|
|
14
|
-
code: '
|
|
13
|
+
name: 'Brand Green',
|
|
14
|
+
code: 'brandGreen'
|
|
15
15
|
}, {
|
|
16
|
-
name: 'Purple',
|
|
17
|
-
code: '
|
|
16
|
+
name: 'Brand Purple',
|
|
17
|
+
code: 'brandPurple'
|
|
18
18
|
}]
|
|
19
19
|
}, {
|
|
20
20
|
description: 'Градация оттенков серого',
|
|
21
21
|
colors: [{
|
|
22
22
|
name: 'Base',
|
|
23
|
-
code: '
|
|
24
|
-
border: '1px solid
|
|
23
|
+
code: 'base',
|
|
24
|
+
border: '1px solid var(--spbSky1)'
|
|
25
25
|
}, {
|
|
26
26
|
name: 'Content',
|
|
27
|
-
code: '
|
|
27
|
+
code: 'content',
|
|
28
|
+
border: '1px solid var(--spbSky1)'
|
|
28
29
|
}, {
|
|
29
30
|
name: 'Spb Sky 0',
|
|
30
|
-
code: '
|
|
31
|
-
border: '2px solid
|
|
31
|
+
code: 'spbSky0',
|
|
32
|
+
border: '2px solid var(--spbSky1)'
|
|
32
33
|
}, {
|
|
33
34
|
name: 'Spb Sky 1',
|
|
34
|
-
code: '
|
|
35
|
+
code: 'spbSky1'
|
|
35
36
|
}, {
|
|
36
37
|
name: 'Spb Sky 2',
|
|
37
|
-
code: '
|
|
38
|
+
code: 'spbSky2'
|
|
38
39
|
}, {
|
|
39
40
|
name: 'Spb Sky 3',
|
|
40
|
-
code: '
|
|
41
|
+
code: 'spbSky3'
|
|
41
42
|
}]
|
|
42
43
|
}]
|
|
43
44
|
},
|
|
@@ -47,16 +48,16 @@ var colors = {
|
|
|
47
48
|
description: 'Акцентные цвета',
|
|
48
49
|
colors: [{
|
|
49
50
|
name: 'Warm Red C',
|
|
50
|
-
code: '
|
|
51
|
+
code: 'warmRedC'
|
|
51
52
|
}, {
|
|
52
53
|
name: '137C',
|
|
53
|
-
code: '
|
|
54
|
+
code: '137C'
|
|
54
55
|
}, {
|
|
55
56
|
name: '311C',
|
|
56
|
-
code: '
|
|
57
|
+
code: '311C'
|
|
57
58
|
}, {
|
|
58
59
|
name: 'Reflex Blue',
|
|
59
|
-
code: '
|
|
60
|
+
code: 'reflexBlue'
|
|
60
61
|
}]
|
|
61
62
|
}
|
|
62
63
|
},
|
|
@@ -66,22 +67,22 @@ var colors = {
|
|
|
66
67
|
description: 'Системные цвета, используемые для отображения состояний интерфейсов и ссылок',
|
|
67
68
|
colors: [{
|
|
68
69
|
name: 'Fury',
|
|
69
|
-
code: '
|
|
70
|
+
code: 'fury'
|
|
70
71
|
}, {
|
|
71
72
|
name: 'System Blue',
|
|
72
|
-
code: '
|
|
73
|
+
code: 'systemBlue'
|
|
73
74
|
}, {
|
|
74
75
|
name: 'Background',
|
|
75
|
-
code: '
|
|
76
|
+
code: 'background'
|
|
76
77
|
}, {
|
|
77
78
|
name: 'Button Hov. G.',
|
|
78
|
-
code: '
|
|
79
|
+
code: 'buttonHoverGreen'
|
|
79
80
|
}, {
|
|
80
81
|
name: 'Button Hov. P.',
|
|
81
|
-
code: '
|
|
82
|
+
code: 'buttonhoverPurple'
|
|
82
83
|
}, {
|
|
83
84
|
name: 'Button Down',
|
|
84
|
-
code: '
|
|
85
|
+
code: 'buttonDown'
|
|
85
86
|
}]
|
|
86
87
|
}
|
|
87
88
|
},
|
|
@@ -91,15 +92,15 @@ var colors = {
|
|
|
91
92
|
description: 'Градиентные заливки ',
|
|
92
93
|
colors: [{
|
|
93
94
|
name: 'Basic',
|
|
94
|
-
code: '
|
|
95
|
+
code: 'gradientBasic',
|
|
95
96
|
gradient: 'linear-gradient(90deg, #01873F 0%, #00B956 74%, #14CD6A 100%)'
|
|
96
97
|
}, {
|
|
97
98
|
name: 'VIP',
|
|
98
|
-
code: '
|
|
99
|
+
code: 'gradientVIP',
|
|
99
100
|
gradient: 'linear-gradient(90deg, #5B1168 0%, #731982 74%, #821E93 100%)'
|
|
100
101
|
}, {
|
|
101
102
|
name: 'Exclusive',
|
|
102
|
-
code: '
|
|
103
|
+
code: 'gradientExclusive',
|
|
103
104
|
gradient: 'linear-gradient(90deg, #2A2674 0%, #444189 74%, #504D93 100%)'
|
|
104
105
|
}]
|
|
105
106
|
}
|
|
@@ -110,11 +111,12 @@ var colors = {
|
|
|
110
111
|
description: 'Цвета не зависящие от темы',
|
|
111
112
|
colors: [{
|
|
112
113
|
name: 'STC White',
|
|
113
|
-
code: '
|
|
114
|
-
border: '1px solid
|
|
114
|
+
code: 'stcWhite',
|
|
115
|
+
border: '1px solid var(--spbSky1)'
|
|
115
116
|
}, {
|
|
116
117
|
name: 'STC Black',
|
|
117
|
-
code: '
|
|
118
|
+
code: 'stcBlack',
|
|
119
|
+
border: '1px solid var(--spbSky1)'
|
|
118
120
|
}]
|
|
119
121
|
}
|
|
120
122
|
},
|
|
@@ -124,31 +126,36 @@ var colors = {
|
|
|
124
126
|
description: 'Цвета c прозрачностью не зависящие от темы',
|
|
125
127
|
colors: [{
|
|
126
128
|
name: 'STC White 5%',
|
|
127
|
-
code: '
|
|
128
|
-
border: '1px solid
|
|
129
|
+
code: 'stcWhite5',
|
|
130
|
+
border: '1px solid var(--spbSky1)'
|
|
129
131
|
}, {
|
|
130
132
|
name: 'STC White 10%',
|
|
131
|
-
code: '
|
|
132
|
-
border: '1px solid
|
|
133
|
+
code: 'stcWhite10',
|
|
134
|
+
border: '1px solid var(--spbSky1)'
|
|
133
135
|
}, {
|
|
134
136
|
name: 'STC White 20%',
|
|
135
|
-
code: '
|
|
136
|
-
border: '1px solid
|
|
137
|
+
code: 'stcWhite20',
|
|
138
|
+
border: '1px solid var(--spbSky1)'
|
|
137
139
|
}, {
|
|
138
140
|
name: 'STC White 50%',
|
|
139
|
-
code: '
|
|
141
|
+
code: 'stcWhite50',
|
|
142
|
+
border: '1px solid var(--spbSky1)'
|
|
140
143
|
}, {
|
|
141
144
|
name: 'STC Black 5%',
|
|
142
|
-
code: '
|
|
145
|
+
code: 'stcBlack5',
|
|
146
|
+
border: '1px solid var(--spbSky1)'
|
|
143
147
|
}, {
|
|
144
148
|
name: 'STC Black 10%',
|
|
145
|
-
code: '
|
|
149
|
+
code: 'stcBlack10',
|
|
150
|
+
border: '1px solid var(--spbSky1)'
|
|
146
151
|
}, {
|
|
147
152
|
name: 'STC Black 20%',
|
|
148
|
-
code: '
|
|
153
|
+
code: 'stcBlack20',
|
|
154
|
+
border: '1px solid var(--spbSky1)'
|
|
149
155
|
}, {
|
|
150
156
|
name: 'STC Black 50%',
|
|
151
|
-
code: '
|
|
157
|
+
code: 'stcBlack50',
|
|
158
|
+
border: '1px solid var(--spbSky1)'
|
|
152
159
|
}]
|
|
153
160
|
}
|
|
154
161
|
},
|
|
@@ -157,61 +164,61 @@ var colors = {
|
|
|
157
164
|
colorsList: {
|
|
158
165
|
description: 'Дополнительная (вспомогательная) палитра, образованная от Basic, Secondary и System цветов. Каждый цвет из Soft палитры работает в паре с его родительским цветом.',
|
|
159
166
|
colors: [{
|
|
160
|
-
name: 'Green 80',
|
|
161
|
-
code: '
|
|
162
|
-
parentColor: '
|
|
167
|
+
name: 'Brand Green 80',
|
|
168
|
+
code: 'brandGreen80',
|
|
169
|
+
parentColor: 'green'
|
|
163
170
|
}, {
|
|
164
|
-
name: 'Purple 80',
|
|
165
|
-
code: '
|
|
166
|
-
parentColor: '
|
|
171
|
+
name: 'Brand Purple 80',
|
|
172
|
+
code: 'brandPurple80',
|
|
173
|
+
parentColor: 'purple'
|
|
167
174
|
}, {
|
|
168
175
|
name: 'Warm Red C 80',
|
|
169
|
-
code: '
|
|
170
|
-
parentColor: '
|
|
176
|
+
code: 'warmRedC80',
|
|
177
|
+
parentColor: 'warmRedC'
|
|
171
178
|
}, {
|
|
172
179
|
name: '137C 80',
|
|
173
|
-
code: '
|
|
174
|
-
parentColor: '
|
|
180
|
+
code: '137C80',
|
|
181
|
+
parentColor: '137C'
|
|
175
182
|
}, {
|
|
176
183
|
name: '311C 80',
|
|
177
|
-
code: '
|
|
178
|
-
parentColor: '
|
|
184
|
+
code: '311C80',
|
|
185
|
+
parentColor: '311C'
|
|
179
186
|
}, {
|
|
180
187
|
name: 'Reflex Blue 80',
|
|
181
|
-
code: '
|
|
182
|
-
parentColor: '
|
|
188
|
+
code: 'reflexBlue80',
|
|
189
|
+
parentColor: 'reflexBlue'
|
|
183
190
|
}, {
|
|
184
191
|
name: 'Fury 80',
|
|
185
|
-
code: '
|
|
186
|
-
parentColor: '
|
|
192
|
+
code: 'fury80',
|
|
193
|
+
parentColor: 'fury'
|
|
187
194
|
}, {
|
|
188
|
-
name: 'Green 20',
|
|
189
|
-
code: '
|
|
190
|
-
parentColor: '
|
|
195
|
+
name: 'Brand Green 20',
|
|
196
|
+
code: 'brandGreen20',
|
|
197
|
+
parentColor: 'green'
|
|
191
198
|
}, {
|
|
192
|
-
name: 'Purple 20',
|
|
193
|
-
code: '
|
|
194
|
-
parentColor: '
|
|
199
|
+
name: 'Brand Purple 20',
|
|
200
|
+
code: 'brandPurple20',
|
|
201
|
+
parentColor: 'purple'
|
|
195
202
|
}, {
|
|
196
203
|
name: 'Warm Red C 20',
|
|
197
|
-
code: '
|
|
198
|
-
parentColor: '
|
|
204
|
+
code: 'warmRedC20',
|
|
205
|
+
parentColor: 'warmRedC'
|
|
199
206
|
}, {
|
|
200
207
|
name: '137C 20',
|
|
201
|
-
code: '
|
|
202
|
-
parentColor: '
|
|
208
|
+
code: '137C20',
|
|
209
|
+
parentColor: '137C'
|
|
203
210
|
}, {
|
|
204
211
|
name: '311C 20',
|
|
205
|
-
code: '
|
|
206
|
-
parentColor: '
|
|
212
|
+
code: '311C20',
|
|
213
|
+
parentColor: '311C'
|
|
207
214
|
}, {
|
|
208
215
|
name: 'Reflex Blue 20',
|
|
209
|
-
code: '
|
|
210
|
-
parentColor: '
|
|
216
|
+
code: 'reflexBlue20',
|
|
217
|
+
parentColor: 'reflexBlue'
|
|
211
218
|
}, {
|
|
212
219
|
name: 'Fury 20',
|
|
213
|
-
code: '
|
|
214
|
-
parentColor: '
|
|
220
|
+
code: 'fury20',
|
|
221
|
+
parentColor: 'fury'
|
|
215
222
|
}]
|
|
216
223
|
}
|
|
217
224
|
}
|
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-accordion {
|
|
9
|
-
border-top: 1px solid
|
|
10
|
-
border-bottom: 1px solid
|
|
2
|
+
border-top: 1px solid var(--spbSky2);
|
|
3
|
+
border-bottom: 1px solid var(--spbSky2);
|
|
11
4
|
}
|
|
12
5
|
.mfui-accordion + .mfui-accordion {
|
|
13
6
|
border-top: none;
|
|
14
7
|
}
|
|
15
8
|
.mfui-accordion:not(.mfui-accordion_open) .mfui-accordion__title-wrap:hover {
|
|
16
|
-
background:
|
|
9
|
+
background: var(--spbSky0);
|
|
17
10
|
}
|
|
18
11
|
.mfui-accordion.mfui-accordion_open .mfui-accordion__title-wrap {
|
|
19
|
-
background:
|
|
12
|
+
background: var(--spbSky1);
|
|
20
13
|
}
|
|
21
14
|
.mfui-accordion__title-wrap {
|
|
22
15
|
position: relative;
|
|
@@ -42,6 +35,7 @@ h5 {
|
|
|
42
35
|
-webkit-transform: translateY(-50%);
|
|
43
36
|
transform: translateY(-50%);
|
|
44
37
|
opacity: 1;
|
|
38
|
+
fill: var(--content);
|
|
45
39
|
}
|
|
46
40
|
.mfui-accordion__content-inner {
|
|
47
41
|
padding: 24px 16px;
|
|
@@ -66,5 +60,5 @@ h5 {
|
|
|
66
60
|
padding-bottom: 24px;
|
|
67
61
|
}
|
|
68
62
|
.mfui-accordion__icon {
|
|
69
|
-
fill:
|
|
63
|
+
fill: var(--content);
|
|
70
64
|
}
|
|
@@ -20,7 +20,7 @@ export interface IAccordionProps extends IFilterDataAttrs {
|
|
|
20
20
|
titleWrap?: string;
|
|
21
21
|
};
|
|
22
22
|
/** Обработчик клика */
|
|
23
|
-
onClickAccordion?: (isOpened: boolean
|
|
23
|
+
onClickAccordion?: (isOpened: boolean) => void;
|
|
24
24
|
}
|
|
25
25
|
declare const Accordion: React.FC<IAccordionProps>;
|
|
26
26
|
export default Accordion;
|
|
@@ -72,9 +72,11 @@ var Accordion = function Accordion(_ref) {
|
|
|
72
72
|
setIsOpenedState(isOpened);
|
|
73
73
|
}, [isOpened]);
|
|
74
74
|
|
|
75
|
-
var handleClickTitle = function handleClickTitle() {
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
var handleClickTitle = function handleClickTitle(e) {
|
|
76
|
+
if ((0, _uiHelpers.checkEventIsClickOrEnterPress)(e)) {
|
|
77
|
+
onClickAccordion && onClickAccordion(!isOpenedState);
|
|
78
|
+
setIsOpenedState(!isOpenedState);
|
|
79
|
+
}
|
|
78
80
|
};
|
|
79
81
|
|
|
80
82
|
var openedClassName = isOpenedState ? openedClass : undefined;
|
|
@@ -85,10 +87,13 @@ var Accordion = function Accordion(_ref) {
|
|
|
85
87
|
}, [className, rootPropsClasses, openedClassName])
|
|
86
88
|
}), /*#__PURE__*/React.createElement("div", {
|
|
87
89
|
className: cn('title-wrap', [titleWrapPropsClasses]),
|
|
88
|
-
onClick: handleClickTitle
|
|
90
|
+
onClick: handleClickTitle,
|
|
91
|
+
onKeyDown: handleClickTitle
|
|
89
92
|
}, /*#__PURE__*/React.createElement(_Header["default"], {
|
|
90
93
|
as: "h5"
|
|
91
94
|
}, title), /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
tabIndex: 0,
|
|
96
|
+
role: "button",
|
|
92
97
|
className: cn('icon-box', {
|
|
93
98
|
open: isOpenedState
|
|
94
99
|
})
|