@megafon/ui-core 3.10.0 → 4.0.0-beta.2

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 (73) hide show
  1. package/CHANGELOG.md +22 -34
  2. package/dist/es/colors/Colors.css +4 -0
  3. package/dist/es/components/Accordion/Accordion.css +55 -23
  4. package/dist/es/components/Accordion/Accordion.js +12 -17
  5. package/dist/es/components/Badges/components/PriceBadge/PriceBadge.css +1 -1
  6. package/dist/es/components/Badges/components/PromoBadge/PromoBadge.css +1 -1
  7. package/dist/es/components/Badges/components/TimerBadge/TimerBadge.css +1 -1
  8. package/dist/es/components/Banner/Banner.d.ts +0 -2
  9. package/dist/es/components/Banner/Banner.js +17 -49
  10. package/dist/es/components/Button/Button.css +0 -40
  11. package/dist/es/components/Button/Button.d.ts +0 -1
  12. package/dist/es/components/Button/Button.js +1 -2
  13. package/dist/es/components/Calendar/Calendar.js +2 -18
  14. package/dist/es/components/Calendar/components/Day/Day.css +1 -1
  15. package/dist/es/components/Calendar/components/Month/Month.css +1 -1
  16. package/dist/es/components/Calendar/components/Month/Month.js +4 -4
  17. package/dist/es/components/Caption/Caption.css +48 -0
  18. package/dist/es/components/Caption/Caption.d.ts +31 -0
  19. package/dist/es/components/Caption/Caption.js +51 -0
  20. package/dist/es/components/Logo/Logo.js +6 -22
  21. package/dist/es/components/Notification/Notification.d.ts +0 -6
  22. package/dist/es/components/Notification/Notification.js +3 -13
  23. package/dist/es/components/Paragraph/Paragraph.css +8 -5
  24. package/dist/es/components/Paragraph/Paragraph.d.ts +4 -3
  25. package/dist/es/components/Paragraph/Paragraph.js +6 -5
  26. package/dist/es/components/RadioButton/RadioButton.css +1 -1
  27. package/dist/es/components/Select/Select.js +1 -1
  28. package/dist/es/components/Switcher/Switcher.css +1 -4
  29. package/dist/es/components/Switcher/Switcher.d.ts +0 -1
  30. package/dist/es/components/Switcher/Switcher.js +3 -4
  31. package/dist/es/components/TextField/TextField.css +128 -87
  32. package/dist/es/components/TextField/TextField.js +54 -37
  33. package/dist/es/components/Tooltip/Tooltip.d.ts +0 -4
  34. package/dist/es/components/Tooltip/Tooltip.js +1 -32
  35. package/dist/es/index.d.ts +1 -0
  36. package/dist/es/index.js +1 -0
  37. package/dist/lib/colors/Colors.css +4 -0
  38. package/dist/lib/components/Accordion/Accordion.css +55 -23
  39. package/dist/lib/components/Accordion/Accordion.js +12 -17
  40. package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.css +1 -1
  41. package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.css +1 -1
  42. package/dist/lib/components/Badges/components/TimerBadge/TimerBadge.css +1 -1
  43. package/dist/lib/components/Banner/Banner.d.ts +0 -2
  44. package/dist/lib/components/Banner/Banner.js +17 -49
  45. package/dist/lib/components/Button/Button.css +0 -40
  46. package/dist/lib/components/Button/Button.d.ts +0 -1
  47. package/dist/lib/components/Button/Button.js +1 -2
  48. package/dist/lib/components/Calendar/Calendar.js +1 -17
  49. package/dist/lib/components/Calendar/components/Day/Day.css +1 -1
  50. package/dist/lib/components/Calendar/components/Month/Month.css +1 -1
  51. package/dist/lib/components/Calendar/components/Month/Month.js +4 -4
  52. package/dist/lib/components/Caption/Caption.css +48 -0
  53. package/dist/lib/components/Caption/Caption.d.ts +31 -0
  54. package/dist/lib/components/Caption/Caption.js +71 -0
  55. package/dist/lib/components/Logo/Logo.js +6 -22
  56. package/dist/lib/components/Notification/Notification.d.ts +0 -6
  57. package/dist/lib/components/Notification/Notification.js +3 -13
  58. package/dist/lib/components/Paragraph/Paragraph.css +8 -5
  59. package/dist/lib/components/Paragraph/Paragraph.d.ts +4 -3
  60. package/dist/lib/components/Paragraph/Paragraph.js +6 -5
  61. package/dist/lib/components/RadioButton/RadioButton.css +1 -1
  62. package/dist/lib/components/Select/Select.js +1 -1
  63. package/dist/lib/components/Switcher/Switcher.css +1 -4
  64. package/dist/lib/components/Switcher/Switcher.d.ts +0 -1
  65. package/dist/lib/components/Switcher/Switcher.js +3 -4
  66. package/dist/lib/components/TextField/TextField.css +128 -87
  67. package/dist/lib/components/TextField/TextField.js +54 -39
  68. package/dist/lib/components/Tooltip/Tooltip.d.ts +0 -4
  69. package/dist/lib/components/Tooltip/Tooltip.js +1 -36
  70. package/dist/lib/index.d.ts +1 -0
  71. package/dist/lib/index.js +8 -0
  72. package/package.json +3 -3
  73. package/styles/base.less +4 -1
@@ -1,51 +1,83 @@
1
1
  .mfui-accordion {
2
- border-top: 1px solid var(--spbSky2);
3
- border-bottom: 1px solid var(--spbSky2);
2
+ border-radius: 12px;
3
+ background: var(--spbSky0);
4
4
  }
5
5
  .mfui-accordion + .mfui-accordion {
6
- border-top: none;
7
- }
8
- .mfui-accordion:not(.mfui-accordion_open) .mfui-accordion__title-wrap:hover {
9
- background: var(--spbSky0);
6
+ margin-top: 8px;
10
7
  }
11
- .mfui-accordion.mfui-accordion_open .mfui-accordion__title-wrap {
12
- background: var(--spbSky1);
8
+ @media screen and (min-width: 768px) {
9
+ .mfui-accordion + .mfui-accordion {
10
+ margin-top: 12px;
11
+ }
13
12
  }
14
13
  .mfui-accordion__title-wrap {
15
14
  position: relative;
16
- padding: 24px 52px 24px 16px;
15
+ padding: 20px 20px 20px 16px;
16
+ border-radius: 12px;
17
17
  cursor: pointer;
18
+ -webkit-transition: background-color 0.3s;
19
+ transition: background-color 0.3s;
18
20
  }
19
21
  @media screen and (min-width: 768px) {
20
22
  .mfui-accordion__title-wrap {
21
- padding: 24px 68px 24px 24px;
23
+ padding: 20px 24px;
22
24
  }
23
25
  }
24
- @media screen and (min-width: 1280px) {
25
- .mfui-accordion__title-wrap {
26
- padding: 24px 72px 24px 24px;
27
- }
26
+ .mfui-accordion__title-wrap:hover {
27
+ background: var(--spbSky1);
28
28
  }
29
29
  .mfui-accordion__icon-box {
30
30
  position: absolute;
31
31
  top: 50%;
32
32
  right: 20px;
33
- width: 32px;
34
- height: 32px;
35
- outline: none;
33
+ display: -webkit-box;
34
+ display: -ms-flexbox;
35
+ display: flex;
36
+ -webkit-box-align: center;
37
+ -ms-flex-align: center;
38
+ align-items: center;
39
+ -webkit-box-pack: center;
40
+ -ms-flex-pack: center;
41
+ justify-content: center;
42
+ width: 24px;
43
+ height: 24px;
44
+ border-radius: 50%;
45
+ background-color: var(--base);
46
+ -webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
47
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
36
48
  -webkit-transform: translateY(-50%);
37
49
  transform: translateY(-50%);
38
- opacity: 1;
39
- fill: var(--content);
50
+ }
51
+ @media screen and (min-width: 768px) {
52
+ .mfui-accordion__icon-box {
53
+ right: 24px;
54
+ width: 32px;
55
+ height: 32px;
56
+ }
57
+ }
58
+ .mfui-accordion__icon {
59
+ width: 20px;
60
+ height: 20px;
61
+ -webkit-transition: -webkit-transform 0.6s;
62
+ transition: -webkit-transform 0.6s;
63
+ transition: transform 0.6s;
64
+ transition: transform 0.6s, -webkit-transform 0.6s;
65
+ }
66
+ @media screen and (min-width: 768px) {
67
+ .mfui-accordion__icon {
68
+ width: 32px;
69
+ height: 32px;
70
+ }
40
71
  }
41
72
  .mfui-accordion__content-inner {
42
- padding: 24px 16px;
73
+ padding: 4px 20px 20px 16px;
43
74
  }
44
75
  @media screen and (min-width: 768px) {
45
76
  .mfui-accordion__content-inner {
46
- padding: 24px;
77
+ padding: 4px 24px 20px;
47
78
  }
48
79
  }
49
- .mfui-accordion__icon {
50
- fill: var(--content);
80
+ .mfui-accordion_opened .mfui-accordion__icon {
81
+ -webkit-transform: rotate(180deg);
82
+ transform: rotate(180deg);
51
83
  }
@@ -31,15 +31,9 @@ var ArrowDown = function ArrowDown(props) {
31
31
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
32
32
  viewBox: "0 0 32 32"
33
33
  }, props), /*#__PURE__*/React.createElement("path", {
34
- d: "M11.2 12l4.8 4.8 4.8-4.8 1.7 1.6L16 20l-6.5-6.4z"
35
- }));
36
- };
37
-
38
- var ArrowUp = function ArrowUp(props) {
39
- return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
40
- viewBox: "0 0 32 32"
41
- }, props), /*#__PURE__*/React.createElement("path", {
42
- d: "M20.8 20L16 15.2 11.2 20l-1.7-1.6L16 12l6.5 6.4z"
34
+ fillRule: "evenodd",
35
+ clipRule: "evenodd",
36
+ d: "M11 14h10l-5 6z"
43
37
  }));
44
38
  };
45
39
 
@@ -78,24 +72,25 @@ var Accordion = function Accordion(_ref) {
78
72
  };
79
73
 
80
74
  var openedClassName = isOpenedState ? openedClass : undefined;
75
+ var arrowDataAttrs = isOpenedState ? dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowUp : dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowDown;
81
76
  return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
82
77
  ref: rootRef,
83
78
  className: cn({
84
- open: isOpenedState
79
+ opened: isOpenedState
85
80
  }, [className, rootPropsClasses, openedClassName])
86
81
  }), /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.titleWrap), {
87
82
  className: cn('title-wrap', [titleWrapPropsClasses]),
88
83
  onClick: handleClickTitle,
89
- onKeyDown: handleClickTitle
84
+ onKeyDown: handleClickTitle,
85
+ tabIndex: 0,
86
+ role: "button"
90
87
  }), /*#__PURE__*/React.createElement(_Header["default"], (0, _extends2["default"])({
91
88
  as: "h5"
92
89
  }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.header)), title), /*#__PURE__*/React.createElement("div", {
93
- tabIndex: 0,
94
- role: "button",
95
- className: cn('icon-box', {
96
- open: isOpenedState
97
- })
98
- }, isOpenedState ? /*#__PURE__*/React.createElement(ArrowUp, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowUp)) : /*#__PURE__*/React.createElement(ArrowDown, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowDown)))), /*#__PURE__*/React.createElement(_Collapse["default"], (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.collapse), {
90
+ className: cn('icon-box')
91
+ }, /*#__PURE__*/React.createElement(ArrowDown, (0, _extends2["default"])({
92
+ className: cn('icon')
93
+ }, (0, _uiHelpers.filterDataAttrs)(arrowDataAttrs))))), /*#__PURE__*/React.createElement(_Collapse["default"], (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.collapse), {
99
94
  className: cn('content', collapsePropsClasses),
100
95
  classNameContainer: cn('content-inner'),
101
96
  isOpened: isOpenedState
@@ -1,6 +1,6 @@
1
1
  .mfui-price-badge {
2
2
  font-size: 12px;
3
- line-height: 16px;
3
+ line-height: 18px;
4
4
  display: -webkit-box;
5
5
  display: -ms-flexbox;
6
6
  display: flex;
@@ -30,6 +30,6 @@
30
30
  .mfui-promo-badge__text {
31
31
  font-family: inherit;
32
32
  font-size: 12px;
33
- line-height: 16px;
33
+ line-height: 18px;
34
34
  font-weight: 500;
35
35
  }
@@ -32,7 +32,7 @@
32
32
  }
33
33
  .mfui-timer-badge__text {
34
34
  font-size: 12px;
35
- line-height: 16px;
35
+ line-height: 18px;
36
36
  font-family: inherit;
37
37
  margin-left: 2px;
38
38
  font-weight: 500;
@@ -32,8 +32,6 @@ export interface IBannerProps {
32
32
  autoPlay?: boolean;
33
33
  /** Задержка автоматической прокрутки */
34
34
  autoPlayDelay?: number;
35
- /** Пауза автоматической прокрутки при наведении курсора на компонент */
36
- pauseOnHover?: boolean;
37
35
  /** Цветовая тема навигации */
38
36
  navTheme?: NavThemeType;
39
37
  /** Обработчик клика по стрелке "вперед" (должен быть обернут в useCallback) */
@@ -77,9 +77,7 @@ var Banner = function Banner(_ref) {
77
77
  onPrevClick = _ref.onPrevClick,
78
78
  onDotClick = _ref.onDotClick,
79
79
  onChange = _ref.onChange,
80
- dataAttrs = _ref.dataAttrs,
81
- _ref$pauseOnHover = _ref.pauseOnHover,
82
- pauseOnHover = _ref$pauseOnHover === void 0 ? false : _ref$pauseOnHover;
80
+ dataAttrs = _ref.dataAttrs;
83
81
 
84
82
  var _React$useState = React.useState(),
85
83
  _React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
@@ -99,42 +97,29 @@ var Banner = function Banner(_ref) {
99
97
  var _React$useState7 = React.useState(autoPlay),
100
98
  _React$useState8 = (0, _slicedToArray2["default"])(_React$useState7, 2),
101
99
  isAutoPlaying = _React$useState8[0],
102
- setAutoPlaying = _React$useState8[1];
100
+ setAutoPlayning = _React$useState8[1];
103
101
 
104
102
  var _React$useState9 = React.useState(0),
105
103
  _React$useState10 = (0, _slicedToArray2["default"])(_React$useState9, 2),
106
104
  activeIndex = _React$useState10[0],
107
105
  setActiveIndex = _React$useState10[1];
108
106
 
109
- var _React$useState11 = React.useState(autoPlayDelay),
110
- _React$useState12 = (0, _slicedToArray2["default"])(_React$useState11, 2),
111
- delay = _React$useState12[0],
112
- setDelay = _React$useState12[1];
113
-
114
- var _React$useState13 = React.useState(false),
115
- _React$useState14 = (0, _slicedToArray2["default"])(_React$useState13, 2),
116
- isIncreasedDelay = _React$useState14[0],
117
- setIsIncreasedDelay = _React$useState14[1];
118
-
119
107
  var showDotTimer = loop ? isAutoPlaying : isAutoPlaying && !isEnd;
120
- var dotTimerDelay = delay / 1000;
108
+ var dotTimerDelay = autoPlayDelay / 1000;
121
109
  var navArrowTheme = navTheme === NavTheme.DARK ? _NavArrow.Theme.DARK : _NavArrow.Theme.PURPLE;
122
- var rootRef = React.useRef(null);
123
110
  var increaseAutoplayDelay = React.useCallback(function (_ref2) {
124
111
  var params = _ref2.params,
125
112
  autoplay = _ref2.autoplay;
126
113
 
127
- if ((0, _typeof2["default"])(params.autoplay) !== 'object' || !autoPlay) {
114
+ if ((0, _typeof2["default"])(params.autoplay) !== 'object' || !autoplay.running) {
128
115
  return;
129
116
  }
130
117
 
131
118
  autoplay.stop(); // eslint-disable-next-line no-param-reassign
132
119
 
133
120
  params.autoplay.delay = autoPlayDelay * 3;
134
- setDelay(autoPlayDelay * 3);
135
- setIsIncreasedDelay(true);
136
121
  autoplay.start();
137
- }, [autoPlay, autoPlayDelay]);
122
+ }, [autoPlayDelay]);
138
123
  var handlePrevClick = React.useCallback(function () {
139
124
  if (!swiperInstance) {
140
125
  return;
@@ -142,8 +127,8 @@ var Banner = function Banner(_ref) {
142
127
 
143
128
  swiperInstance.slidePrev();
144
129
  onPrevClick === null || onPrevClick === void 0 ? void 0 : onPrevClick(swiperInstance.realIndex);
145
- !isIncreasedDelay && increaseAutoplayDelay(swiperInstance);
146
- }, [swiperInstance, onPrevClick, isIncreasedDelay, increaseAutoplayDelay]);
130
+ increaseAutoplayDelay(swiperInstance);
131
+ }, [swiperInstance, onPrevClick, increaseAutoplayDelay]);
147
132
  var handleNextClick = React.useCallback(function () {
148
133
  if (!swiperInstance) {
149
134
  return;
@@ -151,8 +136,8 @@ var Banner = function Banner(_ref) {
151
136
 
152
137
  swiperInstance.slideNext();
153
138
  onNextClick === null || onNextClick === void 0 ? void 0 : onNextClick(swiperInstance.realIndex);
154
- !isIncreasedDelay && increaseAutoplayDelay(swiperInstance);
155
- }, [swiperInstance, onNextClick, isIncreasedDelay, increaseAutoplayDelay]);
139
+ increaseAutoplayDelay(swiperInstance);
140
+ }, [swiperInstance, onNextClick, increaseAutoplayDelay]);
156
141
  var handleDotClick = React.useCallback(function (index) {
157
142
  if (!swiperInstance) {
158
143
  return;
@@ -165,8 +150,11 @@ var Banner = function Banner(_ref) {
165
150
  }
166
151
 
167
152
  onDotClick === null || onDotClick === void 0 ? void 0 : onDotClick(swiperInstance.realIndex);
168
- !isIncreasedDelay && increaseAutoplayDelay(swiperInstance);
169
- }, [swiperInstance, loop, onDotClick, isIncreasedDelay, increaseAutoplayDelay]);
153
+ increaseAutoplayDelay(swiperInstance);
154
+ }, [swiperInstance, loop, onDotClick, increaseAutoplayDelay]);
155
+ var handleSwiper = React.useCallback(function (swiper) {
156
+ setSwiperInstance(swiper);
157
+ }, []);
170
158
  var handleReachBeginning = React.useCallback(function () {
171
159
  setBeginning(true);
172
160
  }, []);
@@ -189,42 +177,23 @@ var Banner = function Banner(_ref) {
189
177
  onChange === null || onChange === void 0 ? void 0 : onChange(realIndex);
190
178
  }, [onChange]);
191
179
  var handleAutoplayStop = React.useCallback(function () {
192
- setAutoPlaying(false);
180
+ setAutoPlayning(false);
193
181
  }, []);
194
- var handleAutoPlayStart = React.useCallback(function () {
195
- setAutoPlaying(true);
196
- }, []);
197
- React.useEffect(function () {
198
- var rootElement = rootRef.current;
199
-
200
- if (!pauseOnHover || !autoPlay) {
201
- return;
202
- }
203
-
204
- rootElement === null || rootElement === void 0 ? void 0 : rootElement.addEventListener('mouseenter', function () {
205
- swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay.stop();
206
- });
207
- rootElement === null || rootElement === void 0 ? void 0 : rootElement.addEventListener('mouseleave', function () {
208
- swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay.start();
209
- });
210
- }, [autoPlay, pauseOnHover, swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay]);
211
182
  return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
212
183
  className: cn({
213
184
  'nav-theme': navTheme
214
- }, className),
215
- ref: rootRef
185
+ }, className)
216
186
  }), /*#__PURE__*/React.createElement(_react2.Swiper, (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.swiper), {
217
187
  className: cn('swiper'),
218
188
  loop: loop,
219
189
  autoplay: autoPlay ? getAutoPlayConfig(autoPlayDelay) : false,
220
190
  watchSlidesVisibility: true,
221
- onSwiper: setSwiperInstance,
191
+ onSwiper: handleSwiper,
222
192
  onReachBeginning: handleReachBeginning,
223
193
  onReachEnd: handleReachEnd,
224
194
  onFromEdge: handleFromEdge,
225
195
  onSlideChange: handleSlideChange,
226
196
  onAutoplayStop: handleAutoplayStop,
227
- onAutoplayStart: handleAutoPlayStart,
228
197
  onTouchEnd: increaseAutoplayDelay
229
198
  }), React.Children.map(children, function (child, i) {
230
199
  return /*#__PURE__*/React.createElement(_react2.SwiperSlide, (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.slide, i + 1), {
@@ -291,7 +260,6 @@ Banner.propTypes = {
291
260
  }),
292
261
  autoPlay: PropTypes.bool,
293
262
  autoPlayDelay: PropTypes.number,
294
- pauseOnHover: PropTypes.bool,
295
263
  navTheme: PropTypes.oneOf(Object.values(NavTheme)),
296
264
  onNextClick: PropTypes.func,
297
265
  onPrevClick: PropTypes.func,
@@ -21,10 +21,6 @@
21
21
  appearance: none;
22
22
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
23
23
  }
24
- .mfui-button_size-all_extra-small .mfui-button__inner {
25
- min-width: 26px;
26
- height: 26px;
27
- }
28
24
  .mfui-button_size-all_small .mfui-button__inner {
29
25
  min-width: 32px;
30
26
  height: 32px;
@@ -37,10 +33,6 @@
37
33
  min-width: 60px;
38
34
  height: 60px;
39
35
  }
40
- .mfui-button_size-all_extra-small .mfui-button__icon {
41
- width: 18px;
42
- height: 18px;
43
- }
44
36
  .mfui-button_size-all_small .mfui-button__icon {
45
37
  width: 24px;
46
38
  height: 24px;
@@ -54,10 +46,6 @@
54
46
  height: 40px;
55
47
  }
56
48
  @media screen and (min-width: 1280px) {
57
- .mfui-button_size-wide_extra-small .mfui-button__inner {
58
- min-width: 26px;
59
- height: 26px;
60
- }
61
49
  .mfui-button_size-wide_small .mfui-button__inner {
62
50
  min-width: 32px;
63
51
  height: 32px;
@@ -70,10 +58,6 @@
70
58
  min-width: 60px;
71
59
  height: 60px;
72
60
  }
73
- .mfui-button_size-wide_extra-small .mfui-button__icon {
74
- width: 18px;
75
- height: 18px;
76
- }
77
61
  .mfui-button_size-wide_small .mfui-button__icon {
78
62
  width: 24px;
79
63
  height: 24px;
@@ -88,10 +72,6 @@
88
72
  }
89
73
  }
90
74
  @media screen and (min-width: 1024px) {
91
- .mfui-button_size-desktop_extra-small .mfui-button__inner {
92
- min-width: 26px;
93
- height: 26px;
94
- }
95
75
  .mfui-button_size-desktop_small .mfui-button__inner {
96
76
  min-width: 32px;
97
77
  height: 32px;
@@ -104,10 +84,6 @@
104
84
  min-width: 60px;
105
85
  height: 60px;
106
86
  }
107
- .mfui-button_size-desktop_extra-small .mfui-button__icon {
108
- width: 18px;
109
- height: 18px;
110
- }
111
87
  .mfui-button_size-desktop_small .mfui-button__icon {
112
88
  width: 24px;
113
89
  height: 24px;
@@ -122,10 +98,6 @@
122
98
  }
123
99
  }
124
100
  @media screen and (min-width: 768px) and (max-width: 1023px) {
125
- .mfui-button_size-tablet_extra-small .mfui-button__inner {
126
- min-width: 26px;
127
- height: 26px;
128
- }
129
101
  .mfui-button_size-tablet_small .mfui-button__inner {
130
102
  min-width: 32px;
131
103
  height: 32px;
@@ -138,10 +110,6 @@
138
110
  min-width: 60px;
139
111
  height: 60px;
140
112
  }
141
- .mfui-button_size-tablet_extra-small .mfui-button__icon {
142
- width: 18px;
143
- height: 18px;
144
- }
145
113
  .mfui-button_size-tablet_small .mfui-button__icon {
146
114
  width: 24px;
147
115
  height: 24px;
@@ -156,10 +124,6 @@
156
124
  }
157
125
  }
158
126
  @media screen and (max-width: 767px) {
159
- .mfui-button_size-mobile_extra-small .mfui-button__inner {
160
- min-width: 26px;
161
- height: 26px;
162
- }
163
127
  .mfui-button_size-mobile_small .mfui-button__inner {
164
128
  min-width: 32px;
165
129
  height: 32px;
@@ -172,10 +136,6 @@
172
136
  min-width: 60px;
173
137
  height: 60px;
174
138
  }
175
- .mfui-button_size-mobile_extra-small .mfui-button__icon {
176
- width: 18px;
177
- height: 18px;
178
- }
179
139
  .mfui-button_size-mobile_small .mfui-button__icon {
180
140
  width: 24px;
181
141
  height: 24px;
@@ -13,7 +13,6 @@ export declare const ButtonThemes: {
13
13
  };
14
14
  declare type ButtonThemesType = typeof ButtonThemes[keyof typeof ButtonThemes];
15
15
  export declare const ButtonSizes: {
16
- readonly EXTRA_SMALL: "extra-small";
17
16
  readonly SMALL: "small";
18
17
  readonly MEDIUM: "medium";
19
18
  readonly LARGE: "large";
@@ -54,7 +54,6 @@ var ButtonThemes = {
54
54
  };
55
55
  exports.ButtonThemes = ButtonThemes;
56
56
  var ButtonSizes = {
57
- EXTRA_SMALL: 'extra-small',
58
57
  SMALL: 'small',
59
58
  MEDIUM: 'medium',
60
59
  LARGE: 'large'
@@ -69,7 +68,7 @@ var Content;
69
68
  })(Content || (Content = {}));
70
69
 
71
70
  var getLoaderSize = function getLoaderSize(size) {
72
- return size === ButtonSizes.SMALL || size === ButtonSizes.EXTRA_SMALL ? ButtonSizes.SMALL : ButtonSizes.MEDIUM;
71
+ return size === ButtonSizes.SMALL ? ButtonSizes.SMALL : ButtonSizes.MEDIUM;
73
72
  };
74
73
 
75
74
  var cn = (0, _uiHelpers.cnCreate)('mfui-button');
@@ -86,17 +86,6 @@ var dayLabelFormat = function dayLabelFormat(date) {
86
86
  var monthLabelFormat = function monthLabelFormat(date) {
87
87
  return formatDate(date, 'LLLL');
88
88
  };
89
- /* List of cases to check on component change:
90
-
91
- - Should correctly choose value and trigger callbacks with correct arguments on dates choose.
92
- - Should set 1 day period if start and end date is equal
93
- - Should correctly increase period if choose earlier start date
94
- - Should correctly change start date of selected period if chosen date in period closer to current start date
95
- - Should correctly change end date of selected period if chosen date in period closer to current end date
96
- - Should correctly highlights period if start date chosen and hover on possible end date
97
-
98
- */
99
-
100
89
 
101
90
  var cn = (0, _uiHelpers.cnCreate)('mfui-calendar');
102
91
 
@@ -135,7 +124,6 @@ var Calendar = function Calendar(_ref) {
135
124
  hoveredDate = _useState4[0],
136
125
  setHoveredDate = _useState4[1];
137
126
 
138
- var isUserChoice = (0, _react.useRef)(false);
139
127
  var stateStartDate = calendarState.startDate,
140
128
  stateEndDate = calendarState.endDate,
141
129
  stateFocusedInput = calendarState.focusedInput;
@@ -156,13 +144,10 @@ var Calendar = function Calendar(_ref) {
156
144
  goToDate = _a.goToDate,
157
145
  pickerProps = __rest(_a, ["firstDayOfWeek", "activeMonths", "goToPreviousMonths", "goToNextMonths", "goToDate"]);
158
146
 
159
- (0, _react.useEffect)(function () {
160
- isUserChoice.current = false;
161
- }, [startDate]);
162
147
  (0, _react.useEffect)(function () {
163
148
  var propsStartDate = calendarStateFromProps.startDate;
164
149
  setCalendarState(calendarStateFromProps);
165
- !isUserChoice.current && propsStartDate && goToDate(propsStartDate); // eslint-disable-next-line react-hooks/exhaustive-deps
150
+ propsStartDate && goToDate(propsStartDate); // eslint-disable-next-line react-hooks/exhaustive-deps
166
151
  }, [calendarStateFromProps]);
167
152
 
168
153
  var getCalendarState = function getCalendarState(date) {
@@ -227,7 +212,6 @@ var Calendar = function Calendar(_ref) {
227
212
  var nextStartDate = nextState.startDate,
228
213
  nextEndDate = nextState.endDate;
229
214
  setCalendarState(nextState);
230
- isUserChoice.current = true;
231
215
  onChange === null || onChange === void 0 ? void 0 : onChange(nextStartDate, nextEndDate);
232
216
  };
233
217
 
@@ -21,7 +21,7 @@
21
21
  user-select: none;
22
22
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
23
23
  font-size: 12px;
24
- line-height: 16px;
24
+ line-height: 18px;
25
25
  }
26
26
  .mfui-day:last-child {
27
27
  padding-right: 0;
@@ -56,7 +56,7 @@
56
56
  }
57
57
  .mfui-month__weekday {
58
58
  font-size: 12px;
59
- line-height: 16px;
59
+ line-height: 18px;
60
60
  width: 20px;
61
61
  height: 16px;
62
62
  color: var(--content);
@@ -23,9 +23,9 @@ var ArrowLeft = function ArrowLeft(props) {
23
23
  return /*#__PURE__*/_react["default"].createElement("svg", (0, _extends2["default"])({
24
24
  viewBox: "0 0 20 20"
25
25
  }, props), /*#__PURE__*/_react["default"].createElement("path", {
26
- d: "M12 6v8l-5-4z",
27
26
  fillRule: "evenodd",
28
- clipRule: "evenodd"
27
+ clipRule: "evenodd",
28
+ d: "M12 6v8l-5-4z"
29
29
  }));
30
30
  };
31
31
 
@@ -33,9 +33,9 @@ var ArrowRight = function ArrowRight(props) {
33
33
  return /*#__PURE__*/_react["default"].createElement("svg", (0, _extends2["default"])({
34
34
  viewBox: "0 0 20 20"
35
35
  }, props), /*#__PURE__*/_react["default"].createElement("path", {
36
- d: "M8 14V6l5 4z",
37
36
  fillRule: "evenodd",
38
- clipRule: "evenodd"
37
+ clipRule: "evenodd",
38
+ d: "M8 14V6l5 4z"
39
39
  }));
40
40
  };
41
41
 
@@ -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;