@megafon/ui-core 2.1.3 → 2.4.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 (67) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/es/colors/Colors.css +3 -3
  3. package/dist/es/colors/Colors.d.ts +2 -2
  4. package/dist/es/colors/Colors.js +2 -2
  5. package/dist/es/colors/colorsData.js +9 -0
  6. package/dist/es/components/Accordion/Accordion.d.ts +1 -0
  7. package/dist/es/components/Accordion/Accordion.js +4 -2
  8. package/dist/es/components/Banner/Banner.css +28 -0
  9. package/dist/es/components/Banner/Banner.d.ts +2 -0
  10. package/dist/es/components/Banner/Banner.js +15 -10
  11. package/dist/es/components/Button/Button.js +2 -2
  12. package/dist/es/components/Calendar/Calendar.js +3 -2
  13. package/dist/es/components/Calendar/components/Day/Day.js +1 -1
  14. package/dist/es/components/Carousel/Carousel.js +17 -14
  15. package/dist/es/components/Checkbox/Checkbox.d.ts +1 -1
  16. package/dist/es/components/Checkbox/Checkbox.js +1 -1
  17. package/dist/es/components/Counter/Counter.js +3 -3
  18. package/dist/es/components/Header/Header.d.ts +1 -1
  19. package/dist/es/components/Link/Link.d.ts +7 -3
  20. package/dist/es/components/Link/Link.js +21 -8
  21. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +1 -1
  22. package/dist/es/components/Pagination/helpers.d.ts +1 -1
  23. package/dist/es/components/RadioButton/RadioButton.d.ts +5 -1
  24. package/dist/es/components/RadioButton/RadioButton.js +8 -6
  25. package/dist/es/components/Search/Search.js +4 -3
  26. package/dist/es/components/Select/Select.d.ts +3 -3
  27. package/dist/es/components/Select/Select.js +5 -5
  28. package/dist/es/components/Switcher/Switcher.js +1 -1
  29. package/dist/es/components/Tabs/Tabs.js +52 -42
  30. package/dist/es/components/TextField/TextField.d.ts +3 -1
  31. package/dist/es/components/TextField/TextField.js +14 -10
  32. package/dist/es/components/Tile/Tile.js +1 -1
  33. package/dist/es/components/Tooltip/Tooltip.js +17 -17
  34. package/dist/lib/colors/Colors.css +3 -3
  35. package/dist/lib/colors/Colors.d.ts +2 -2
  36. package/dist/lib/colors/Colors.js +2 -2
  37. package/dist/lib/colors/colorsData.js +9 -0
  38. package/dist/lib/components/Accordion/Accordion.d.ts +1 -0
  39. package/dist/lib/components/Accordion/Accordion.js +4 -2
  40. package/dist/lib/components/Banner/Banner.css +28 -0
  41. package/dist/lib/components/Banner/Banner.d.ts +2 -0
  42. package/dist/lib/components/Banner/Banner.js +15 -10
  43. package/dist/lib/components/Button/Button.js +2 -2
  44. package/dist/lib/components/Calendar/Calendar.js +3 -3
  45. package/dist/lib/components/Calendar/components/Day/Day.js +1 -1
  46. package/dist/lib/components/Carousel/Carousel.js +15 -12
  47. package/dist/lib/components/Checkbox/Checkbox.d.ts +1 -1
  48. package/dist/lib/components/Checkbox/Checkbox.js +1 -1
  49. package/dist/lib/components/Counter/Counter.js +3 -3
  50. package/dist/lib/components/Header/Header.d.ts +1 -1
  51. package/dist/lib/components/Link/Link.d.ts +7 -3
  52. package/dist/lib/components/Link/Link.js +34 -23
  53. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +1 -1
  54. package/dist/lib/components/Pagination/helpers.d.ts +1 -1
  55. package/dist/lib/components/RadioButton/RadioButton.d.ts +5 -1
  56. package/dist/lib/components/RadioButton/RadioButton.js +7 -5
  57. package/dist/lib/components/Search/Search.js +4 -3
  58. package/dist/lib/components/Select/Select.d.ts +3 -3
  59. package/dist/lib/components/Select/Select.js +5 -5
  60. package/dist/lib/components/Switcher/Switcher.js +1 -1
  61. package/dist/lib/components/Tabs/Tabs.js +52 -42
  62. package/dist/lib/components/TextField/TextField.d.ts +3 -1
  63. package/dist/lib/components/TextField/TextField.js +14 -10
  64. package/dist/lib/components/Tile/Tile.js +1 -1
  65. package/dist/lib/components/Tooltip/Tooltip.js +17 -17
  66. package/package.json +2 -2
  67. package/styles/base.less +3 -5
@@ -89,12 +89,12 @@ var Select = /*#__PURE__*/function (_React$Component) {
89
89
 
90
90
  _this.handleOpened = function () {
91
91
  var onOpened = _this.props.onOpened;
92
- onOpened && onOpened();
92
+ onOpened === null || onOpened === void 0 ? void 0 : onOpened();
93
93
  };
94
94
 
95
95
  _this.handleClosed = function () {
96
96
  var onClosed = _this.props.onClosed;
97
- onClosed && onClosed();
97
+ onClosed === null || onClosed === void 0 ? void 0 : onClosed();
98
98
  };
99
99
 
100
100
  _this.handleClickOutside = function (e) {
@@ -153,7 +153,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
153
153
  isChoosenItem: true
154
154
  });
155
155
 
156
- onSelect && onSelect(e, item);
156
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(e, item);
157
157
 
158
158
  _this.handleClosed();
159
159
  };
@@ -193,7 +193,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
193
193
  var filterValue = e.target.value;
194
194
 
195
195
  if (isChoosenItem) {
196
- onSelect && onSelect(null);
196
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(null);
197
197
  }
198
198
 
199
199
  _this.setState({
@@ -311,7 +311,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
311
311
  };
312
312
 
313
313
  _this.getNodeList = function (node) {
314
- return _this.itemsNodeList.push(node);
314
+ _this.itemsNodeList.push(node);
315
315
  };
316
316
 
317
317
  _this.state = {
@@ -17,7 +17,7 @@ var Switcher = function Switcher(props) {
17
17
  return;
18
18
  }
19
19
 
20
- onChange && onChange(e);
20
+ onChange === null || onChange === void 0 ? void 0 : onChange(e);
21
21
  };
22
22
 
23
23
  return /*#__PURE__*/React.createElement("div", {
@@ -96,36 +96,41 @@ var Tabs = function Tabs(_ref) {
96
96
 
97
97
  var _React$useState9 = React.useState(0),
98
98
  _React$useState10 = _slicedToArray(_React$useState9, 2),
99
- underlineWidth = _React$useState10[0],
100
- setUnderlineWidth = _React$useState10[1];
99
+ activeTabWidth = _React$useState10[0],
100
+ setActiveTabWidth = _React$useState10[1];
101
101
 
102
102
  var _React$useState11 = React.useState(0),
103
103
  _React$useState12 = _slicedToArray(_React$useState11, 2),
104
- underlineTranslate = _React$useState12[0],
105
- setUnderlineTranslate = _React$useState12[1];
104
+ underlineWidth = _React$useState12[0],
105
+ setUnderlineWidth = _React$useState12[1];
106
106
 
107
- var _React$useState13 = React.useState('none'),
107
+ var _React$useState13 = React.useState(0),
108
108
  _React$useState14 = _slicedToArray(_React$useState13, 2),
109
- underlineTransition = _React$useState14[0],
110
- setUnderlineTransition = _React$useState14[1];
109
+ underlineTranslate = _React$useState14[0],
110
+ setUnderlineTranslate = _React$useState14[1];
111
111
 
112
- var _React$useState15 = React.useState('auto'),
112
+ var _React$useState15 = React.useState('none'),
113
113
  _React$useState16 = _slicedToArray(_React$useState15, 2),
114
- tabListHeight = _React$useState16[0],
115
- setTabListHeight = _React$useState16[1];
114
+ underlineTransition = _React$useState16[0],
115
+ setUnderlineTransition = _React$useState16[1];
116
116
 
117
- var _React$useState17 = React.useState(false),
117
+ var _React$useState17 = React.useState('auto'),
118
118
  _React$useState18 = _slicedToArray(_React$useState17, 2),
119
- isSticky = _React$useState18[0],
120
- setSticky = _React$useState18[1];
119
+ tabListHeight = _React$useState18[0],
120
+ setTabListHeight = _React$useState18[1];
121
121
 
122
- var _React$useState19 = React.useState({
122
+ var _React$useState19 = React.useState(false),
123
+ _React$useState20 = _slicedToArray(_React$useState19, 2),
124
+ isSticky = _React$useState20[0],
125
+ setSticky = _React$useState20[1];
126
+
127
+ var _React$useState21 = React.useState({
123
128
  left: 0,
124
129
  right: 0
125
130
  }),
126
- _React$useState20 = _slicedToArray(_React$useState19, 2),
127
- stickyOffset = _React$useState20[0],
128
- setStickyOffset = _React$useState20[1];
131
+ _React$useState22 = _slicedToArray(_React$useState21, 2),
132
+ stickyOffset = _React$useState22[0],
133
+ setStickyOffset = _React$useState22[1];
129
134
 
130
135
  var setTabRef = React.useCallback(function (tab) {
131
136
  tab && tabsRef.current.push(tab);
@@ -135,12 +140,6 @@ var Tabs = function Tabs(_ref) {
135
140
  return;
136
141
  }
137
142
 
138
- var tabNodeChild = tabsRef.current[currentIndex].firstElementChild;
139
-
140
- var _ref2 = tabNodeChild || {},
141
- _ref2$clientWidth = _ref2.clientWidth,
142
- clientWidth = _ref2$clientWidth === void 0 ? 0 : _ref2$clientWidth;
143
-
144
143
  var translate = _toConsumableArray(tabsRef.current).splice(0, currentIndex).reduce(function (accWidth, node) {
145
144
  var _node$getBoundingClie = node.getBoundingClientRect(),
146
145
  width = _node$getBoundingClie.width;
@@ -148,9 +147,9 @@ var Tabs = function Tabs(_ref) {
148
147
  return accWidth + width;
149
148
  }, 0);
150
149
 
151
- setUnderlineWidth(clientWidth);
150
+ setUnderlineWidth(activeTabWidth);
152
151
  setUnderlineTranslate(translate);
153
- }, [currentIndex]);
152
+ }, [currentIndex, activeTabWidth]);
154
153
  var calculateSticky = React.useCallback(function () {
155
154
  if (!sticky || !rootRef.current || !tabListRef.current) {
156
155
  return;
@@ -165,11 +164,11 @@ var Tabs = function Tabs(_ref) {
165
164
  left: left,
166
165
  right: documentWidth - right
167
166
  });
168
- }, [stickyOffset, isSticky]);
167
+ }, [sticky]);
169
168
  var handleTabInnerClick = React.useCallback(function (index) {
170
169
  return function () {
171
170
  setUnderlineTransition('all');
172
- onTabClick && onTabClick(index);
171
+ onTabClick === null || onTabClick === void 0 ? void 0 : onTabClick(index);
173
172
 
174
173
  if (outerIndex === undefined) {
175
174
  setInnerIndex(index);
@@ -218,7 +217,7 @@ var Tabs = function Tabs(_ref) {
218
217
  ref: setTabRef
219
218
  }, filterDataAttrs(dataAttrs)), renderTabWrapper ? renderTabWrapper(tab) : tab));
220
219
  });
221
- }, [renderTab, children]);
220
+ }, [renderTab, children, activeTabClass, currentIndex, setTabRef, tabClass]);
222
221
  var renderPanels = React.useCallback(function () {
223
222
  return React.Children.map(children, function (child, i) {
224
223
  var panel = child.props.children;
@@ -234,7 +233,7 @@ var Tabs = function Tabs(_ref) {
234
233
  })
235
234
  }, panel);
236
235
  });
237
- }, [children, currentIndex]);
236
+ }, [children, currentIndex, renderOnlyCurrentPanel]);
238
237
  var handleReachBeginning = React.useCallback(function (swiper) {
239
238
  setBeginning(swiper.isBeginning);
240
239
  }, []);
@@ -246,15 +245,16 @@ var Tabs = function Tabs(_ref) {
246
245
  setEnd(swiper.isEnd);
247
246
  }, []);
248
247
  React.useEffect(function () {
248
+ var rootRefNode = rootRef.current;
249
249
  var observer = new IntersectionObserver(function (entries) {
250
- entries.forEach(function (_ref3) {
251
- var isIntersecting = _ref3.isIntersecting,
252
- _ref3$boundingClientR = _ref3.boundingClientRect,
253
- top = _ref3$boundingClientR.top,
254
- left = _ref3$boundingClientR.left,
255
- right = _ref3$boundingClientR.right;
256
-
257
- if (!sticky || !rootRef.current || !tabListRef.current) {
250
+ entries.forEach(function (_ref2) {
251
+ var isIntersecting = _ref2.isIntersecting,
252
+ _ref2$boundingClientR = _ref2.boundingClientRect,
253
+ top = _ref2$boundingClientR.top,
254
+ left = _ref2$boundingClientR.left,
255
+ right = _ref2$boundingClientR.right;
256
+
257
+ if (!sticky || !rootRefNode || !tabListRef.current) {
258
258
  return;
259
259
  }
260
260
 
@@ -287,22 +287,32 @@ var Tabs = function Tabs(_ref) {
287
287
  }, {
288
288
  threshold: [0, 1]
289
289
  });
290
- rootRef.current && observer.observe(rootRef.current);
290
+ rootRefNode && observer.observe(rootRefNode);
291
291
  return function () {
292
- rootRef.current && observer.unobserve(rootRef.current);
292
+ rootRefNode && observer.unobserve(rootRefNode);
293
293
  };
294
- }, [calculateSticky]);
294
+ }, [calculateSticky, sticky]);
295
295
  React.useEffect(function () {
296
296
  var handleResize = throttle(function () {
297
- calculateUnderline();
298
297
  calculateSticky();
299
298
  }, 300);
299
+ var activeTabNode = tabsRef.current[currentIndex];
300
+ var resizeObserver = new ResizeObserver(function (entries) {
301
+ if (!entries.length || !entries[0]) {
302
+ return;
303
+ }
304
+
305
+ var width = entries[0].contentRect.width;
306
+ setActiveTabWidth(width);
307
+ calculateUnderline();
308
+ });
300
309
  calculateUnderline();
310
+ resizeObserver.observe(activeTabNode);
301
311
  window.addEventListener('resize', handleResize);
302
312
  return function () {
303
313
  window.removeEventListener('resize', handleResize);
304
314
  };
305
- }, [calculateUnderline, calculateSticky]);
315
+ }, [calculateUnderline, calculateSticky, currentIndex]);
306
316
  React.useEffect(function () {
307
317
  if (!swiperInstance) {
308
318
  return;
@@ -62,8 +62,10 @@ export declare type TextFieldProps = {
62
62
  classes?: {
63
63
  input?: string;
64
64
  };
65
- /** Аргумент элемента input */
65
+ /** Атрибут элемента input */
66
66
  inputMode?: 'numeric' | 'tel' | 'decimal' | 'email' | 'url' | 'search' | 'none';
67
+ /** Атрибут элемента input. Не работает с textarea=true */
68
+ autoComplete?: string;
67
69
  /** Переводит компонент в контролируемое состояние */
68
70
  isControlled?: boolean;
69
71
  /** Обработчик изменения значения */
@@ -96,6 +96,7 @@ var TextField = function TextField(_ref) {
96
96
  noticeText = _ref.noticeText,
97
97
  inputRef = _ref.inputRef,
98
98
  inputMode = _ref.inputMode,
99
+ autoComplete = _ref.autoComplete,
99
100
  _ref$classes = _ref.classes;
100
101
  _ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
101
102
  var input = _ref$classes.input;
@@ -149,7 +150,7 @@ var TextField = function TextField(_ref) {
149
150
  useEffect(function () {
150
151
  !isControlled && setInputValue(value);
151
152
  checkSymbolMaxLimit(value);
152
- }, [value, checkSymbolMaxLimit]);
153
+ }, [value, checkSymbolMaxLimit, isControlled]);
153
154
  useEffect(function () {
154
155
  setTouch(detectTouch());
155
156
  }, []);
@@ -157,7 +158,7 @@ var TextField = function TextField(_ref) {
157
158
  return setPasswordHidden(function (prevPassState) {
158
159
  return !prevPassState;
159
160
  });
160
- }, [isPasswordHidden]);
161
+ }, []);
161
162
 
162
163
  var setTextareaHeight = function setTextareaHeight() {
163
164
  if (!(fieldNode === null || fieldNode === void 0 ? void 0 : fieldNode.current)) {
@@ -180,7 +181,7 @@ var TextField = function TextField(_ref) {
180
181
 
181
182
  !isControlled && setInputValue(e.target.value);
182
183
  checkSymbolMaxLimit(e.target.value);
183
- onChange && onChange(e);
184
+ onChange === null || onChange === void 0 ? void 0 : onChange(e);
184
185
  };
185
186
 
186
187
  var handleTextareaClick = function handleTextareaClick() {
@@ -197,18 +198,18 @@ var TextField = function TextField(_ref) {
197
198
  var isClearFuncAvailable = !customIcon && !onCustomIconClick && verification === ERROR;
198
199
  var field = fieldNode.current;
199
200
  isPasswordType && togglePasswordHiding();
200
- onCustomIconClick && onCustomIconClick(e);
201
+ onCustomIconClick === null || onCustomIconClick === void 0 ? void 0 : onCustomIconClick(e);
201
202
 
202
203
  if (!isControlled && isClearFuncAvailable) {
203
204
  setInputValue('');
204
- field && field.focus();
205
+ field === null || field === void 0 ? void 0 : field.focus();
205
206
  }
206
- }, [isPasswordType, togglePasswordHiding, onCustomIconClick, verification, setInputValue]);
207
+ }, [isPasswordType, togglePasswordHiding, onCustomIconClick, verification, customIcon, isControlled]);
207
208
  var handleFocus = useCallback(function (e) {
208
- onFocus && onFocus(e);
209
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
209
210
  }, [onFocus]);
210
211
  var handleBlur = useCallback(function (e) {
211
- onBlur && onBlur(e);
212
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
212
213
  }, [onBlur]);
213
214
  var handleBeforeMaskChange = useCallback(function (newState, oldState, inputedValue) {
214
215
  return onBeforeMaskChange && onBeforeMaskChange(inputedValue, newState, oldState);
@@ -232,7 +233,8 @@ var TextField = function TextField(_ref) {
232
233
 
233
234
  var inputParams = _extends(_extends({}, commonParams), {
234
235
  className: cn('field', input),
235
- type: isVisiblePassword ? 'text' : type
236
+ type: isVisiblePassword ? 'text' : type,
237
+ autoComplete: autoComplete
236
238
  });
237
239
 
238
240
  var inputMaskParams = {
@@ -254,7 +256,7 @@ var TextField = function TextField(_ref) {
254
256
  }
255
257
 
256
258
  fieldNode.current = node;
257
- inputRef && inputRef(node);
259
+ inputRef === null || inputRef === void 0 ? void 0 : inputRef(node);
258
260
  };
259
261
 
260
262
  var getIcon = function getIcon() {
@@ -370,6 +372,8 @@ TextField.propTypes = {
370
372
  disabled: PropTypes.bool,
371
373
  required: PropTypes.bool,
372
374
  type: PropTypes.oneOf(['text', 'password', 'tel', 'email']),
375
+ inputMode: PropTypes.oneOf(['numeric', 'tel', 'decimal', 'email', 'url', 'search', 'none']),
376
+ autoComplete: PropTypes.string,
373
377
  name: PropTypes.string,
374
378
  placeholder: PropTypes.string,
375
379
  id: PropTypes.string,
@@ -36,7 +36,7 @@ var Tile = function Tile(_ref) {
36
36
  dataAttrs = _ref.dataAttrs;
37
37
 
38
38
  var handleClick = function handleClick(e) {
39
- onClick && onClick(e);
39
+ onClick === null || onClick === void 0 ? void 0 : onClick(e);
40
40
  };
41
41
 
42
42
  var isPointer = !!href || isInteractive;
@@ -82,7 +82,7 @@ var Tooltip = function Tooltip(_ref) {
82
82
 
83
83
  useEffect(function () {
84
84
  return setIsOpen(isOpened);
85
- }, [isOpened, setIsOpen]);
85
+ }, [isOpened]);
86
86
  var options = useMemo(function () {
87
87
  return {
88
88
  placement: placement,
@@ -110,7 +110,7 @@ var Tooltip = function Tooltip(_ref) {
110
110
  }
111
111
  }]
112
112
  };
113
- }, [placement, arrowElement, currentBoundary, isOpen]);
113
+ }, [placement, arrowElement, currentBoundary, isOpen, fallbackPlacements]);
114
114
 
115
115
  var _usePopper = usePopper(currentTarget, popperElement, options),
116
116
  styles = _usePopper.styles,
@@ -118,7 +118,7 @@ var Tooltip = function Tooltip(_ref) {
118
118
  update = _usePopper.update;
119
119
 
120
120
  useEffect(function () {
121
- update && update();
121
+ update === null || update === void 0 ? void 0 : update();
122
122
  }, [children, update]);
123
123
 
124
124
  var _useState7 = useState(false),
@@ -128,7 +128,7 @@ var Tooltip = function Tooltip(_ref) {
128
128
 
129
129
  useEffect(function () {
130
130
  return setIsTouchDevice(detectTouch());
131
- }, [detectTouch, setIsTouchDevice]);
131
+ }, []);
132
132
  var clickEvent = useMemo(function () {
133
133
  return isTouchDevice ? TOUCH_KEY : MOUSE_KEY;
134
134
  }, [isTouchDevice]);
@@ -138,9 +138,9 @@ var Tooltip = function Tooltip(_ref) {
138
138
  var handleMouseEnter = useCallback(function (e) {
139
139
  if (!isOpen) {
140
140
  setIsOpen(true);
141
- onOpen && onOpen(e);
141
+ onOpen === null || onOpen === void 0 ? void 0 : onOpen(e);
142
142
  }
143
- }, [isOpen, onOpen, setIsOpen]);
143
+ }, [isOpen, onOpen]);
144
144
  var handleClick = useCallback(function (e) {
145
145
  if (!checkEventIsClickOrEnterPress(e)) {
146
146
  return;
@@ -151,24 +151,24 @@ var Tooltip = function Tooltip(_ref) {
151
151
  });
152
152
 
153
153
  if (!isOpen) {
154
- onOpen && onOpen(e);
154
+ onOpen === null || onOpen === void 0 ? void 0 : onOpen(e);
155
155
  } else {
156
- onClose && onClose(e);
156
+ onClose === null || onClose === void 0 ? void 0 : onClose(e);
157
157
  }
158
- }, [isOpen, onOpen, onClose, setIsOpen]);
158
+ }, [isOpen, onOpen, onClose]);
159
159
  var handleOutsideEvent = useCallback(function (e) {
160
160
  var isTargetInPopper = e.target instanceof Element && popperElement && popperElement.contains(e.target);
161
161
  var isTargetInTrigger = e.target instanceof Element && currentTrigger && currentTrigger.contains(e.target);
162
162
 
163
163
  if (!isTargetInPopper && !isTargetInTrigger) {
164
164
  setIsOpen(false);
165
- onClose && onClose(e);
165
+ onClose === null || onClose === void 0 ? void 0 : onClose(e);
166
166
  }
167
- }, [onClose, currentTrigger, popperElement, setIsOpen]);
167
+ }, [onClose, currentTrigger, popperElement]);
168
168
  var handleBlurEvent = useCallback(function (e) {
169
169
  setIsOpen(false);
170
- onClose && onClose(e);
171
- }, [onClose, setIsOpen]);
170
+ onClose === null || onClose === void 0 ? void 0 : onClose(e);
171
+ }, [onClose]);
172
172
  useEffect(function () {
173
173
  if (triggerEventName === TriggerEvent.HOVER) {
174
174
  if (currentTrigger) {
@@ -178,10 +178,10 @@ var Tooltip = function Tooltip(_ref) {
178
178
 
179
179
  if (isOpen) {
180
180
  document.addEventListener('mouseover', handleOutsideEvent);
181
- currentTrigger && currentTrigger.addEventListener('blur', handleBlurEvent);
181
+ currentTrigger === null || currentTrigger === void 0 ? void 0 : currentTrigger.addEventListener('blur', handleBlurEvent);
182
182
  } else {
183
183
  document.removeEventListener('mouseover', handleOutsideEvent);
184
- currentTrigger && currentTrigger.removeEventListener('blur', handleBlurEvent);
184
+ currentTrigger === null || currentTrigger === void 0 ? void 0 : currentTrigger.removeEventListener('blur', handleBlurEvent);
185
185
  }
186
186
 
187
187
  return function () {
@@ -195,7 +195,7 @@ var Tooltip = function Tooltip(_ref) {
195
195
  }
196
196
 
197
197
  return undefined;
198
- }, [triggerEventName, isOpen, currentTrigger, handleOutsideEvent, handleMouseEnter]);
198
+ }, [triggerEventName, isOpen, currentTrigger, handleOutsideEvent, handleMouseEnter, handleBlurEvent]);
199
199
  useEffect(function () {
200
200
  if (triggerEventName === TriggerEvent.CLICK) {
201
201
  if (currentTrigger) {
@@ -220,7 +220,7 @@ var Tooltip = function Tooltip(_ref) {
220
220
  }
221
221
 
222
222
  return undefined;
223
- }, [triggerEventName, isOpen, currentTrigger, handleOutsideEvent, handleClick]);
223
+ }, [triggerEventName, isOpen, currentTrigger, handleOutsideEvent, handleClick, clickEvent]);
224
224
  return /*#__PURE__*/React.createElement("div", _extends({
225
225
  className: cn({
226
226
  paddings: paddings,
@@ -70,13 +70,13 @@ h5 {
70
70
  }
71
71
  }
72
72
  .colors__list {
73
+ -webkit-box-pack: space-evenly;
74
+ -ms-flex-pack: space-evenly;
75
+ justify-content: space-evenly;
73
76
  padding-bottom: 12px;
74
77
  }
75
78
  @media screen and (max-width: 1023px) {
76
79
  .colors__list {
77
- -webkit-box-pack: space-evenly;
78
- -ms-flex-pack: space-evenly;
79
- justify-content: space-evenly;
80
80
  -webkit-box-ordinal-group: 3;
81
81
  -ms-flex-order: 2;
82
82
  order: 2;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import './Colors.less';
3
- declare const Colors: () => JSX.Element;
3
+ declare const Colors: React.FC;
4
4
  export default Colors;
@@ -256,7 +256,7 @@ var Colors = function Colors() {
256
256
  mobile: "12",
257
257
  tablet: "12"
258
258
  }, renderColorBlock(secondary)), /*#__PURE__*/React.createElement(_GridColumn["default"], {
259
- all: "5",
259
+ all: "10",
260
260
  mobile: "12",
261
261
  tablet: "12"
262
262
  }, renderColorBlock(system))), /*#__PURE__*/React.createElement(_Grid["default"], null, /*#__PURE__*/React.createElement(_GridColumn["default"], {
@@ -265,7 +265,7 @@ var Colors = function Colors() {
265
265
  tablet: "12"
266
266
  }, renderColorBlock(gradientColors)), /*#__PURE__*/React.createElement(_GridColumn["default"], {
267
267
  all: "3",
268
- leftOffsetWide: "1",
268
+ leftOffsetWide: "2",
269
269
  leftOffsetTablet: "1",
270
270
  leftOffsetDesktop: "1",
271
271
  mobile: "12",
@@ -73,6 +73,15 @@ var colors = {
73
73
  }, {
74
74
  name: 'Background',
75
75
  code: '#FFFFFF'
76
+ }, {
77
+ name: 'Button Hov. G.',
78
+ code: '#10E272'
79
+ }, {
80
+ name: 'Button Hov. P.',
81
+ code: '#A500BF'
82
+ }, {
83
+ name: 'Button Down',
84
+ code: '#404D46'
76
85
  }]
77
86
  }
78
87
  },
@@ -9,6 +9,7 @@ export interface IAccordionProps extends IFilterDataAttrs {
9
9
  /** Состояние открытости */
10
10
  isOpened?: boolean;
11
11
  /** Вертикальные отступы */
12
+ /** @deprecated */
12
13
  hasVerticalPaddings?: boolean;
13
14
  /** Дополнительный класс для корневого элемента */
14
15
  className?: string;
@@ -73,7 +73,7 @@ var Accordion = function Accordion(_ref) {
73
73
  }, [isOpened]);
74
74
 
75
75
  var handleClickTitle = function handleClickTitle() {
76
- onClickAccordion && onClickAccordion(!isOpenedState, title);
76
+ onClickAccordion === null || onClickAccordion === void 0 ? void 0 : onClickAccordion(!isOpenedState, title);
77
77
  setIsOpenedState(!isOpenedState);
78
78
  };
79
79
 
@@ -107,7 +107,9 @@ Accordion.propTypes = {
107
107
  }), PropTypes.any])]),
108
108
  title: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,
109
109
  isOpened: PropTypes.bool,
110
- hasVerticalPaddings: PropTypes.bool,
110
+ hasVerticalPaddings: function hasVerticalPaddings(props, propName) {
111
+ return props[propName] && new Error('Failed prop type: Prop "hasVerticalPaddings" is deprecated');
112
+ },
111
113
  className: PropTypes.string,
112
114
  classes: PropTypes.shape({
113
115
  openedClass: PropTypes.string,
@@ -41,6 +41,11 @@ h5 {
41
41
  -webkit-transform: translateY(-50%);
42
42
  transform: translateY(-50%);
43
43
  }
44
+ @media screen and (max-width: 767px) {
45
+ .mfui-banner__arrow {
46
+ display: none;
47
+ }
48
+ }
44
49
  .mfui-banner__arrow_prev {
45
50
  left: 12px;
46
51
  }
@@ -105,6 +110,29 @@ h5 {
105
110
  .mfui-banner__pagination_theme_dark {
106
111
  background-color: rgba(0, 0, 0, 0.25);
107
112
  }
113
+ .mfui-banner__pagination_bottom-offset {
114
+ bottom: 60px;
115
+ }
116
+ @media screen and (min-width: 768px) and (max-width: 1023px) {
117
+ .mfui-banner__pagination_bottom-offset {
118
+ bottom: 89px;
119
+ }
120
+ }
121
+ @media screen and (min-width: 1024px) and (max-width: 1279px) {
122
+ .mfui-banner__pagination_bottom-offset {
123
+ bottom: 90px;
124
+ }
125
+ }
126
+ @media screen and (min-width: 1280px) and (max-width: 1439px) {
127
+ .mfui-banner__pagination_bottom-offset {
128
+ bottom: 65px;
129
+ }
130
+ }
131
+ @media screen and (min-width: 1440px) {
132
+ .mfui-banner__pagination_bottom-offset {
133
+ bottom: 72px;
134
+ }
135
+ }
108
136
  .mfui-banner__dot {
109
137
  width: 12px;
110
138
  height: 12px;
@@ -16,6 +16,8 @@ export interface IBannerProps {
16
16
  slide?: string;
17
17
  arrow?: string;
18
18
  };
19
+ /** Предполагается использование с наезжанием на баннер следующего за баннером элемента */
20
+ withPaginationBottomOffset?: boolean;
19
21
  /** Автоматическая прокрутка */
20
22
  autoPlay?: boolean;
21
23
  /** Задержка автоматической прокрутки */
@@ -59,6 +59,8 @@ var Banner = function Banner(_ref) {
59
59
  var className = _ref.className,
60
60
  _ref$classes = _ref.classes,
61
61
  classes = _ref$classes === void 0 ? {} : _ref$classes,
62
+ _ref$withPaginationBo = _ref.withPaginationBottomOffset,
63
+ withPaginationBottomOffset = _ref$withPaginationBo === void 0 ? false : _ref$withPaginationBo,
62
64
  _ref$autoPlay = _ref.autoPlay,
63
65
  autoPlay = _ref$autoPlay === void 0 ? false : _ref$autoPlay,
64
66
  _ref$autoPlayDelay = _ref.autoPlayDelay,
@@ -110,7 +112,8 @@ var Banner = function Banner(_ref) {
110
112
  return;
111
113
  }
112
114
 
113
- autoplay.stop();
115
+ autoplay.stop(); // eslint-disable-next-line no-param-reassign
116
+
114
117
  params.autoplay.delay = autoPlayDelay * 3;
115
118
  autoplay.start();
116
119
  }, [autoPlayDelay]);
@@ -120,18 +123,18 @@ var Banner = function Banner(_ref) {
120
123
  }
121
124
 
122
125
  swiperInstance.slidePrev();
123
- onPrevClick && onPrevClick(swiperInstance.realIndex);
126
+ onPrevClick === null || onPrevClick === void 0 ? void 0 : onPrevClick(swiperInstance.realIndex);
124
127
  increaseAutoplayDelay(swiperInstance);
125
- }, [swiperInstance, onPrevClick]);
128
+ }, [swiperInstance, onPrevClick, increaseAutoplayDelay]);
126
129
  var handleNextClick = React.useCallback(function () {
127
130
  if (!swiperInstance) {
128
131
  return;
129
132
  }
130
133
 
131
134
  swiperInstance.slideNext();
132
- onNextClick && onNextClick(swiperInstance.realIndex);
135
+ onNextClick === null || onNextClick === void 0 ? void 0 : onNextClick(swiperInstance.realIndex);
133
136
  increaseAutoplayDelay(swiperInstance);
134
- }, [swiperInstance, onNextClick]);
137
+ }, [swiperInstance, onNextClick, increaseAutoplayDelay]);
135
138
  var handleDotClick = React.useCallback(function (index) {
136
139
  if (!swiperInstance) {
137
140
  return;
@@ -143,9 +146,9 @@ var Banner = function Banner(_ref) {
143
146
  swiperInstance.slideTo(index);
144
147
  }
145
148
 
146
- onDotClick && onDotClick(swiperInstance.realIndex);
149
+ onDotClick === null || onDotClick === void 0 ? void 0 : onDotClick(swiperInstance.realIndex);
147
150
  increaseAutoplayDelay(swiperInstance);
148
- }, [swiperInstance, loop, onDotClick]);
151
+ }, [swiperInstance, loop, onDotClick, increaseAutoplayDelay]);
149
152
  var handleSwiper = React.useCallback(function (swiper) {
150
153
  setSwiperInstance(swiper);
151
154
  }, []);
@@ -168,8 +171,8 @@ var Banner = function Banner(_ref) {
168
171
  var handleSlideChange = React.useCallback(function (_ref4) {
169
172
  var realIndex = _ref4.realIndex;
170
173
  setActiveIndex(realIndex);
171
- onChange && onChange(realIndex);
172
- }, []);
174
+ onChange === null || onChange === void 0 ? void 0 : onChange(realIndex);
175
+ }, [onChange]);
173
176
  var handleAutoplayStop = React.useCallback(function () {
174
177
  setAutoPlayning(false);
175
178
  }, []);
@@ -210,7 +213,8 @@ var Banner = function Banner(_ref) {
210
213
  theme: navArrowTheme
211
214
  }), /*#__PURE__*/React.createElement("div", {
212
215
  className: cn('pagination', {
213
- theme: navTheme
216
+ theme: navTheme,
217
+ 'bottom-offset': withPaginationBottomOffset
214
218
  })
215
219
  }, React.Children.map(children, function (_, i) {
216
220
  return /*#__PURE__*/React.createElement(_BannerDot["default"], {
@@ -231,6 +235,7 @@ Banner.propTypes = {
231
235
  classes: PropTypes.shape({
232
236
  slide: PropTypes.string
233
237
  }),
238
+ withPaginationBottomOffset: PropTypes.bool,
234
239
  autoPlay: PropTypes.bool,
235
240
  autoPlayDelay: PropTypes.number,
236
241
  navTheme: PropTypes.oneOf(Object.values(NavTheme)),