@megafon/ui-core 3.8.0 → 4.0.0-beta.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 (57) hide show
  1. package/CHANGELOG.md +12 -30
  2. package/dist/es/colors/Colors.css +4 -0
  3. package/dist/es/components/Badges/components/PriceBadge/PriceBadge.css +1 -1
  4. package/dist/es/components/Badges/components/PromoBadge/PromoBadge.css +1 -1
  5. package/dist/es/components/Badges/components/TimerBadge/TimerBadge.css +1 -1
  6. package/dist/es/components/Button/Button.css +0 -40
  7. package/dist/es/components/Button/Button.d.ts +0 -1
  8. package/dist/es/components/Button/Button.js +1 -2
  9. package/dist/es/components/Calendar/Calendar.js +2 -18
  10. package/dist/es/components/Calendar/components/Day/Day.css +1 -1
  11. package/dist/es/components/Calendar/components/Month/Month.css +1 -1
  12. package/dist/es/components/Calendar/components/Month/Month.js +4 -4
  13. package/dist/es/components/Caption/Caption.css +48 -0
  14. package/dist/es/components/Caption/Caption.d.ts +31 -0
  15. package/dist/es/components/Caption/Caption.js +51 -0
  16. package/dist/es/components/Logo/Logo.js +6 -22
  17. package/dist/es/components/Notification/Notification.d.ts +0 -6
  18. package/dist/es/components/Notification/Notification.js +3 -13
  19. package/dist/es/components/Paragraph/Paragraph.css +8 -5
  20. package/dist/es/components/Paragraph/Paragraph.d.ts +4 -3
  21. package/dist/es/components/Paragraph/Paragraph.js +6 -5
  22. package/dist/es/components/RadioButton/RadioButton.css +1 -1
  23. package/dist/es/components/Switcher/Switcher.css +1 -4
  24. package/dist/es/components/TextField/TextField.js +2 -3
  25. package/dist/es/components/Tooltip/Tooltip.d.ts +0 -2
  26. package/dist/es/components/Tooltip/Tooltip.js +1 -27
  27. package/dist/es/index.d.ts +1 -0
  28. package/dist/es/index.js +1 -0
  29. package/dist/lib/colors/Colors.css +4 -0
  30. package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.css +1 -1
  31. package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.css +1 -1
  32. package/dist/lib/components/Badges/components/TimerBadge/TimerBadge.css +1 -1
  33. package/dist/lib/components/Button/Button.css +0 -40
  34. package/dist/lib/components/Button/Button.d.ts +0 -1
  35. package/dist/lib/components/Button/Button.js +1 -2
  36. package/dist/lib/components/Calendar/Calendar.js +1 -17
  37. package/dist/lib/components/Calendar/components/Day/Day.css +1 -1
  38. package/dist/lib/components/Calendar/components/Month/Month.css +1 -1
  39. package/dist/lib/components/Calendar/components/Month/Month.js +4 -4
  40. package/dist/lib/components/Caption/Caption.css +48 -0
  41. package/dist/lib/components/Caption/Caption.d.ts +31 -0
  42. package/dist/lib/components/Caption/Caption.js +71 -0
  43. package/dist/lib/components/Logo/Logo.js +6 -22
  44. package/dist/lib/components/Notification/Notification.d.ts +0 -6
  45. package/dist/lib/components/Notification/Notification.js +3 -13
  46. package/dist/lib/components/Paragraph/Paragraph.css +8 -5
  47. package/dist/lib/components/Paragraph/Paragraph.d.ts +4 -3
  48. package/dist/lib/components/Paragraph/Paragraph.js +6 -5
  49. package/dist/lib/components/RadioButton/RadioButton.css +1 -1
  50. package/dist/lib/components/Switcher/Switcher.css +1 -4
  51. package/dist/lib/components/TextField/TextField.js +3 -4
  52. package/dist/lib/components/Tooltip/Tooltip.d.ts +0 -2
  53. package/dist/lib/components/Tooltip/Tooltip.js +1 -31
  54. package/dist/lib/index.d.ts +1 -0
  55. package/dist/lib/index.js +8 -0
  56. package/package.json +3 -3
  57. package/styles/base.less +1 -1
@@ -7,6 +7,7 @@ import "./Paragraph.css";
7
7
  var COLORS = {
8
8
  INHERIT: 'inherit',
9
9
  DEFAULT: 'default',
10
+ GRAY: 'gray',
10
11
  WHITE: 'white',
11
12
  GREEN: 'green',
12
13
  PURPLE: 'purple'
@@ -14,11 +15,11 @@ var COLORS = {
14
15
  var cn = cnCreate('mfui-paragraph');
15
16
 
16
17
  var Paragraph = function Paragraph(_ref) {
17
- var _ref$size = _ref.size,
18
- size = _ref$size === void 0 ? 'regular' : _ref$size,
19
- align = _ref.align,
18
+ var align = _ref.align,
20
19
  _ref$color = _ref.color,
21
20
  color = _ref$color === void 0 ? 'default' : _ref$color,
21
+ _ref$space = _ref.space,
22
+ space = _ref$space === void 0 ? 'wide' : _ref$space,
22
23
  className = _ref.className,
23
24
  _ref$hasMargin = _ref.hasMargin,
24
25
  hasMargin = _ref$hasMargin === void 0 ? true : _ref$hasMargin,
@@ -26,9 +27,9 @@ var Paragraph = function Paragraph(_ref) {
26
27
  children = _ref.children;
27
28
  return /*#__PURE__*/React.createElement("p", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
28
29
  className: cn({
29
- size: size,
30
30
  align: align,
31
31
  color: color,
32
+ space: space,
32
33
  'has-margin': hasMargin
33
34
  }, className)
34
35
  }), children);
@@ -39,7 +40,7 @@ Paragraph.propTypes = {
39
40
  root: PropTypes.objectOf(PropTypes.string.isRequired)
40
41
  }),
41
42
  align: PropTypes.oneOf(['left', 'center', 'right']),
42
- size: PropTypes.oneOf(['regular', 'small']),
43
+ space: PropTypes.oneOf(['wide', 'tight']),
43
44
  hasMargin: PropTypes.bool,
44
45
  color: PropTypes.oneOf(Object.values(COLORS))
45
46
  };
@@ -60,7 +60,7 @@
60
60
  }
61
61
  .mfui-radio-button__text_size_small {
62
62
  font-size: 12px;
63
- line-height: 16px;
63
+ line-height: 18px;
64
64
  }
65
65
  .mfui-radio-button__text_size_medium {
66
66
  font-size: 15px;
@@ -13,7 +13,7 @@
13
13
  }
14
14
  .mfui-switcher__content_size_small {
15
15
  font-size: 12px;
16
- line-height: 16px;
16
+ line-height: 18px;
17
17
  }
18
18
  .mfui-switcher__content_left {
19
19
  margin-right: 12px;
@@ -84,9 +84,6 @@
84
84
  border-radius: 15.5px;
85
85
  overflow: hidden;
86
86
  background-color: var(--spbSky1);
87
- outline: none;
88
- -webkit-transform: translateZ(0);
89
- transform: translateZ(0);
90
87
  cursor: pointer;
91
88
  -webkit-transition: background-color 0.3s;
92
89
  transition: background-color 0.3s;
@@ -8,8 +8,8 @@ import { useCallback, useEffect, useState, useRef, useMemo } from 'react';
8
8
  import { cnCreate, detectTouch, filterDataAttrs } from '@megafon/ui-helpers';
9
9
  import * as PropTypes from 'prop-types';
10
10
  import InputMask from 'react-input-mask';
11
+ import Caption from "../Caption/Caption";
11
12
  import InputLabel from "../InputLabel/InputLabel";
12
- import Paragraph from "../Paragraph/Paragraph";
13
13
  import "./TextField.css";
14
14
 
15
15
  var Hide = function Hide(props) {
@@ -359,8 +359,7 @@ var TextField = function TextField(_ref) {
359
359
  error: verification === Verification.ERROR,
360
360
  success: verification === Verification.VALID
361
361
  })
362
- }), noticeText), symbolCounter && /*#__PURE__*/React.createElement(Paragraph, {
363
- size: "small",
362
+ }), noticeText), symbolCounter && /*#__PURE__*/React.createElement(Caption, {
364
363
  hasMargin: false,
365
364
  className: cn('counter', {
366
365
  error: isMaxLimitExceeded
@@ -37,8 +37,6 @@ export interface ITooltipProps {
37
37
  targetElement?: React.RefObject<HTMLElement>;
38
38
  /** Управление состоянием. Компонент поддерживает контроллируемое и неконтроллируемое состояние. */
39
39
  isOpened?: boolean;
40
- /** Отрендерить компонент в корневой элементе страницы body */
41
- isPortal?: boolean;
42
40
  /** Дополнительный класс корневого элемента */
43
41
  className?: string;
44
42
  /** Дополнительные классы для внутренних элементов */
@@ -6,7 +6,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
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
- import ReactDOM from 'react-dom';
10
9
  import { usePopper } from 'react-popper';
11
10
  import Tile from "../Tile/Tile";
12
11
  import "./Tooltip.css";
@@ -46,8 +45,6 @@ var Tooltip = function Tooltip(_ref) {
46
45
  targetElement = _ref.targetElement,
47
46
  _ref$isOpened = _ref.isOpened,
48
47
  isOpened = _ref$isOpened === void 0 ? false : _ref$isOpened,
49
- _ref$isPortal = _ref.isPortal,
50
- isPortal = _ref$isPortal === void 0 ? false : _ref$isPortal,
51
48
  children = _ref.children,
52
49
  _ref$classes = _ref.classes;
53
50
  _ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
@@ -61,7 +58,6 @@ var Tooltip = function Tooltip(_ref) {
61
58
  var currentTrigger = triggerElement.current;
62
59
  var currentTarget = (targetElement === null || targetElement === void 0 ? void 0 : targetElement.current) || currentTrigger;
63
60
  var currentBoundary = boundaryElement === null || boundaryElement === void 0 ? void 0 : boundaryElement.current;
64
- var portalElem = React.useRef(null);
65
61
 
66
62
  var _useState = useState(null),
67
63
  _useState2 = _slicedToArray(_useState, 2),
@@ -219,16 +215,7 @@ var Tooltip = function Tooltip(_ref) {
219
215
 
220
216
  return undefined;
221
217
  }, [triggerEventName, isOpen, currentTrigger, handleOutsideEvent, handleClick, clickEvent]);
222
- useEffect(function () {
223
- return function () {
224
- if (portalElem.current) {
225
- document.body.removeChild(portalElem.current);
226
- }
227
-
228
- portalElem.current = null;
229
- };
230
- }, []);
231
- var template = /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
218
+ return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
232
219
  className: cn({
233
220
  paddings: paddings,
234
221
  open: isOpen
@@ -251,18 +238,6 @@ var Tooltip = function Tooltip(_ref) {
251
238
  shadowLevel: "high",
252
239
  className: cn('content-shadow', [contentShadowClassName])
253
240
  }));
254
- /* Не в эффекте, чтобы не создавать лишний перерендер компонента. Из-за синхронности кода в return уже будет элемент */
255
-
256
- if (isPortal && !portalElem.current && typeof window !== 'undefined') {
257
- portalElem.current = document.createElement('div');
258
- document.body.appendChild(portalElem.current);
259
- }
260
-
261
- if (isPortal && portalElem.current) {
262
- return portalElem.current ? ReactDOM.createPortal(template, portalElem.current) : null;
263
- }
264
-
265
- return template;
266
241
  };
267
242
 
268
243
  Tooltip.propTypes = {
@@ -293,7 +268,6 @@ Tooltip.propTypes = {
293
268
  current: PropTypes.elementType
294
269
  }), PropTypes.any])]),
295
270
  isOpened: PropTypes.bool,
296
- isPortal: PropTypes.bool,
297
271
  className: PropTypes.string,
298
272
  classes: PropTypes.shape({
299
273
  root: PropTypes.string,
@@ -3,6 +3,7 @@ export { default as Banner } from './components/Banner/Banner';
3
3
  export { default as BannerDot } from './components/Banner/BannerDot';
4
4
  export { default as Button } from './components/Button/Button';
5
5
  export { default as Calendar } from './components/Calendar/Calendar';
6
+ export { default as Caption } from './components/Caption/Caption';
6
7
  export { default as Carousel } from './components/Carousel/Carousel';
7
8
  export { default as Checkbox } from './components/Checkbox/Checkbox';
8
9
  export { default as checkBreakpointsPropTypes } from './components/Carousel/checkBreakpointsPropTypes';
package/dist/es/index.js CHANGED
@@ -3,6 +3,7 @@ export { default as Banner } from "./components/Banner/Banner";
3
3
  export { default as BannerDot } from "./components/Banner/BannerDot";
4
4
  export { default as Button } from "./components/Button/Button";
5
5
  export { default as Calendar } from "./components/Calendar/Calendar";
6
+ export { default as Caption } from "./components/Caption/Caption";
6
7
  export { default as Carousel } from "./components/Carousel/Carousel";
7
8
  export { default as Checkbox } from "./components/Checkbox/Checkbox";
8
9
  export { default as checkBreakpointsPropTypes } from "./components/Carousel/checkBreakpointsPropTypes";
@@ -2,6 +2,8 @@
2
2
  margin: 0 -80px;
3
3
  padding: 56px 80px 40px;
4
4
  background-color: var(--spbSky0);
5
+ -webkit-transition: background-color 0.3s;
6
+ transition: background-color 0.3s;
5
7
  }
6
8
  @media screen and (max-width: 1120px) {
7
9
  .colors__inner {
@@ -90,6 +92,8 @@
90
92
  font-size: 12px;
91
93
  line-height: 18px;
92
94
  text-align: center;
95
+ -webkit-transition: color 0.3s;
96
+ transition: color 0.3s;
93
97
  }
94
98
  @media screen and (max-width: 1023px) {
95
99
  .colors__description {
@@ -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;
@@ -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;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ require("core-js/modules/es.object.values");
11
+
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
14
+ var React = _interopRequireWildcard(require("react"));
15
+
16
+ var _uiHelpers = require("@megafon/ui-helpers");
17
+
18
+ var PropTypes = _interopRequireWildcard(require("prop-types"));
19
+
20
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
21
+
22
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
+
26
+ var COLORS = {
27
+ INHERIT: 'inherit',
28
+ DEFAULT: 'default',
29
+ GRAY: 'gray',
30
+ WHITE: 'white',
31
+ GREEN: 'green',
32
+ PURPLE: 'purple'
33
+ };
34
+ var cn = (0, _uiHelpers.cnCreate)('mfui-caption');
35
+
36
+ var Caption = function Caption(_ref) {
37
+ var align = _ref.align,
38
+ _ref$color = _ref.color,
39
+ color = _ref$color === void 0 ? 'default' : _ref$color,
40
+ _ref$space = _ref.space,
41
+ space = _ref$space === void 0 ? 'wide' : _ref$space,
42
+ _ref$variant = _ref.variant,
43
+ variant = _ref$variant === void 0 ? 'normal' : _ref$variant,
44
+ className = _ref.className,
45
+ _ref$hasMargin = _ref.hasMargin,
46
+ hasMargin = _ref$hasMargin === void 0 ? true : _ref$hasMargin,
47
+ dataAttrs = _ref.dataAttrs,
48
+ children = _ref.children;
49
+ return /*#__PURE__*/React.createElement("p", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
50
+ className: cn({
51
+ align: align,
52
+ color: color,
53
+ space: space,
54
+ variant: variant,
55
+ 'has-margin': hasMargin
56
+ }, className)
57
+ }), children);
58
+ };
59
+
60
+ Caption.propTypes = {
61
+ dataAttrs: PropTypes.shape({
62
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
63
+ }),
64
+ align: PropTypes.oneOf(['left', 'center', 'right']),
65
+ space: PropTypes.oneOf(['wide', 'tight']),
66
+ variant: PropTypes.oneOf(['normal', 'medium']),
67
+ hasMargin: PropTypes.bool,
68
+ color: PropTypes.oneOf(Object.values(COLORS))
69
+ };
70
+ var _default = Caption;
71
+ exports["default"] = _default;
@@ -27,30 +27,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
27
27
 
28
28
  var greenHorizontalImg = function greenHorizontalImg(props) {
29
29
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
30
- viewBox: "0 0 623 112",
31
- fill: "none"
32
- }, props), /*#__PURE__*/React.createElement("path", {
33
- d: "M608.292 31.117V51.95h-27.978V31.117h-13.769v55.067h13.769V63.951h27.978v22.233h13.842V31.117h-13.842z",
34
- fill: "#00B956"
35
- }), /*#__PURE__*/React.createElement("path", {
36
- fillRule: "evenodd",
37
- clipRule: "evenodd",
38
- d: "M367.31 29.865c4.417 0 9.056 2.43 11.338 7.436l22.53 48.883h-14.652l-4.933-11.632h-28.567l-4.933 11.632h-14.652l22.53-48.883c2.282-5.007 6.921-7.436 11.339-7.436zm-1.105 13.693l-8.467 19.951h19.143l-8.467-19.95c-.221-.663-.736-.81-1.104-.81-.369 0-.81.22-1.105.81z",
39
- fill: "#00B956"
40
- }), /*#__PURE__*/React.createElement("path", {
41
- d: "M214.533 21.178c-6.48 0-10.603 3.46-13.622 10.38l-17.965 41.374-17.965-41.374c-3.018-6.92-7.142-10.38-13.621-10.38-6.037 0-12.296 4.343-12.296 13.693v51.313h13.769v-49.84l18.112 41.08c2.43 5.742 6.332 9.349 12.001 9.349 5.67 0 9.572-3.607 12.002-9.35l18.112-41.08v49.841h13.768v-51.24c0-9.423-6.258-13.766-12.295-13.766zm36.445 53.227a1.163 1.163 0 01-1.178-1.178v-9.644h34.384V52.319H249.8v-8.393c0-.662.515-1.178 1.178-1.178h34.016V31.117h-40.79c-4.785 0-8.172 3.975-8.172 8.171v38.577c0 4.196 3.46 8.172 8.172 8.172h40.79V74.405h-34.016zm57.429 11.779V44c0-.663.516-1.178 1.179-1.178h34.015V31.19h-40.789c-4.786 0-8.173 3.976-8.173 8.172v46.822h13.768z",
42
- fill: "#00B956"
43
- }), /*#__PURE__*/React.createElement("path", {
44
- fillRule: "evenodd",
45
- clipRule: "evenodd",
46
- d: "M528.259 30.307c20.837 0 29.157 8.981 29.157 28.27 0 18.994-8.468 28.122-29.304 28.122h-4.565c-20.837 0-29.304-9.128-29.304-28.122 0-19.289 8.246-28.27 29.157-28.27h4.859zm-4.638 44.981h4.417c11.412 0 15.977-5.153 15.977-16.711v-.074c0-11.19-4.27-16.712-15.977-16.712h-4.417c-12.075 0-15.978 5.522-15.978 16.712v.074c0 11.558 4.492 16.711 15.978 16.711zm-95.127-52.785h27.316c20.321 0 28.493 10.307 28.567 28.27 0 2.797-.221 5.374-.589 7.804-2.135 12.736-9.645 20.54-28.715 20.54h-5.963v7.067h-13.769v-7.067h-6.037c-19.07 0-26.58-7.804-28.715-20.54-.442-2.43-.589-5.006-.589-7.804 0-17.963 8.099-28.27 28.494-28.27zm6.774 44.982h-6.332c-9.351 0-12.664-3.46-14.726-8.908-.81-2.135-.81-4.786-.81-7.804 0-11.706 5.449-16.712 13.4-16.712h8.468v33.424zm34.825-8.908c-2.061 5.448-5.448 8.908-14.725 8.908h-6.332V34.06h8.467c7.952 0 13.4 4.933 13.4 16.712 0 3.018 0 5.669-.81 7.804zM62.86 58.135V1.227c27.242 3.313 48.373 26.577 48.447 54.7 0 30.478-24.74 55.214-55.22 55.214a58.32 58.32 0 01-5.081-.221V63.215a.58.58 0 01.589-.59h6.774c2.43 0 4.49-1.987 4.49-4.49zM61.682 86.11a6.913 6.913 0 01-6.921-6.92 6.913 6.913 0 016.92-6.92 6.913 6.913 0 016.922 6.92 6.913 6.913 0 01-6.921 6.92zm9.277-6.92a6.913 6.913 0 006.92 6.92 6.913 6.913 0 006.922-6.92 6.913 6.913 0 00-6.921-6.92 6.913 6.913 0 00-6.921 6.92zm16.198 0a6.913 6.913 0 006.92 6.92A6.913 6.913 0 00101 79.19a6.913 6.913 0 00-6.921-6.92 6.913 6.913 0 00-6.921 6.92z",
30
+ viewBox: "0 0 304 55"
31
+ }, props), /*#__PURE__*/React.createElement("g", {
47
32
  fill: "#00B956"
33
+ }, /*#__PURE__*/React.createElement("path", {
34
+ d: "M30.3.7v27.8c0 1.3-1 2.2-2.2 2.2h-3.3c-.2 0-.3.2-.3.3v23.3c.8 0 1.6.2 2.5.2 14.9 0 27-12.1 27-27C54 13.8 43.7 2.3 30.3.7zm-.6 41.6c-1.9 0-3.3-1.6-3.3-3.3 0-1.9 1.6-3.3 3.3-3.3 1.9 0 3.3 1.6 3.3 3.3.2 1.8-1.4 3.3-3.3 3.3zm7.9 0c-1.9 0-3.3-1.6-3.3-3.3 0-1.9 1.6-3.3 3.3-3.3 1.9 0 3.3 1.6 3.3 3.3s-1.3 3.3-3.3 3.3zm8 0c-1.9 0-3.3-1.6-3.3-3.3 0-1.9 1.6-3.3 3.3-3.3 1.9 0 3.3 1.6 3.3 3.3s-1.4 3.3-3.3 3.3z"
48
35
  }), /*#__PURE__*/React.createElement("path", {
49
- fillRule: "evenodd",
50
- clipRule: "evenodd",
51
- d: "M.792 56C.792 25.521 25.531.785 56.012.785h.148v54.626a.58.58 0 01-.59.589h-6.92c-2.356.074-4.27 2.061-4.344 4.417v49.546C19.42 104.589.792 82.503.792 56zm37.697-16.638a6.913 6.913 0 006.921 6.92 6.913 6.913 0 006.921-6.92 6.913 6.913 0 00-6.92-6.92 6.913 6.913 0 00-6.922 6.92z",
52
- fill: "#00B956"
53
- }));
36
+ d: "M27 .6C12.1.6 0 12.7 0 27.6c0 13.1 9.1 23.8 21.3 26.3V29.6c0-1.1 1-2 2-2.2h3.3c.2 0 .3-.2.3-.3L27 .6zm-5.2 22.2c-1.9 0-3.3-1.6-3.3-3.3 0-1.9 1.6-3.3 3.3-3.3 1.9 0 3.3 1.6 3.3 3.3s-1.5 3.3-3.3 3.3zm275.5-7.5v10.2h-13.6V15.3h-6.9v27h6.9V31.4h13.6v10.9h6.7v-27zm-112.4 3.1c-1.1-2.4-3.3-3.7-5.5-3.7s-4.5 1.3-5.5 3.7l-10.9 24h7.2l2.4-5.7h14l2.4 5.7h7.2l-11.3-24zm-10.4 12.9l4.1-9.9c.2-.3.3-.3.5-.3s.5 0 .5.3l4.1 9.9h-9.2zm-70-20.8c-3.2 0-5.2 1.7-6.7 5.1l-8.7 20.3-8.8-20.4c-1.4-3.3-3.5-5.1-6.7-5.1-3 0-6 2-6 6.7v25.1h6.7V18l8.9 20.1c1.1 2.9 3.2 4.6 5.9 4.6 2.9 0 4.8-1.7 5.9-4.6l8.9-20.1v24.5h6.7V17.4c-.1-4.7-3.1-6.9-6.1-6.9zm17.9 26.1c-.3 0-.7-.3-.7-.7v-4.8h16.8v-5.5h-16.8v-4.1c0-.3.3-.7.7-.7h16.7v-5.7h-20c-2.4 0-4 1.9-4 4V38c0 2 1.7 4 4 4h20v-5.7h-16.7v.3zm28 5.7V21.7c0-.3.3-.7.7-.7h16.7v-5.7h-20c-2.4 0-4 1.9-4 4v22.9l6.6.1zm122-13.4c0-9.4-4.1-13.8-14.3-13.8h-2.4c-10.2 0-14.3 4.5-14.3 13.8 0 9.2 4.1 13.8 14.3 13.8h2.2c10.4-.2 14.5-4.6 14.5-13.8zM257.9 37h-2.2c-5.5 0-7.8-2.5-7.8-8.1 0-5.4 1.9-8.1 7.8-8.1h2.2c5.7 0 7.8 2.7 7.8 8.1 0 5.5-2.1 8.1-7.8 8.1zm-35.2-25.9h-13.4c-10 0-14 5.1-14 13.8 0 1.4.2 2.7.3 3.8 1.1 6.2 4.8 10 14.1 10h3v3.5h6.7v-3.5h2.9c9.4 0 13.1-3.8 14.1-10 .2-1.1.3-2.4.3-3.8-.1-8.7-4.2-13.8-14-13.8zm-10.2 22h-3c-4.6 0-6.2-1.7-7.2-4.5-.3-1-.3-2.4-.3-3.8 0-5.7 2.7-8.1 6.5-8.1h4.1v16.4h-.1zm17.2-4.2c-1 2.7-2.7 4.5-7.2 4.5h-3V16.9h4.1c3.8 0 6.5 2.4 6.5 8.1-.1 1.5-.1 2.7-.4 3.9z"
37
+ })));
54
38
  };
55
39
 
56
40
  var greenVerticalImg = function greenVerticalImg(props) {