@megafon/ui-core 3.0.2 → 3.3.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 (78) hide show
  1. package/CHANGELOG.md +57 -1
  2. package/dist/es/components/Accordion/Accordion.css +1 -0
  3. package/dist/es/components/Badges/components/PriceBadge/PriceBadge.css +70 -0
  4. package/dist/es/components/Badges/components/PriceBadge/PriceBadge.d.ts +33 -0
  5. package/dist/es/components/Badges/components/PriceBadge/PriceBadge.js +113 -0
  6. package/dist/es/components/Badges/components/PromoBadge/PromoBadge.css +32 -0
  7. package/dist/es/components/Badges/components/PromoBadge/PromoBadge.d.ts +22 -0
  8. package/dist/es/components/Badges/components/PromoBadge/PromoBadge.js +38 -0
  9. package/dist/es/components/Banner/Banner.css +16 -0
  10. package/dist/es/components/Banner/Banner.js +10 -3
  11. package/dist/es/components/Button/Button.css +8 -8
  12. package/dist/es/components/Calendar/Calendar.d.ts +8 -0
  13. package/dist/es/components/Calendar/Calendar.js +20 -4
  14. package/dist/es/components/Calendar/components/Day/Day.d.ts +3 -0
  15. package/dist/es/components/Calendar/components/Day/Day.js +9 -5
  16. package/dist/es/components/Calendar/components/Month/Month.d.ts +5 -0
  17. package/dist/es/components/Calendar/components/Month/Month.js +14 -8
  18. package/dist/es/components/Carousel/Carousel.js +31 -6
  19. package/dist/es/components/Checkbox/Checkbox.css +3 -0
  20. package/dist/es/components/Collapse/Collapse.js +55 -28
  21. package/dist/es/components/ContentArea/ContentArea.css +32 -22
  22. package/dist/es/components/ContentArea/ContentArea.d.ts +3 -2
  23. package/dist/es/components/ContentArea/ContentArea.js +11 -11
  24. package/dist/es/components/Counter/Counter.d.ts +7 -0
  25. package/dist/es/components/Counter/Counter.js +15 -8
  26. package/dist/es/components/Logo/Logo.js +8 -10
  27. package/dist/es/components/NavArrow/NavArrow.d.ts +3 -0
  28. package/dist/es/components/NavArrow/NavArrow.js +8 -4
  29. package/dist/es/components/Paragraph/Paragraph.js +1 -1
  30. package/dist/es/components/Search/Search.d.ts +7 -0
  31. package/dist/es/components/Search/Search.js +16 -9
  32. package/dist/es/components/Switcher/Switcher.d.ts +4 -0
  33. package/dist/es/components/Switcher/Switcher.js +22 -10
  34. package/dist/es/components/Tabs/Tabs.css +1 -1
  35. package/dist/es/components/TextLink/TextLink.js +6 -8
  36. package/dist/es/components/Tile/Tile.d.ts +2 -0
  37. package/dist/es/components/Tile/Tile.js +7 -3
  38. package/dist/es/index.d.ts +2 -0
  39. package/dist/es/index.js +2 -0
  40. package/dist/lib/components/Accordion/Accordion.css +1 -0
  41. package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.css +70 -0
  42. package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.d.ts +33 -0
  43. package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.js +134 -0
  44. package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.css +32 -0
  45. package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.d.ts +22 -0
  46. package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.js +59 -0
  47. package/dist/lib/components/Banner/Banner.css +16 -0
  48. package/dist/lib/components/Banner/Banner.js +10 -3
  49. package/dist/lib/components/Button/Button.css +8 -8
  50. package/dist/lib/components/Calendar/Calendar.d.ts +8 -0
  51. package/dist/lib/components/Calendar/Calendar.js +19 -3
  52. package/dist/lib/components/Calendar/components/Day/Day.d.ts +3 -0
  53. package/dist/lib/components/Calendar/components/Day/Day.js +8 -4
  54. package/dist/lib/components/Calendar/components/Month/Month.d.ts +5 -0
  55. package/dist/lib/components/Calendar/components/Month/Month.js +13 -7
  56. package/dist/lib/components/Carousel/Carousel.js +31 -6
  57. package/dist/lib/components/Checkbox/Checkbox.css +3 -0
  58. package/dist/lib/components/Collapse/Collapse.js +54 -30
  59. package/dist/lib/components/ContentArea/ContentArea.css +32 -22
  60. package/dist/lib/components/ContentArea/ContentArea.d.ts +3 -2
  61. package/dist/lib/components/ContentArea/ContentArea.js +11 -11
  62. package/dist/lib/components/Counter/Counter.d.ts +7 -0
  63. package/dist/lib/components/Counter/Counter.js +14 -7
  64. package/dist/lib/components/Logo/Logo.js +8 -10
  65. package/dist/lib/components/NavArrow/NavArrow.d.ts +3 -0
  66. package/dist/lib/components/NavArrow/NavArrow.js +7 -3
  67. package/dist/lib/components/Paragraph/Paragraph.js +1 -1
  68. package/dist/lib/components/Search/Search.d.ts +7 -0
  69. package/dist/lib/components/Search/Search.js +15 -8
  70. package/dist/lib/components/Switcher/Switcher.d.ts +4 -0
  71. package/dist/lib/components/Switcher/Switcher.js +25 -9
  72. package/dist/lib/components/Tabs/Tabs.css +1 -1
  73. package/dist/lib/components/TextLink/TextLink.js +6 -8
  74. package/dist/lib/components/Tile/Tile.d.ts +2 -0
  75. package/dist/lib/components/Tile/Tile.js +7 -3
  76. package/dist/lib/index.d.ts +2 -0
  77. package/dist/lib/index.js +16 -0
  78. package/package.json +4 -4
@@ -1,6 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import './Counter.less';
3
3
  export interface ICounterProps {
4
+ /** Дополнительные data атрибуты к внутренним элементам */
5
+ dataAttrs?: {
6
+ root?: Record<string, string>;
7
+ minus?: Record<string, string>;
8
+ plus?: Record<string, string>;
9
+ input?: Record<string, string>;
10
+ };
4
11
  /** Переводит компонент в контролируемое состояние */
5
12
  isControlled?: boolean;
6
13
  /** Внешнее значение для контролируемого компонента */
@@ -44,7 +44,8 @@ var IconPlus = function IconPlus(props) {
44
44
  var cn = (0, _uiHelpers.cnCreate)('mfui-counter');
45
45
 
46
46
  var Counter = function Counter(_ref) {
47
- var _ref$isControlled = _ref.isControlled,
47
+ var dataAttrs = _ref.dataAttrs,
48
+ _ref$isControlled = _ref.isControlled,
48
49
  isControlled = _ref$isControlled === void 0 ? false : _ref$isControlled,
49
50
  _ref$value = _ref.value,
50
51
  value = _ref$value === void 0 ? 0 : _ref$value,
@@ -115,40 +116,46 @@ var Counter = function Counter(_ref) {
115
116
  handleValueChange(max);
116
117
  }
117
118
  }, [handleValueChange, min, max]);
118
- return /*#__PURE__*/React.createElement("div", {
119
+ return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
119
120
  className: cn({
120
121
  disabled: disabled
121
122
  }, [className, classes.root])
122
- }, /*#__PURE__*/React.createElement("button", {
123
+ }), /*#__PURE__*/React.createElement("button", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.minus), {
123
124
  className: cn('btn', {
124
125
  left: true
125
126
  }, classes.buttonMinus),
126
127
  type: "button",
127
128
  disabled: disabled || (isControlled ? value : counter) <= min,
128
129
  onClick: handleMinusClick
129
- }, /*#__PURE__*/React.createElement(IconMinus, {
130
+ }), /*#__PURE__*/React.createElement(IconMinus, {
130
131
  className: cn('icon')
131
132
  })), /*#__PURE__*/React.createElement("div", {
132
133
  className: cn('input-box')
133
- }, /*#__PURE__*/React.createElement("input", {
134
+ }, /*#__PURE__*/React.createElement("input", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.input), {
134
135
  className: cn('input', classes.input),
135
136
  value: isControlled ? value : counter,
136
137
  onChange: handleInputChange,
137
138
  onBlur: handleInputBlur,
138
139
  disabled: disabled
139
- })), /*#__PURE__*/React.createElement("button", {
140
+ }))), /*#__PURE__*/React.createElement("button", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.plus), {
140
141
  className: cn('btn', {
141
142
  right: true
142
143
  }, classes.buttonPlus),
143
144
  type: "button",
144
145
  disabled: disabled || counter >= max || value >= max,
145
146
  onClick: handlePlusClick
146
- }, /*#__PURE__*/React.createElement(IconPlus, {
147
+ }), /*#__PURE__*/React.createElement(IconPlus, {
147
148
  className: cn('icon')
148
149
  })));
149
150
  };
150
151
 
151
152
  Counter.propTypes = {
153
+ dataAttrs: PropTypes.shape({
154
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
155
+ minus: PropTypes.objectOf(PropTypes.string.isRequired),
156
+ plus: PropTypes.objectOf(PropTypes.string.isRequired),
157
+ input: PropTypes.objectOf(PropTypes.string.isRequired)
158
+ }),
152
159
  isControlled: PropTypes.bool,
153
160
  value: PropTypes.number,
154
161
  initialValue: PropTypes.number,
@@ -56,10 +56,14 @@ var cn = (0, _uiHelpers.cnCreate)('mfui-logo');
56
56
 
57
57
  var Logo = function Logo(_ref) {
58
58
  var className = _ref.className,
59
- color = _ref.color,
60
- view = _ref.view,
61
- target = _ref.target,
62
- href = _ref.href;
59
+ _ref$color = _ref.color,
60
+ color = _ref$color === void 0 ? 'green' : _ref$color,
61
+ _ref$view = _ref.view,
62
+ view = _ref$view === void 0 ? 'horizontal' : _ref$view,
63
+ _ref$target = _ref.target,
64
+ target = _ref$target === void 0 ? '_blank' : _ref$target,
65
+ _ref$href = _ref.href,
66
+ href = _ref$href === void 0 ? '/' : _ref$href;
63
67
  var images = {
64
68
  'green-horizontal': greenHorizontalImg,
65
69
  'green-vertical': greenVerticalImg
@@ -85,11 +89,5 @@ Logo.propTypes = {
85
89
  href: PropTypes.string,
86
90
  className: PropTypes.string
87
91
  };
88
- Logo.defaultProps = {
89
- color: 'green',
90
- view: 'horizontal',
91
- target: '_blank',
92
- href: '/'
93
- };
94
92
  var _default = Logo;
95
93
  exports["default"] = _default;
@@ -11,6 +11,9 @@ export declare const View: {
11
11
  declare type ThemeType = typeof Theme[keyof typeof Theme];
12
12
  declare type ViewType = typeof View[keyof typeof View];
13
13
  export interface INavArrowProps {
14
+ dataAttrs?: {
15
+ root?: Record<string, string>;
16
+ };
14
17
  className?: string;
15
18
  theme?: ThemeType;
16
19
  view?: ViewType;
@@ -52,7 +52,8 @@ exports.View = View;
52
52
  var cn = (0, _uiHelpers.cnCreate)('mfui-nav-arrow');
53
53
 
54
54
  var NavArrow = function NavArrow(_ref) {
55
- var className = _ref.className,
55
+ var dataAttrs = _ref.dataAttrs,
56
+ className = _ref.className,
56
57
  _ref$view = _ref.view,
57
58
  view = _ref$view === void 0 ? View.PREV : _ref$view,
58
59
  _ref$theme = _ref.theme,
@@ -73,17 +74,20 @@ var NavArrow = function NavArrow(_ref) {
73
74
  });
74
75
  }
75
76
  }, [view]);
76
- return /*#__PURE__*/React.createElement("button", {
77
+ return /*#__PURE__*/React.createElement("button", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
77
78
  type: "button",
78
79
  className: cn({
79
80
  theme: theme
80
81
  }, className),
81
82
  onClick: onClick,
82
83
  disabled: disabled
83
- }, renderIcon());
84
+ }), renderIcon());
84
85
  };
85
86
 
86
87
  NavArrow.propTypes = {
88
+ dataAttrs: PropTypes.shape({
89
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
90
+ }),
87
91
  className: PropTypes.string,
88
92
  theme: PropTypes.oneOf(Object.values(Theme)),
89
93
  view: PropTypes.oneOf(Object.values(View)),
@@ -37,7 +37,7 @@ var Paragraph = function Paragraph(_ref) {
37
37
  size = _ref$size === void 0 ? 'regular' : _ref$size,
38
38
  align = _ref.align,
39
39
  _ref$color = _ref.color,
40
- color = _ref$color === void 0 ? COLORS.DEFAULT : _ref$color,
40
+ color = _ref$color === void 0 ? 'default' : _ref$color,
41
41
  className = _ref.className,
42
42
  _ref$hasMargin = _ref.hasMargin,
43
43
  hasMargin = _ref$hasMargin === void 0 ? true : _ref$hasMargin,
@@ -13,6 +13,13 @@ export declare type SearchItem = {
13
13
  searchView?: ElementOrString;
14
14
  };
15
15
  export interface ISearchProps {
16
+ /** Дополнительные data атрибуты к внутренним элементам */
17
+ dataAttrs?: {
18
+ root?: Record<string, string>;
19
+ searchField?: Record<string, string>;
20
+ submit?: Record<string, string>;
21
+ item?: Record<string, string>;
22
+ };
16
23
  /** Значение */
17
24
  value?: string;
18
25
  /** Заголовок поля */
@@ -55,7 +55,8 @@ exports.Verification = Verification;
55
55
  var cn = (0, _uiHelpers.cnCreate)('mfui-search');
56
56
 
57
57
  var Search = function Search(_ref) {
58
- var _ref$value = _ref.value,
58
+ var dataAttrs = _ref.dataAttrs,
59
+ _ref$value = _ref.value,
59
60
  value = _ref$value === void 0 ? '' : _ref$value,
60
61
  label = _ref.label,
61
62
  placeholder = _ref.placeholder,
@@ -199,18 +200,18 @@ var Search = function Search(_ref) {
199
200
  }));
200
201
  };
201
202
 
202
- return /*#__PURE__*/_react["default"].createElement("div", {
203
+ return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
203
204
  className: cn({
204
205
  open: isFocused,
205
206
  disabled: disabled
206
207
  }, [className])
207
- }, label && /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], null, label, required && /*#__PURE__*/_react["default"].createElement("span", {
208
+ }), label && /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], null, label, required && /*#__PURE__*/_react["default"].createElement("span", {
208
209
  className: cn('require-mark')
209
210
  }, "*")), /*#__PURE__*/_react["default"].createElement("div", {
210
211
  className: cn('control', {
211
212
  error: verification === Verification.ERROR
212
213
  }, [classes === null || classes === void 0 ? void 0 : classes.control])
213
- }, /*#__PURE__*/_react["default"].createElement("input", {
214
+ }, /*#__PURE__*/_react["default"].createElement("input", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.searchField), {
214
215
  className: cn('search-field'),
215
216
  placeholder: placeholder,
216
217
  value: searchQuery,
@@ -222,10 +223,10 @@ var Search = function Search(_ref) {
222
223
  disabled: disabled,
223
224
  type: "text",
224
225
  autoComplete: "off"
225
- }), !hideIcon && /*#__PURE__*/_react["default"].createElement("div", {
226
+ })), !hideIcon && /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.submit), {
226
227
  className: cn('icon-box'),
227
228
  onClick: handleSearchSubmit
228
- }, /*#__PURE__*/_react["default"].createElement(SearchIcon, {
229
+ }), /*#__PURE__*/_react["default"].createElement(SearchIcon, {
229
230
  className: cn('icon', [classes === null || classes === void 0 ? void 0 : classes.icon])
230
231
  })), !!items.length && /*#__PURE__*/_react["default"].createElement("div", {
231
232
  className: cn('list')
@@ -234,14 +235,14 @@ var Search = function Search(_ref) {
234
235
  }, items.map(function (_ref2, i) {
235
236
  var itemValue = _ref2.value,
236
237
  searchView = _ref2.searchView;
237
- return /*#__PURE__*/_react["default"].createElement("div", {
238
+ return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
238
239
  className: cn('list-item', {
239
240
  active: activeIndex === i
240
241
  }),
241
242
  onMouseDown: handleSelectSubmit(i),
242
243
  onMouseEnter: handleHoverItem(i),
243
244
  key: i
244
- }, /*#__PURE__*/_react["default"].createElement("div", {
245
+ }), /*#__PURE__*/_react["default"].createElement("div", {
245
246
  className: cn('item-title', [classes === null || classes === void 0 ? void 0 : classes.listItemTitle])
246
247
  }, searchView || highlightString(itemValue)));
247
248
  })))), noticeText && /*#__PURE__*/_react["default"].createElement("div", {
@@ -253,6 +254,12 @@ var Search = function Search(_ref) {
253
254
  };
254
255
 
255
256
  Search.propTypes = {
257
+ dataAttrs: PropTypes.shape({
258
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
259
+ searchField: PropTypes.objectOf(PropTypes.string.isRequired),
260
+ submit: PropTypes.objectOf(PropTypes.string.isRequired),
261
+ item: PropTypes.objectOf(PropTypes.string.isRequired)
262
+ }),
256
263
  value: PropTypes.string,
257
264
  label: PropTypes.string,
258
265
  placeholder: PropTypes.string,
@@ -1,6 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import './Switcher.less';
3
3
  export interface ISwitcherProps {
4
+ /** Дополнительные data атрибуты к внутренним элементам */
5
+ dataAttrs?: {
6
+ root?: Record<string, string>;
7
+ };
4
8
  /** Дополнительный класс корневого элемента */
5
9
  className?: string;
6
10
  /** Управление состоянием вкл/выкл компонента */
@@ -7,23 +7,30 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports["default"] = void 0;
9
9
 
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
10
12
  var React = _interopRequireWildcard(require("react"));
11
13
 
12
14
  var _uiHelpers = require("@megafon/ui-helpers");
13
15
 
16
+ var PropTypes = _interopRequireWildcard(require("prop-types"));
17
+
14
18
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
15
19
 
16
20
  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; }
17
21
 
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
+
18
24
  var cn = (0, _uiHelpers.cnCreate)('mfui-switcher');
19
25
 
20
- var Switcher = function Switcher(props) {
21
- var className = props.className,
22
- _props$checked = props.checked,
23
- checked = _props$checked === void 0 ? false : _props$checked,
24
- _props$disabled = props.disabled,
25
- disabled = _props$disabled === void 0 ? false : _props$disabled,
26
- onChange = props.onChange;
26
+ var Switcher = function Switcher(_ref) {
27
+ var dataAttrs = _ref.dataAttrs,
28
+ className = _ref.className,
29
+ _ref$checked = _ref.checked,
30
+ checked = _ref$checked === void 0 ? false : _ref$checked,
31
+ _ref$disabled = _ref.disabled,
32
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
33
+ onChange = _ref.onChange;
27
34
  var isTouch = (0, _uiHelpers.detectTouch)();
28
35
 
29
36
  var handleChange = function handleChange(e) {
@@ -34,17 +41,26 @@ var Switcher = function Switcher(props) {
34
41
  onChange === null || onChange === void 0 ? void 0 : onChange(e);
35
42
  };
36
43
 
37
- return /*#__PURE__*/React.createElement("div", {
44
+ return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
38
45
  className: cn({
39
46
  checked: checked,
40
47
  disabled: disabled,
41
48
  'no-touch': !isTouch
42
49
  }, className),
43
50
  onClick: handleChange
44
- }, /*#__PURE__*/React.createElement("div", {
51
+ }), /*#__PURE__*/React.createElement("div", {
45
52
  className: cn('pointer')
46
53
  }));
47
54
  };
48
55
 
56
+ Switcher.propTypes = {
57
+ dataAttrs: PropTypes.shape({
58
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
59
+ }),
60
+ className: PropTypes.string,
61
+ checked: PropTypes.bool,
62
+ disabled: PropTypes.bool,
63
+ onChange: PropTypes.func
64
+ };
49
65
  var _default = Switcher;
50
66
  exports["default"] = _default;
@@ -121,7 +121,7 @@
121
121
  width: 16px;
122
122
  height: 16px;
123
123
  border-radius: 50%;
124
- background-color: var(--content);
124
+ background-color: var(--stcBlack);
125
125
  -webkit-transform: translateY(-50%);
126
126
  transform: translateY(-50%);
127
127
  cursor: pointer;
@@ -24,9 +24,12 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
24
24
  var cn = (0, _uiHelpers.cnCreate)('mfui-text-link');
25
25
 
26
26
  var TextLink = function TextLink(_ref) {
27
- var underlineVisibility = _ref.underlineVisibility,
28
- underlineStyle = _ref.underlineStyle,
29
- color = _ref.color,
27
+ var _ref$underlineVisibil = _ref.underlineVisibility,
28
+ underlineVisibility = _ref$underlineVisibil === void 0 ? 'hover' : _ref$underlineVisibil,
29
+ _ref$underlineStyle = _ref.underlineStyle,
30
+ underlineStyle = _ref$underlineStyle === void 0 ? 'solid' : _ref$underlineStyle,
31
+ _ref$color = _ref.color,
32
+ color = _ref$color === void 0 ? 'blue' : _ref$color,
30
33
  className = _ref.className,
31
34
  target = _ref.target,
32
35
  href = _ref.href,
@@ -59,10 +62,5 @@ TextLink.propTypes = {
59
62
  }),
60
63
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element), PropTypes.element, PropTypes.string, PropTypes.node])
61
64
  };
62
- TextLink.defaultProps = {
63
- underlineVisibility: 'hover',
64
- underlineStyle: 'solid',
65
- color: 'blue'
66
- };
67
65
  var _default = TextLink;
68
66
  exports["default"] = _default;
@@ -20,6 +20,8 @@ declare type ShadowType = typeof Shadow[keyof typeof Shadow];
20
20
  export interface ITileProps {
21
21
  /** Ссылка */
22
22
  href?: string;
23
+ /** Атрибут для открытия ссылки */
24
+ target?: '_self' | '_blank';
23
25
  /** Тема */
24
26
  theme?: ThemeType;
25
27
  /** Радиус границы */
@@ -49,7 +49,9 @@ var Tile = function Tile(_ref) {
49
49
  _ref$isInteractive = _ref.isInteractive,
50
50
  isInteractive = _ref$isInteractive === void 0 ? false : _ref$isInteractive,
51
51
  onClick = _ref.onClick,
52
- dataAttrs = _ref.dataAttrs;
52
+ dataAttrs = _ref.dataAttrs,
53
+ _ref$target = _ref.target,
54
+ target = _ref$target === void 0 ? '_self' : _ref$target;
53
55
 
54
56
  var handleClick = function handleClick(e) {
55
57
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
@@ -67,7 +69,8 @@ var Tile = function Tile(_ref) {
67
69
  onClick: handleClick
68
70
  }, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), href && /*#__PURE__*/_react["default"].createElement("a", {
69
71
  href: href,
70
- className: cn('link')
72
+ className: cn('link'),
73
+ target: target
71
74
  }, children), !href && children);
72
75
  };
73
76
 
@@ -81,7 +84,8 @@ Tile.propTypes = {
81
84
  onClick: _propTypes["default"].func,
82
85
  dataAttrs: _propTypes["default"].shape({
83
86
  root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
84
- })
87
+ }),
88
+ target: _propTypes["default"].oneOf(['_self', '_blank'])
85
89
  };
86
90
  var _default = Tile;
87
91
  exports["default"] = _default;
@@ -28,6 +28,8 @@ export { default as PaginationButtons } from './components/Pagination/components
28
28
  export { default as PaginationNavigation } from './components/Pagination/components/PaginationNavigation/PaginationNavigation';
29
29
  export { default as Paragraph } from './components/Paragraph/Paragraph';
30
30
  export { default as Preloader } from './components/Preloader/Preloader';
31
+ export { default as PriceBadge } from './components/Badges/components/PriceBadge/PriceBadge';
32
+ export { default as PromoBadge } from './components/Badges/components/PromoBadge/PromoBadge';
31
33
  export { default as RadioButton } from './components/RadioButton/RadioButton';
32
34
  export { default as Search } from './components/Search/Search';
33
35
  export { default as Select } from './components/Select/Select';
package/dist/lib/index.js CHANGED
@@ -183,6 +183,18 @@ Object.defineProperty(exports, "Preloader", {
183
183
  return _Preloader["default"];
184
184
  }
185
185
  });
186
+ Object.defineProperty(exports, "PriceBadge", {
187
+ enumerable: true,
188
+ get: function get() {
189
+ return _PriceBadge["default"];
190
+ }
191
+ });
192
+ Object.defineProperty(exports, "PromoBadge", {
193
+ enumerable: true,
194
+ get: function get() {
195
+ return _PromoBadge["default"];
196
+ }
197
+ });
186
198
  Object.defineProperty(exports, "RadioButton", {
187
199
  enumerable: true,
188
200
  get: function get() {
@@ -316,6 +328,10 @@ var _Paragraph = _interopRequireDefault(require("./components/Paragraph/Paragrap
316
328
 
317
329
  var _Preloader = _interopRequireDefault(require("./components/Preloader/Preloader"));
318
330
 
331
+ var _PriceBadge = _interopRequireDefault(require("./components/Badges/components/PriceBadge/PriceBadge"));
332
+
333
+ var _PromoBadge = _interopRequireDefault(require("./components/Badges/components/PromoBadge/PromoBadge"));
334
+
319
335
  var _RadioButton = _interopRequireDefault(require("./components/RadioButton/RadioButton"));
320
336
 
321
337
  var _Search = _interopRequireDefault(require("./components/Search/Search"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-core",
3
- "version": "3.0.2",
3
+ "version": "3.3.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "styles"
@@ -54,7 +54,7 @@
54
54
  "@babel/preset-env": "^7.8.6",
55
55
  "@babel/preset-react": "^7.8.3",
56
56
  "@babel/preset-typescript": "^7.8.3",
57
- "@megafon/ui-icons": "^1.0.1",
57
+ "@megafon/ui-icons": "^1.1.0",
58
58
  "@svgr/core": "^2.4.1",
59
59
  "@testing-library/react-hooks": "^7.0.1",
60
60
  "@types/enzyme": "^3.10.5",
@@ -86,7 +86,7 @@
86
86
  "dependencies": {
87
87
  "@babel/runtime": "^7.8.4",
88
88
  "@datepicker-react/hooks": "^2.7.0",
89
- "@megafon/ui-helpers": "^2.0.1",
89
+ "@megafon/ui-helpers": "^2.1.0",
90
90
  "@popperjs/core": "^2.5.3",
91
91
  "core-js": "^3.6.4",
92
92
  "date-fns": "^2.16.1",
@@ -97,5 +97,5 @@
97
97
  "react-popper": "^2.2.3",
98
98
  "swiper": "^6.5.6"
99
99
  },
100
- "gitHead": "a2f3604929705854de77505d3684640adf2dd8a5"
100
+ "gitHead": "e1007fdaa6e0dd724388f6c5ebae4448cf2732c8"
101
101
  }