@megafon/ui-shared 4.7.0 → 4.9.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.
- package/CHANGELOG.md +23 -0
- package/dist/es/components/AudioPlayer/AudioPlayer.d.ts +10 -0
- package/dist/es/components/AudioPlayer/AudioPlayer.js +116 -0
- package/dist/es/components/AudioPlayer/AudioProgress.d.ts +14 -0
- package/dist/es/components/AudioPlayer/AudioProgress.js +117 -0
- package/dist/es/components/AudioPlayer/AudioRange.d.ts +14 -0
- package/dist/es/components/AudioPlayer/AudioRange.js +31 -0
- package/dist/es/components/AudioPlayer/AudioVolume.d.ts +7 -0
- package/dist/es/components/AudioPlayer/AudioVolume.js +83 -0
- package/dist/es/components/AudioPlayer/style/AudioPlayer.css +58 -0
- package/dist/es/components/AudioPlayer/style/AudioProgress.css +35 -0
- package/dist/es/components/AudioPlayer/style/AudioRange.css +68 -0
- package/dist/es/components/AudioPlayer/style/AudioVolume.css +34 -0
- package/dist/es/components/AudioPlayer/timerFormatUtil.d.ts +2 -0
- package/dist/es/components/AudioPlayer/timerFormatUtil.js +33 -0
- package/dist/es/components/Instructions/Instructions.js +3 -4
- package/dist/es/components/Steps/Steps.d.ts +2 -0
- package/dist/es/components/Steps/Steps.js +6 -4
- package/dist/es/components/Steps/StepsItem.js +2 -2
- package/dist/es/index.d.ts +5 -0
- package/dist/es/index.js +5 -0
- package/dist/lib/components/AudioPlayer/AudioPlayer.d.ts +10 -0
- package/dist/lib/components/AudioPlayer/AudioPlayer.js +133 -0
- package/dist/lib/components/AudioPlayer/AudioProgress.d.ts +14 -0
- package/dist/lib/components/AudioPlayer/AudioProgress.js +141 -0
- package/dist/lib/components/AudioPlayer/AudioRange.d.ts +14 -0
- package/dist/lib/components/AudioPlayer/AudioRange.js +42 -0
- package/dist/lib/components/AudioPlayer/AudioVolume.d.ts +7 -0
- package/dist/lib/components/AudioPlayer/AudioVolume.js +99 -0
- package/dist/lib/components/AudioPlayer/style/AudioPlayer.css +58 -0
- package/dist/lib/components/AudioPlayer/style/AudioProgress.css +35 -0
- package/dist/lib/components/AudioPlayer/style/AudioRange.css +68 -0
- package/dist/lib/components/AudioPlayer/style/AudioVolume.css +34 -0
- package/dist/lib/components/AudioPlayer/timerFormatUtil.d.ts +2 -0
- package/dist/lib/components/AudioPlayer/timerFormatUtil.js +42 -0
- package/dist/lib/components/Instructions/Instructions.js +2 -4
- package/dist/lib/components/Steps/Steps.d.ts +2 -0
- package/dist/lib/components/Steps/Steps.js +5 -3
- package/dist/lib/components/Steps/StepsItem.js +1 -1
- package/dist/lib/index.d.ts +5 -0
- package/dist/lib/index.js +40 -0
- package/package.json +5 -5
@@ -0,0 +1,35 @@
|
|
1
|
+
h1,
|
2
|
+
h2,
|
3
|
+
h3,
|
4
|
+
h4,
|
5
|
+
h5 {
|
6
|
+
margin: 0;
|
7
|
+
}
|
8
|
+
.mfui-audio-progress {
|
9
|
+
width: 100%;
|
10
|
+
margin-right: 16px;
|
11
|
+
}
|
12
|
+
.mfui-audio-progress__info {
|
13
|
+
display: -webkit-box;
|
14
|
+
display: -ms-flexbox;
|
15
|
+
display: flex;
|
16
|
+
-webkit-box-align: center;
|
17
|
+
-ms-flex-align: center;
|
18
|
+
align-items: center;
|
19
|
+
-webkit-box-pack: justify;
|
20
|
+
-ms-flex-pack: justify;
|
21
|
+
justify-content: space-between;
|
22
|
+
}
|
23
|
+
.mfui-audio-progress__value {
|
24
|
+
color: var(-spbSky3);
|
25
|
+
font-size: 12px;
|
26
|
+
line-height: 18px;
|
27
|
+
}
|
28
|
+
.mfui-audio-progress__range-wrapper {
|
29
|
+
margin-top: -2px;
|
30
|
+
}
|
31
|
+
.mfui-audio-progress__title {
|
32
|
+
color: var(--stcBlack);
|
33
|
+
font-size: 12px;
|
34
|
+
line-height: 18px;
|
35
|
+
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
h1,
|
2
|
+
h2,
|
3
|
+
h3,
|
4
|
+
h4,
|
5
|
+
h5 {
|
6
|
+
margin: 0;
|
7
|
+
}
|
8
|
+
.mfui-audio-range {
|
9
|
+
width: 100%;
|
10
|
+
height: 4px;
|
11
|
+
border-radius: 2px;
|
12
|
+
background: var(--spbSky2);
|
13
|
+
background-image: -webkit-gradient(linear, left top, left bottom, from(#00B956), to(#00B956));
|
14
|
+
background-image: linear-gradient(#00B956, #00B956);
|
15
|
+
background-repeat: no-repeat;
|
16
|
+
cursor: pointer;
|
17
|
+
-webkit-appearance: none;
|
18
|
+
}
|
19
|
+
.mfui-audio-range:focus {
|
20
|
+
outline: none;
|
21
|
+
}
|
22
|
+
.mfui-audio-range::-webkit-slider-thumb {
|
23
|
+
width: 16px;
|
24
|
+
height: 16px;
|
25
|
+
border: none;
|
26
|
+
border-radius: 50%;
|
27
|
+
background: var(--stcWhite);
|
28
|
+
-webkit-box-shadow: 0 2px 9px rgba(0, 0, 0, 0.15);
|
29
|
+
box-shadow: 0 2px 9px rgba(0, 0, 0, 0.15);
|
30
|
+
-webkit-appearance: none;
|
31
|
+
}
|
32
|
+
.mfui-audio-range::-moz-range-thumb {
|
33
|
+
width: 16px;
|
34
|
+
height: 16px;
|
35
|
+
border: none;
|
36
|
+
border-radius: 50%;
|
37
|
+
background: var(--stcWhite);
|
38
|
+
box-shadow: 0 2px 9px rgba(0, 0, 0, 0.15);
|
39
|
+
-webkit-appearance: none;
|
40
|
+
}
|
41
|
+
.mfui-audio-range::-ms-thumb {
|
42
|
+
width: 16px;
|
43
|
+
height: 16px;
|
44
|
+
border: none;
|
45
|
+
border-radius: 50%;
|
46
|
+
background: var(--stcWhite);
|
47
|
+
box-shadow: 0 2px 9px rgba(0, 0, 0, 0.15);
|
48
|
+
-webkit-appearance: none;
|
49
|
+
}
|
50
|
+
.mfui-audio-range::-webkit-slider-runnable-track {
|
51
|
+
border: none;
|
52
|
+
background: transparent;
|
53
|
+
-webkit-box-shadow: none;
|
54
|
+
box-shadow: none;
|
55
|
+
-webkit-appearance: none;
|
56
|
+
}
|
57
|
+
.mfui-audio-range::-moz-range-track {
|
58
|
+
border: none;
|
59
|
+
background: transparent;
|
60
|
+
box-shadow: none;
|
61
|
+
-webkit-appearance: none;
|
62
|
+
}
|
63
|
+
.mfui-audio-range::-ms-track {
|
64
|
+
border: none;
|
65
|
+
background: transparent;
|
66
|
+
box-shadow: none;
|
67
|
+
-webkit-appearance: none;
|
68
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
h1,
|
2
|
+
h2,
|
3
|
+
h3,
|
4
|
+
h4,
|
5
|
+
h5 {
|
6
|
+
margin: 0;
|
7
|
+
}
|
8
|
+
.mfui-audio-volume {
|
9
|
+
width: 24px;
|
10
|
+
}
|
11
|
+
.mfui-audio-volume__tooltip-content {
|
12
|
+
padding: 7px 16px 14px;
|
13
|
+
border-radius: 12px;
|
14
|
+
}
|
15
|
+
.mfui-audio-volume__tooltip-content-shadow {
|
16
|
+
border-radius: 12px;
|
17
|
+
}
|
18
|
+
.mfui-audio-volume__icon {
|
19
|
+
display: none;
|
20
|
+
width: 24px;
|
21
|
+
min-width: 24px;
|
22
|
+
height: 24px;
|
23
|
+
cursor: pointer;
|
24
|
+
fill: var(--brandGreen);
|
25
|
+
}
|
26
|
+
.mfui-audio-volume__icon_visible {
|
27
|
+
display: block;
|
28
|
+
}
|
29
|
+
.mfui-audio-volume__icon:hover {
|
30
|
+
fill: var(--buttonHoverGreen);
|
31
|
+
}
|
32
|
+
.mfui-audio-volume__range {
|
33
|
+
max-width: 128px;
|
34
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports["default"] = void 0;
|
7
|
+
|
8
|
+
require("core-js/modules/es.array.concat");
|
9
|
+
|
10
|
+
require("core-js/modules/es.parse-int");
|
11
|
+
|
12
|
+
var getMinutes = function getMinutes(sec) {
|
13
|
+
var min = parseInt("".concat(sec / 60), 10);
|
14
|
+
|
15
|
+
if (min < 10) {
|
16
|
+
return "0".concat(min);
|
17
|
+
}
|
18
|
+
|
19
|
+
return "".concat(min);
|
20
|
+
};
|
21
|
+
/**
|
22
|
+
* @param {Number} sec
|
23
|
+
* @returns {String}
|
24
|
+
*/
|
25
|
+
|
26
|
+
|
27
|
+
var getSeconds = function getSeconds(sec) {
|
28
|
+
if (sec < 10) {
|
29
|
+
return "0".concat(sec);
|
30
|
+
}
|
31
|
+
|
32
|
+
return "".concat(sec);
|
33
|
+
};
|
34
|
+
|
35
|
+
var timerFormat = function timerFormat(sec) {
|
36
|
+
var min = getMinutes(sec);
|
37
|
+
var seconds = getSeconds(sec % 60);
|
38
|
+
return "".concat(min, ":").concat(seconds);
|
39
|
+
};
|
40
|
+
|
41
|
+
var _default = timerFormat;
|
42
|
+
exports["default"] = _default;
|
@@ -17,8 +17,6 @@ var _uiCore = require("@megafon/ui-core");
|
|
17
17
|
|
18
18
|
var _uiHelpers = require("@megafon/ui-helpers");
|
19
19
|
|
20
|
-
var _htmr = _interopRequireDefault(require("htmr"));
|
21
|
-
|
22
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
23
21
|
|
24
22
|
var _react2 = require("swiper/react");
|
@@ -147,14 +145,14 @@ var Instructions = function Instructions(_ref) {
|
|
147
145
|
resolution: resolution
|
148
146
|
}),
|
149
147
|
as: "h2"
|
150
|
-
}, title);
|
148
|
+
}, (0, _uiHelpers.convert)(title, _uiHelpers.titleConvertConfig));
|
151
149
|
}, [title]);
|
152
150
|
|
153
151
|
var renderText = _react["default"].useCallback(function () {
|
154
152
|
return /*#__PURE__*/_react["default"].createElement(_uiCore.Paragraph, {
|
155
153
|
className: cn('text', [additionalText]),
|
156
154
|
hasMargin: false
|
157
|
-
}, (0,
|
155
|
+
}, (0, _uiHelpers.convert)(text, _uiHelpers.textConvertConfig));
|
158
156
|
}, [text, additionalText]);
|
159
157
|
|
160
158
|
var renderPicture = _react["default"].useCallback(function () {
|
@@ -26,17 +26,18 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
26
26
|
var cn = (0, _uiHelpers.cnCreate)('mfui-steps');
|
27
27
|
|
28
28
|
var Steps = function Steps(_ref) {
|
29
|
-
var
|
29
|
+
var className = _ref.className,
|
30
|
+
title = _ref.title,
|
30
31
|
rootRef = _ref.rootRef,
|
31
32
|
children = _ref.children;
|
32
33
|
return /*#__PURE__*/React.createElement("div", {
|
33
|
-
className: cn(),
|
34
|
+
className: cn([className]),
|
34
35
|
ref: rootRef
|
35
36
|
}, /*#__PURE__*/React.createElement(_uiCore.Header, {
|
36
37
|
as: "h2",
|
37
38
|
align: "center",
|
38
39
|
className: cn('title')
|
39
|
-
}, title), /*#__PURE__*/React.createElement("ul", {
|
40
|
+
}, (0, _uiHelpers.convert)(title, _uiHelpers.titleConvertConfig)), /*#__PURE__*/React.createElement("ul", {
|
40
41
|
className: cn('list')
|
41
42
|
}, React.Children.map(children, function (child) {
|
42
43
|
return /*#__PURE__*/React.createElement("li", {
|
@@ -46,6 +47,7 @@ var Steps = function Steps(_ref) {
|
|
46
47
|
};
|
47
48
|
|
48
49
|
Steps.propTypes = {
|
50
|
+
className: _propTypes["default"].string,
|
49
51
|
rootRef: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
50
52
|
current: _propTypes["default"].elementType
|
51
53
|
}), _propTypes["default"].any])]),
|
@@ -28,7 +28,7 @@ var StepsItem = function StepsItem(_ref) {
|
|
28
28
|
className: cn('text-wrapper')
|
29
29
|
}, /*#__PURE__*/_react["default"].createElement(_uiCore.Paragraph, {
|
30
30
|
hasMargin: false
|
31
|
-
}, text)));
|
31
|
+
}, typeof text === 'string' ? (0, _uiHelpers.convert)(text, _uiHelpers.textConvertConfig) : text)));
|
32
32
|
};
|
33
33
|
|
34
34
|
StepsItem.propTypes = {
|
package/dist/lib/index.d.ts
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
export { default as AccordionBox } from './components/AccordionBox/AccordionBox';
|
2
|
+
export { default as AudioPlayer } from './components/AudioPlayer/AudioPlayer';
|
3
|
+
export { default as AudioProgress } from './components/AudioPlayer/AudioProgress';
|
4
|
+
export { default as AudioRange } from './components/AudioPlayer/AudioRange';
|
5
|
+
export { default as AudioVolume } from './components/AudioPlayer/AudioVolume';
|
2
6
|
export { default as BannerBox } from './components/BannerBox/BannerBox';
|
3
7
|
export { default as BenefitsIcons } from './components/BenefitsIcons/BenefitsIcons';
|
4
8
|
export { default as BenefitsIconsTile } from './components/BenefitsIcons/BenefitsIconsTile';
|
@@ -33,6 +37,7 @@ export { default as TextBox } from './components/TextBox/TextBox';
|
|
33
37
|
export { default as TextBoxPicture } from './components/TextBox/TextBoxPicture';
|
34
38
|
export { default as TextWithIcon } from './components/TextWithIcon/TextWithIcon';
|
35
39
|
export { default as TextWithIconItem } from './components/TextWithIcon/TextWithIconItem';
|
40
|
+
export { default as timerFormatUtil } from './components/AudioPlayer/timerFormatUtil';
|
36
41
|
export { default as TitleDescriptionBox } from './components/TitleDescriptionBox/TitleDescriptionBox';
|
37
42
|
export { default as VideoBanner } from './components/VideoBanner/VideoBanner';
|
38
43
|
export { default as VideoBlock } from './components/VideoBlock/VideoBlock';
|
package/dist/lib/index.js
CHANGED
@@ -9,6 +9,30 @@ Object.defineProperty(exports, "AccordionBox", {
|
|
9
9
|
return _AccordionBox["default"];
|
10
10
|
}
|
11
11
|
});
|
12
|
+
Object.defineProperty(exports, "AudioPlayer", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function get() {
|
15
|
+
return _AudioPlayer["default"];
|
16
|
+
}
|
17
|
+
});
|
18
|
+
Object.defineProperty(exports, "AudioProgress", {
|
19
|
+
enumerable: true,
|
20
|
+
get: function get() {
|
21
|
+
return _AudioProgress["default"];
|
22
|
+
}
|
23
|
+
});
|
24
|
+
Object.defineProperty(exports, "AudioRange", {
|
25
|
+
enumerable: true,
|
26
|
+
get: function get() {
|
27
|
+
return _AudioRange["default"];
|
28
|
+
}
|
29
|
+
});
|
30
|
+
Object.defineProperty(exports, "AudioVolume", {
|
31
|
+
enumerable: true,
|
32
|
+
get: function get() {
|
33
|
+
return _AudioVolume["default"];
|
34
|
+
}
|
35
|
+
});
|
12
36
|
Object.defineProperty(exports, "BannerBox", {
|
13
37
|
enumerable: true,
|
14
38
|
get: function get() {
|
@@ -213,6 +237,12 @@ Object.defineProperty(exports, "TextWithIconItem", {
|
|
213
237
|
return _TextWithIconItem["default"];
|
214
238
|
}
|
215
239
|
});
|
240
|
+
Object.defineProperty(exports, "timerFormatUtil", {
|
241
|
+
enumerable: true,
|
242
|
+
get: function get() {
|
243
|
+
return _timerFormatUtil["default"];
|
244
|
+
}
|
245
|
+
});
|
216
246
|
Object.defineProperty(exports, "TitleDescriptionBox", {
|
217
247
|
enumerable: true,
|
218
248
|
get: function get() {
|
@@ -234,6 +264,14 @@ Object.defineProperty(exports, "VideoBlock", {
|
|
234
264
|
|
235
265
|
var _AccordionBox = _interopRequireDefault(require("./components/AccordionBox/AccordionBox"));
|
236
266
|
|
267
|
+
var _AudioPlayer = _interopRequireDefault(require("./components/AudioPlayer/AudioPlayer"));
|
268
|
+
|
269
|
+
var _AudioProgress = _interopRequireDefault(require("./components/AudioPlayer/AudioProgress"));
|
270
|
+
|
271
|
+
var _AudioRange = _interopRequireDefault(require("./components/AudioPlayer/AudioRange"));
|
272
|
+
|
273
|
+
var _AudioVolume = _interopRequireDefault(require("./components/AudioPlayer/AudioVolume"));
|
274
|
+
|
237
275
|
var _BannerBox = _interopRequireDefault(require("./components/BannerBox/BannerBox"));
|
238
276
|
|
239
277
|
var _BenefitsIcons = _interopRequireDefault(require("./components/BenefitsIcons/BenefitsIcons"));
|
@@ -302,6 +340,8 @@ var _TextWithIcon = _interopRequireDefault(require("./components/TextWithIcon/Te
|
|
302
340
|
|
303
341
|
var _TextWithIconItem = _interopRequireDefault(require("./components/TextWithIcon/TextWithIconItem"));
|
304
342
|
|
343
|
+
var _timerFormatUtil = _interopRequireDefault(require("./components/AudioPlayer/timerFormatUtil"));
|
344
|
+
|
305
345
|
var _TitleDescriptionBox = _interopRequireDefault(require("./components/TitleDescriptionBox/TitleDescriptionBox"));
|
306
346
|
|
307
347
|
var _VideoBanner = _interopRequireDefault(require("./components/VideoBanner/VideoBanner"));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@megafon/ui-shared",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.9.0",
|
4
4
|
"files": [
|
5
5
|
"dist"
|
6
6
|
],
|
@@ -52,7 +52,7 @@
|
|
52
52
|
"@babel/preset-env": "^7.8.6",
|
53
53
|
"@babel/preset-react": "^7.8.3",
|
54
54
|
"@babel/preset-typescript": "^7.8.3",
|
55
|
-
"@megafon/ui-icons": "^2.4.
|
55
|
+
"@megafon/ui-icons": "^2.4.2",
|
56
56
|
"@svgr/core": "^2.4.1",
|
57
57
|
"@testing-library/jest-dom": "5.16.2",
|
58
58
|
"@testing-library/react": "12.1.2",
|
@@ -85,13 +85,13 @@
|
|
85
85
|
},
|
86
86
|
"dependencies": {
|
87
87
|
"@babel/runtime": "^7.8.4",
|
88
|
-
"@megafon/ui-core": "^4.
|
89
|
-
"@megafon/ui-helpers": "^2.
|
88
|
+
"@megafon/ui-core": "^4.11.0",
|
89
|
+
"@megafon/ui-helpers": "^2.4.0",
|
90
90
|
"core-js": "^3.6.4",
|
91
91
|
"htmr": "^0.9.2",
|
92
92
|
"lodash.throttle": "^4.1.1",
|
93
93
|
"prop-types": "^15.7.2",
|
94
94
|
"swiper": "^6.5.6"
|
95
95
|
},
|
96
|
-
"gitHead": "
|
96
|
+
"gitHead": "3fecd142b2a2dac4027b90855c8b6a933ae30d61"
|
97
97
|
}
|