@megafon/ui-core 4.6.0 → 4.8.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/es/components/Accordion/Accordion.css +1 -0
  3. package/dist/es/components/Banner/BannerDot.d.ts +2 -0
  4. package/dist/es/components/Banner/BannerDot.js +6 -4
  5. package/dist/es/components/Button/Button.d.ts +2 -0
  6. package/dist/es/components/Button/Button.js +7 -5
  7. package/dist/es/components/Notification/Notification.d.ts +4 -0
  8. package/dist/es/components/Notification/Notification.js +7 -1
  9. package/dist/es/components/Search/Search.css +14 -0
  10. package/dist/es/components/Select/Select.css +2 -0
  11. package/dist/es/components/Tabs/Tabs.css +8 -5
  12. package/dist/es/components/Tabs/Tabs.d.ts +1 -0
  13. package/dist/es/components/Tabs/Tabs.js +4 -2
  14. package/dist/es/components/TextField/TextField.css +7 -0
  15. package/dist/es/components/TextField/TextField.js +3 -1
  16. package/dist/es/components/Tile/Tile.css +22 -6
  17. package/dist/es/components/Tile/Tile.d.ts +9 -5
  18. package/dist/es/components/Tile/Tile.js +11 -4
  19. package/dist/es/components/Tooltip/Tooltip.css +242 -71
  20. package/dist/es/components/Tooltip/Tooltip.d.ts +38 -0
  21. package/dist/es/components/Tooltip/Tooltip.js +162 -49
  22. package/dist/lib/components/Accordion/Accordion.css +1 -0
  23. package/dist/lib/components/Banner/BannerDot.d.ts +2 -0
  24. package/dist/lib/components/Banner/BannerDot.js +6 -4
  25. package/dist/lib/components/Button/Button.d.ts +2 -0
  26. package/dist/lib/components/Button/Button.js +7 -5
  27. package/dist/lib/components/Notification/Notification.d.ts +4 -0
  28. package/dist/lib/components/Notification/Notification.js +7 -1
  29. package/dist/lib/components/Search/Search.css +14 -0
  30. package/dist/lib/components/Select/Select.css +2 -0
  31. package/dist/lib/components/Tabs/Tabs.css +8 -5
  32. package/dist/lib/components/Tabs/Tabs.d.ts +1 -0
  33. package/dist/lib/components/Tabs/Tabs.js +4 -2
  34. package/dist/lib/components/TextField/TextField.css +7 -0
  35. package/dist/lib/components/TextField/TextField.js +3 -1
  36. package/dist/lib/components/Tile/Tile.css +22 -6
  37. package/dist/lib/components/Tile/Tile.d.ts +9 -5
  38. package/dist/lib/components/Tile/Tile.js +13 -6
  39. package/dist/lib/components/Tooltip/Tooltip.css +242 -71
  40. package/dist/lib/components/Tooltip/Tooltip.d.ts +38 -0
  41. package/dist/lib/components/Tooltip/Tooltip.js +168 -52
  42. package/package.json +2 -2
@@ -1,23 +1,61 @@
1
1
  import "core-js/modules/es.array.concat";
2
2
  import "core-js/modules/es.object.values";
3
3
  import _typeof from "@babel/runtime/helpers/typeof";
4
- import _extends from "@babel/runtime/helpers/extends";
5
4
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
+ import _extends from "@babel/runtime/helpers/extends";
6
6
  import React, { useState, useCallback, useEffect, useMemo } from 'react';
7
7
  import { cnCreate, detectTouch, checkNativeEventIsClickOrEnterPress, filterDataAttrs } from '@megafon/ui-helpers';
8
8
  import PropTypes from 'prop-types';
9
9
  import ReactDOM from 'react-dom';
10
10
  import { usePopper } from 'react-popper';
11
+ import Header from "../Header/Header";
11
12
  import Tile from "../Tile/Tile";
12
13
  import "./Tooltip.css";
14
+
15
+ var RightArrow = function RightArrow(props) {
16
+ return /*#__PURE__*/React.createElement("svg", _extends({
17
+ viewBox: "0 0 20 20"
18
+ }, props), /*#__PURE__*/React.createElement("path", {
19
+ d: "M8 13l3-3-3-3 1-1 4 4-4 4z"
20
+ }));
21
+ };
22
+
23
+ var CancelIcon = function CancelIcon(props) {
24
+ return /*#__PURE__*/React.createElement("svg", _extends({
25
+ viewBox: "0 0 20 20"
26
+ }, props), /*#__PURE__*/React.createElement("path", {
27
+ className: "CancelIcon__st0",
28
+ d: "M10 8.8L6.2 5 5 6.2 8.8 10 5 13.8 6.2 15l3.8-3.8 3.8 3.8 1.2-1.2-3.8-3.8L15 6.2 13.8 5 10 8.8z"
29
+ }));
30
+ };
31
+
32
+ var Arrow = function Arrow(props) {
33
+ return /*#__PURE__*/React.createElement("svg", _extends({
34
+ width: 42,
35
+ height: 12
36
+ }, props), /*#__PURE__*/React.createElement("path", {
37
+ fillRule: "evenodd",
38
+ clipRule: "evenodd",
39
+ d: "M19.212 1.081c.91-1.06 2.666-1.06 3.576 0C25.986 4.804 33.183 11.822 42 11.822H0c8.817 0 16.014-7.018 19.212-10.74z"
40
+ }));
41
+ };
42
+
13
43
  var TOOLTIP_PADDING_FOR_FLIP = 14;
14
44
  var MOUSE_KEY = 'mousedown';
15
45
  var TOUCH_KEY = 'touchstart';
16
46
  export var Placement = {
17
47
  LEFT: 'left',
48
+ LEFT_START: 'left-start',
49
+ LEFT_END: 'left-end',
18
50
  TOP: 'top',
51
+ TOP_START: 'top-start',
52
+ TOP_END: 'top-end',
19
53
  RIGHT: 'right',
20
- BOTTOM: 'bottom'
54
+ RIGHT_START: 'right-start',
55
+ RIGHT_END: 'right-end',
56
+ BOTTOM: 'bottom',
57
+ BOTTOM_START: 'bottom-start',
58
+ BOTTOM_END: 'bottom-end'
21
59
  };
22
60
  export var Paddings = {
23
61
  NONE: 'none',
@@ -29,16 +67,33 @@ export var TriggerEvent = {
29
67
  CLICK: 'click',
30
68
  CONTROLLED: 'controlled'
31
69
  };
70
+ export var ColorTheme = {
71
+ WHITE: 'white',
72
+ BLUE: 'blue',
73
+ RED: 'red'
74
+ };
75
+ export var Size = {
76
+ SMALL: 'small',
77
+ BIG: 'big'
78
+ };
32
79
  var cn = cnCreate('mfui-tooltip');
33
80
 
34
81
  var Tooltip = function Tooltip(_ref) {
35
82
  var className = _ref.className,
83
+ title = _ref.title,
84
+ text = _ref.text,
85
+ _ref$size = _ref.size,
86
+ size = _ref$size === void 0 ? 'big' : _ref$size,
87
+ buttonText = _ref.buttonText,
88
+ hasCloseButton = _ref.hasCloseButton,
89
+ _ref$colorTheme = _ref.colorTheme,
90
+ theme = _ref$colorTheme === void 0 ? 'white' : _ref$colorTheme,
36
91
  _ref$placement = _ref.placement,
37
92
  placement = _ref$placement === void 0 ? 'top' : _ref$placement,
38
93
  _ref$fallbackPlacemen = _ref.fallbackPlacements,
39
94
  fallbackPlacements = _ref$fallbackPlacemen === void 0 ? ['left', 'right', 'top', 'bottom'] : _ref$fallbackPlacemen,
40
95
  _ref$paddings = _ref.paddings,
41
- paddings = _ref$paddings === void 0 ? 'medium' : _ref$paddings,
96
+ paddings = _ref$paddings === void 0 ? 'small' : _ref$paddings,
42
97
  _ref$triggerEvent = _ref.triggerEvent,
43
98
  triggerEvent = _ref$triggerEvent === void 0 ? 'hover' : _ref$triggerEvent,
44
99
  boundaryElement = _ref.boundaryElement,
@@ -58,11 +113,9 @@ var Tooltip = function Tooltip(_ref) {
58
113
  contentShadowClassName = _ref$classes.contentShadow,
59
114
  dataAttrs = _ref.dataAttrs,
60
115
  onOpen = _ref.onOpen,
61
- onClose = _ref.onClose;
62
- var currentTrigger = triggerElement.current;
63
- var currentTarget = (targetElement === null || targetElement === void 0 ? void 0 : targetElement.current) || currentTrigger;
64
- var currentBoundary = boundaryElement === null || boundaryElement === void 0 ? void 0 : boundaryElement.current;
65
- var portalElem = React.useRef(null);
116
+ onClose = _ref.onClose,
117
+ onClick = _ref.onClick,
118
+ onCloseButtonClick = _ref.onCloseButtonClick;
66
119
 
67
120
  var _useState = useState(null),
68
121
  _useState2 = _slicedToArray(_useState, 2),
@@ -79,16 +132,39 @@ var Tooltip = function Tooltip(_ref) {
79
132
  isOpen = _useState6[0],
80
133
  setIsOpen = _useState6[1];
81
134
 
82
- useEffect(function () {
83
- return setIsOpen(isOpened);
84
- }, [isOpened]);
135
+ var _useState7 = useState(false),
136
+ _useState8 = _slicedToArray(_useState7, 2),
137
+ isTouchDevice = _useState8[0],
138
+ setIsTouchDevice = _useState8[1];
139
+
140
+ var currentTrigger = triggerElement.current;
141
+ var currentTarget = (targetElement === null || targetElement === void 0 ? void 0 : targetElement.current) || currentTrigger;
142
+ var currentBoundary = boundaryElement === null || boundaryElement === void 0 ? void 0 : boundaryElement.current;
143
+ var portalElem = React.useRef(null);
144
+ var isBigSize = size === Size.BIG;
145
+ var clickEvent = useMemo(function () {
146
+ return isTouchDevice ? TOUCH_KEY : MOUSE_KEY;
147
+ }, [isTouchDevice]);
148
+ var triggerEventName = useMemo(function () {
149
+ if (triggerEvent === TriggerEvent.CONTROLLED || !isTouchDevice) {
150
+ return triggerEvent;
151
+ }
152
+
153
+ return TriggerEvent.CLICK;
154
+ }, [isTouchDevice, triggerEvent]);
85
155
  var options = useMemo(function () {
86
156
  return {
87
157
  placement: placement,
88
158
  modifiers: [{
89
159
  name: 'arrow',
90
160
  options: {
91
- element: arrowElement
161
+ element: arrowElement,
162
+ padding: {
163
+ top: 17,
164
+ right: 1,
165
+ bottom: 17,
166
+ left: 1
167
+ }
92
168
  }
93
169
  }, {
94
170
  name: 'flip',
@@ -107,6 +183,11 @@ var Tooltip = function Tooltip(_ref) {
107
183
  options: {
108
184
  boundary: currentBoundary
109
185
  }
186
+ }, {
187
+ name: 'offset',
188
+ options: {
189
+ offset: [0, 12]
190
+ }
110
191
  }]
111
192
  };
112
193
  }, [placement, arrowElement, currentBoundary, isOpen, fallbackPlacements]);
@@ -116,28 +197,23 @@ var Tooltip = function Tooltip(_ref) {
116
197
  attributes = _usePopper.attributes,
117
198
  update = _usePopper.update;
118
199
 
200
+ useEffect(function () {
201
+ return setIsOpen(isOpened);
202
+ }, [isOpened]);
119
203
  useEffect(function () {
120
204
  update === null || update === void 0 ? void 0 : update();
121
205
  }, [children, update]);
122
-
123
- var _useState7 = useState(false),
124
- _useState8 = _slicedToArray(_useState7, 2),
125
- isTouchDevice = _useState8[0],
126
- setIsTouchDevice = _useState8[1];
127
-
128
206
  useEffect(function () {
129
207
  return setIsTouchDevice(detectTouch());
130
208
  }, []);
131
- var clickEvent = useMemo(function () {
132
- return isTouchDevice ? TOUCH_KEY : MOUSE_KEY;
133
- }, [isTouchDevice]);
134
- var triggerEventName = useMemo(function () {
135
- if (triggerEvent === TriggerEvent.CONTROLLED || !isTouchDevice) {
136
- return triggerEvent;
137
- }
138
-
139
- return TriggerEvent.CLICK;
140
- }, [isTouchDevice, triggerEvent]);
209
+ var closeTooltip = useCallback(function (e) {
210
+ setIsOpen(false);
211
+ onClose === null || onClose === void 0 ? void 0 : onClose(e);
212
+ }, [onClose]);
213
+ var handleCloseButtonClick = useCallback(function (e) {
214
+ setIsOpen(false);
215
+ onCloseButtonClick === null || onCloseButtonClick === void 0 ? void 0 : onCloseButtonClick(e);
216
+ }, [onCloseButtonClick]);
141
217
  var handleMouseEnter = useCallback(function (e) {
142
218
  if (!isOpen) {
143
219
  setIsOpen(true);
@@ -162,16 +238,8 @@ var Tooltip = function Tooltip(_ref) {
162
238
  var handleOutsideEvent = useCallback(function (e) {
163
239
  var isTargetInPopper = e.target instanceof Element && popperElement && popperElement.contains(e.target);
164
240
  var isTargetInTrigger = e.target instanceof Element && currentTrigger && currentTrigger.contains(e.target);
165
-
166
- if (!isTargetInPopper && !isTargetInTrigger) {
167
- setIsOpen(false);
168
- onClose === null || onClose === void 0 ? void 0 : onClose(e);
169
- }
170
- }, [onClose, currentTrigger, popperElement]);
171
- var handleBlurEvent = useCallback(function (e) {
172
- setIsOpen(false);
173
- onClose === null || onClose === void 0 ? void 0 : onClose(e);
174
- }, [onClose]);
241
+ !isTargetInPopper && !isTargetInTrigger && closeTooltip(e);
242
+ }, [closeTooltip, currentTrigger, popperElement]);
175
243
  useEffect(function () {
176
244
  if (triggerEventName === TriggerEvent.HOVER) {
177
245
  if (currentTrigger) {
@@ -181,10 +249,10 @@ var Tooltip = function Tooltip(_ref) {
181
249
 
182
250
  if (isOpen) {
183
251
  document.addEventListener('mouseover', handleOutsideEvent);
184
- currentTrigger === null || currentTrigger === void 0 ? void 0 : currentTrigger.addEventListener('blur', handleBlurEvent);
252
+ currentTrigger === null || currentTrigger === void 0 ? void 0 : currentTrigger.addEventListener('blur', closeTooltip);
185
253
  } else {
186
254
  document.removeEventListener('mouseover', handleOutsideEvent);
187
- currentTrigger === null || currentTrigger === void 0 ? void 0 : currentTrigger.removeEventListener('blur', handleBlurEvent);
255
+ currentTrigger === null || currentTrigger === void 0 ? void 0 : currentTrigger.removeEventListener('blur', closeTooltip);
188
256
  }
189
257
 
190
258
  return function () {
@@ -198,7 +266,7 @@ var Tooltip = function Tooltip(_ref) {
198
266
  }
199
267
 
200
268
  return undefined;
201
- }, [triggerEventName, isOpen, currentTrigger, handleOutsideEvent, handleMouseEnter, handleBlurEvent]);
269
+ }, [triggerEventName, isOpen, currentTrigger, handleOutsideEvent, handleMouseEnter, closeTooltip]);
202
270
  useEffect(function () {
203
271
  if (triggerEventName === TriggerEvent.CLICK) {
204
272
  if (currentTrigger) {
@@ -235,26 +303,61 @@ var Tooltip = function Tooltip(_ref) {
235
303
  };
236
304
  }, // eslint-disable-next-line react-hooks/exhaustive-deps
237
305
  []);
306
+ var renderedText = useMemo(function () {
307
+ return /*#__PURE__*/React.createElement("div", {
308
+ className: cn('text')
309
+ }, text);
310
+ }, [text]);
311
+ var renderedFullContent = useMemo(function () {
312
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !!title && /*#__PURE__*/React.createElement(Header, {
313
+ className: cn('title'),
314
+ as: "h5",
315
+ space: "tight"
316
+ }, title), !!text && renderedText, !!buttonText && /*#__PURE__*/React.createElement("button", _extends({
317
+ type: "button",
318
+ className: cn('button')
319
+ }, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button), {
320
+ onClick: onClick
321
+ }), buttonText, /*#__PURE__*/React.createElement(RightArrow, {
322
+ className: cn('button-arrow')
323
+ })), !!children && /*#__PURE__*/React.createElement("div", {
324
+ className: cn('addititonal-content')
325
+ }, children));
326
+ }, [title, text, buttonText, children, dataAttrs, renderedText, onClick]);
238
327
  var template = /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
239
328
  className: cn({
329
+ theme: theme,
240
330
  paddings: paddings,
241
- open: isOpen
331
+ open: isOpen,
332
+ small: !isBigSize,
333
+ 'has-escape': !targetElement
242
334
  }, [className, rootClassName]),
243
335
  ref: setPopperElement,
244
336
  style: styles.popper
245
337
  }, attributes.popper), /*#__PURE__*/React.createElement("div", {
338
+ className: cn('arrow-container')
339
+ }, /*#__PURE__*/React.createElement("div", {
340
+ className: cn('arrow-wrap'),
246
341
  ref: setArrowElement,
247
- className: cn('arrow', [arrowClassName]),
248
- style: styles.arrow
249
- }), /*#__PURE__*/React.createElement("div", {
250
- className: cn('arrow-shadow'),
251
342
  style: styles.arrow
252
- }), /*#__PURE__*/React.createElement(Tile, {
343
+ }, /*#__PURE__*/React.createElement("div", {
344
+ className: cn('arrow', [arrowClassName])
345
+ }, /*#__PURE__*/React.createElement(Arrow, {
346
+ className: cn('arrow-inner')
347
+ })))), /*#__PURE__*/React.createElement(Tile, {
348
+ radius: "rounded",
253
349
  dataAttrs: {
254
350
  root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.content
255
351
  },
256
352
  className: cn('content', [contentClassName])
257
- }, children), /*#__PURE__*/React.createElement(Tile, {
353
+ }, isBigSize && renderedFullContent, !isBigSize && !!text && renderedText, hasCloseButton && /*#__PURE__*/React.createElement("button", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.close), {
354
+ className: cn('close-button'),
355
+ type: "button",
356
+ onClick: handleCloseButtonClick
357
+ }), /*#__PURE__*/React.createElement(CancelIcon, {
358
+ className: cn('close-icon')
359
+ }))), /*#__PURE__*/React.createElement(Tile, {
360
+ radius: "rounded",
258
361
  shadowLevel: "high",
259
362
  className: cn('content-shadow', [contentShadowClassName])
260
363
  }));
@@ -274,6 +377,12 @@ var Tooltip = function Tooltip(_ref) {
274
377
  };
275
378
 
276
379
  Tooltip.propTypes = {
380
+ colorTheme: PropTypes.oneOf(Object.values(ColorTheme)),
381
+ size: PropTypes.oneOf(Object.values(Size)),
382
+ title: PropTypes.string,
383
+ buttonText: PropTypes.string,
384
+ text: PropTypes.string,
385
+ hasCloseButton: PropTypes.bool,
277
386
  placement: PropTypes.oneOf(Object.values(Placement)),
278
387
  fallbackPlacements: PropTypes.arrayOf(PropTypes.oneOf(Object.values(Placement)).isRequired),
279
388
  paddings: PropTypes.oneOf(Object.values(Paddings)),
@@ -312,9 +421,13 @@ Tooltip.propTypes = {
312
421
  }),
313
422
  dataAttrs: PropTypes.shape({
314
423
  root: PropTypes.objectOf(PropTypes.string.isRequired),
424
+ close: PropTypes.objectOf(PropTypes.string.isRequired),
425
+ button: PropTypes.objectOf(PropTypes.string.isRequired),
315
426
  content: PropTypes.objectOf(PropTypes.string.isRequired)
316
427
  }),
317
428
  onOpen: PropTypes.func,
318
- onClose: PropTypes.func
429
+ onClose: PropTypes.func,
430
+ onClick: PropTypes.func,
431
+ onCloseButtonClick: PropTypes.func
319
432
  };
320
433
  export default Tooltip;
@@ -14,6 +14,7 @@
14
14
  position: relative;
15
15
  padding: 24px 44px 24px 16px;
16
16
  border-radius: 12px;
17
+ outline: none;
17
18
  cursor: pointer;
18
19
  -webkit-transition: background-color 0.3s;
19
20
  transition: background-color 0.3s;
@@ -8,6 +8,8 @@ export interface IBannerDotProps {
8
8
  timerDelay: number;
9
9
  dataAttrs?: {
10
10
  root?: Record<string, string>;
11
+ svg?: Record<string, string>;
12
+ circle?: Record<string, string>;
11
13
  };
12
14
  onClick: (index: number) => void;
13
15
  }
@@ -40,10 +40,10 @@ var BannerDot = function BannerDot(_ref) {
40
40
  timer: showTimer
41
41
  }, className),
42
42
  onClick: handleDotClick
43
- }), showTimer && isActive && /*#__PURE__*/React.createElement("svg", {
43
+ }), showTimer && isActive && /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
44
44
  className: cn('timer'),
45
45
  viewBox: "0 0 100 100"
46
- }, /*#__PURE__*/React.createElement("circle", {
46
+ }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.svg)), /*#__PURE__*/React.createElement("circle", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.circle), {
47
47
  className: cn('timer-circle'),
48
48
  style: {
49
49
  animationDuration: "".concat(timerDelay, "s")
@@ -51,13 +51,15 @@ var BannerDot = function BannerDot(_ref) {
51
51
  cx: "50",
52
52
  cy: "50",
53
53
  r: "50"
54
- })));
54
+ }))));
55
55
  };
56
56
 
57
57
  BannerDot.propTypes = {
58
58
  className: PropTypes.string,
59
59
  dataAttrs: PropTypes.shape({
60
- root: PropTypes.objectOf(PropTypes.string.isRequired)
60
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
61
+ svg: PropTypes.objectOf(PropTypes.string.isRequired),
62
+ circle: PropTypes.objectOf(PropTypes.string.isRequired)
61
63
  }),
62
64
  index: PropTypes.number.isRequired,
63
65
  isActive: PropTypes.bool.isRequired,
@@ -37,6 +37,8 @@ export interface IButtonProps {
37
37
  content?: Record<string, string>;
38
38
  inner?: Record<string, string>;
39
39
  loader?: Record<string, string>;
40
+ text?: Record<string, string>;
41
+ arrow?: Record<string, string>;
40
42
  };
41
43
  /** Тема компонента */
42
44
  theme?: ButtonThemesType;
@@ -161,14 +161,14 @@ var Button = function Button(_ref) {
161
161
  }, contentClassName)
162
162
  }), icon && /*#__PURE__*/_react["default"].createElement("div", {
163
163
  className: cn('icon')
164
- }, icon), children && /*#__PURE__*/_react["default"].createElement("span", {
164
+ }, icon), children && /*#__PURE__*/_react["default"].createElement("span", (0, _extends2["default"])({
165
165
  className: cn('text', {
166
166
  ellipsis: ellipsis
167
167
  })
168
- }, children), !icon && showArrow && /*#__PURE__*/_react["default"].createElement(Arrow, {
168
+ }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.text)), children), !icon && showArrow && /*#__PURE__*/_react["default"].createElement(Arrow, (0, _extends2["default"])({
169
169
  className: cn('icon-arrow')
170
- }));
171
- }, [children, icon, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.content, contentClassName, showArrow, ellipsis]);
170
+ }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrow))));
171
+ }, [children, icon, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.content, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.text, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrow, ellipsis, contentClassName, showArrow]);
172
172
 
173
173
  var contentType = _react["default"].useMemo(function () {
174
174
  switch (true) {
@@ -257,7 +257,9 @@ Button.propTypes = {
257
257
  root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
258
258
  content: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
259
259
  inner: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
260
- loader: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
260
+ loader: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
261
+ text: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
262
+ arrow: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
261
263
  }),
262
264
  theme: _propTypes["default"].oneOf(Object.values(ButtonThemes)),
263
265
  type: _propTypes["default"].oneOf(Object.values(ButtonTypes)),
@@ -9,9 +9,13 @@ export declare const NotificationTypes: {
9
9
  declare type NotificationType = typeof NotificationTypes[keyof typeof NotificationTypes];
10
10
  export declare const ShadowTypes: {
11
11
  readonly ZERO: "zero";
12
+ /** @deprecated TODO: нужно удалить значение при выпуске мажорной версии */
12
13
  readonly LOW: "low";
14
+ /** @deprecated TODO: нужно удалить значение при выпуске мажорной версии */
13
15
  readonly HIGH: "high";
14
16
  readonly HOVER: "hover";
17
+ readonly PRESSED: "pressed";
18
+ readonly DEFAULT: "default";
15
19
  };
16
20
  declare type ShadowType = typeof ShadowTypes[keyof typeof ShadowTypes];
17
21
  export interface INotificationProps {
@@ -117,9 +117,15 @@ var NotificationTypes = {
117
117
  exports.NotificationTypes = NotificationTypes;
118
118
  var ShadowTypes = {
119
119
  ZERO: 'zero',
120
+
121
+ /** @deprecated TODO: нужно удалить значение при выпуске мажорной версии */
120
122
  LOW: 'low',
123
+
124
+ /** @deprecated TODO: нужно удалить значение при выпуске мажорной версии */
121
125
  HIGH: 'high',
122
- HOVER: 'hover'
126
+ HOVER: 'hover',
127
+ PRESSED: 'pressed',
128
+ DEFAULT: 'default'
123
129
  };
124
130
  exports.ShadowTypes = ShadowTypes;
125
131
  var cn = (0, _uiHelpers.cnCreate)('mfui-notification');
@@ -231,6 +231,20 @@
231
231
  max-height: 368px;
232
232
  padding: 16px;
233
233
  overflow-y: auto;
234
+ scrollbar-width: thin;
235
+ scrollbar-color: var(--spbSky2) transparent;
236
+ }
237
+ .mfui-search__list-inner::-webkit-scrollbar {
238
+ width: 16px;
239
+ }
240
+ .mfui-search__list-inner::-webkit-scrollbar-thumb {
241
+ border: 6px solid transparent;
242
+ border-radius: 16px;
243
+ background-color: #D8D8D8;
244
+ background-clip: padding-box;
245
+ }
246
+ .mfui-search__list-inner::-webkit-scrollbar-thumb:hover {
247
+ background-color: #999999;
234
248
  }
235
249
  .mfui-search__list-item {
236
250
  font-family: inherit;
@@ -177,6 +177,8 @@
177
177
  max-height: 368px;
178
178
  padding: 16px;
179
179
  overflow-y: auto;
180
+ scrollbar-width: thin;
181
+ scrollbar-color: var(--spbSky2) transparent;
180
182
  }
181
183
  .mfui-select__list-inner_short {
182
184
  max-height: 235px;
@@ -149,8 +149,8 @@
149
149
  text-align: center;
150
150
  text-decoration: none;
151
151
  cursor: pointer;
152
- -webkit-transition: color 0.3s;
153
- transition: color 0.3s;
152
+ -webkit-transition: color 0.3s, fill 0.3s;
153
+ transition: color 0.3s, fill 0.3s;
154
154
  fill: var(--spbSky3);
155
155
  }
156
156
  .mfui-tabs__tab-inner:focus {
@@ -245,12 +245,15 @@
245
245
  z-index: 100;
246
246
  background-color: var(--base);
247
247
  }
248
+ .mfui-tabs_tab-color_gray .mfui-tabs__swiper {
249
+ background-color: var(--spbSky1);
250
+ }
248
251
  .mfui-tabs_tab-color_green:not(.mfui-tabs_sticky) .mfui-tabs__swiper {
249
- background-color: var(--stcBlack50);
252
+ background-color: var(--stcBlack20);
250
253
  }
251
254
  .mfui-tabs_tab-color_green:not(.mfui-tabs_sticky) .mfui-tabs__tab-inner:not(.mfui-tabs_tab-color_green:not(.mfui-tabs_sticky) .mfui-tabs__tab-inner_current) {
252
- color: var(--stcWhite50);
253
- fill: var(--stcWhite50);
255
+ color: #ffffffb2;
256
+ fill: #ffffffb2;
254
257
  }
255
258
  .mfui-tabs_tab-color_green:not(.mfui-tabs_sticky) .mfui-tabs__tab-inner:not(.mfui-tabs_tab-color_green:not(.mfui-tabs_sticky) .mfui-tabs__tab-inner_current):hover {
256
259
  color: var(--stcWhite);
@@ -12,6 +12,7 @@ export declare const TabSize: {
12
12
  export declare const TabColorTheme: {
13
13
  readonly WHITE: "white";
14
14
  readonly GREEN: "green";
15
+ readonly GRAY: "gray";
15
16
  };
16
17
  declare type TabSizeType = typeof TabSize[keyof typeof TabSize];
17
18
  declare type TabColorThemeType = typeof TabColorTheme[keyof typeof TabColorTheme];
@@ -61,7 +61,8 @@ var TabSize = {
61
61
  exports.TabSize = TabSize;
62
62
  var TabColorTheme = {
63
63
  WHITE: 'white',
64
- GREEN: 'green'
64
+ GREEN: 'green',
65
+ GRAY: 'gray'
65
66
  };
66
67
  exports.TabColorTheme = TabColorTheme;
67
68
  var cn = (0, _uiHelpers.cnCreate)('mfui-tabs');
@@ -424,7 +425,8 @@ var Tabs = function Tabs(_ref) {
424
425
  onSwiper: handleSwiper,
425
426
  onReachBeginning: handleReachBeginning,
426
427
  onReachEnd: handleReachEnd,
427
- onFromEdge: handleFromEdge
428
+ onFromEdge: handleFromEdge,
429
+ observer: true
428
430
  }), renderTabs(), /*#__PURE__*/React.createElement("div", {
429
431
  className: cn('underline'),
430
432
  slot: "wrapper-start",
@@ -46,6 +46,9 @@
46
46
  transition: height 0.1s;
47
47
  will-change: height;
48
48
  }
49
+ .mfui-text-field__field_no-icon {
50
+ padding-right: 16px;
51
+ }
49
52
  .mfui-text-field__resizer {
50
53
  position: absolute;
51
54
  right: 0;
@@ -158,6 +161,10 @@
158
161
  font-size: 15px;
159
162
  line-height: 24px;
160
163
  }
164
+ .mfui-text-field__field_textarea {
165
+ scrollbar-width: thin;
166
+ scrollbar-color: var(--spbSky2) transparent;
167
+ }
161
168
  .mfui-text-field__field_textarea ~ .mfui-text-field__label {
162
169
  top: 16px;
163
170
  }
@@ -346,7 +346,9 @@ var TextField = function TextField(_ref) {
346
346
  inputMode: inputMode
347
347
  });
348
348
  var inputParams = (0, _extends2["default"])((0, _extends2["default"])({}, commonParams), {
349
- className: cn('field', classes === null || classes === void 0 ? void 0 : classes.input),
349
+ className: cn('field', {
350
+ 'no-icon': hideIcon
351
+ }, classes === null || classes === void 0 ? void 0 : classes.input),
350
352
  type: isVisiblePassword ? 'text' : type,
351
353
  autoComplete: autoComplete
352
354
  });
@@ -3,7 +3,7 @@
3
3
  background-color: var(--base);
4
4
  }
5
5
  .mfui-tile_radius_rounded {
6
- border-radius: 8px;
6
+ border-radius: 12px;
7
7
  }
8
8
  .mfui-tile_pointer {
9
9
  cursor: pointer;
@@ -16,11 +16,6 @@
16
16
  -webkit-box-shadow: 0 2px 9px rgba(0, 0, 0, 0.15);
17
17
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.15);
18
18
  }
19
- .mfui-tile_theme_light.mfui-tile_shadow_hover,
20
- .mfui-tile_theme_light.mfui-tile_interactive:hover {
21
- -webkit-box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
22
- box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
23
- }
24
19
  .mfui-tile_theme_dark.mfui-tile_shadow_low {
25
20
  -webkit-box-shadow: 0 0.25px 3px rgba(0, 0, 0, 0.45);
26
21
  box-shadow: 0 0.25px 3px rgba(0, 0, 0, 0.45);
@@ -29,6 +24,27 @@
29
24
  -webkit-box-shadow: 0 2px 9px rgba(0, 0, 0, 0.25);
30
25
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.25);
31
26
  }
27
+ .mfui-tile_theme_light.mfui-tile_shadow_default {
28
+ -webkit-box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
29
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
30
+ }
31
+ .mfui-tile_theme_light.mfui-tile_shadow_pressed {
32
+ -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
33
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
34
+ }
35
+ .mfui-tile_theme_light.mfui-tile_shadow_hover,
36
+ .mfui-tile_theme_light.mfui-tile_interactive:hover {
37
+ -webkit-box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
38
+ box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
39
+ }
40
+ .mfui-tile_theme_dark.mfui-tile_shadow_default {
41
+ -webkit-box-shadow: 0 2px 12px rgba(0, 0, 0, 0.16);
42
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.16);
43
+ }
44
+ .mfui-tile_theme_dark.mfui-tile_shadow_pressed {
45
+ -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
46
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
47
+ }
32
48
  .mfui-tile_theme_dark.mfui-tile_shadow_hover,
33
49
  .mfui-tile_theme_dark.mfui-tile_interactive:hover {
34
50
  -webkit-box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);