@megafon/ui-core 4.15.1 → 4.15.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.
- package/CHANGELOG.md +11 -0
- package/dist/es/components/Carousel/Carousel.css +1 -1
- package/dist/es/components/Carousel/Carousel.d.ts +10 -2
- package/dist/es/components/Carousel/Carousel.js +10 -2
- package/dist/es/components/Carousel/useGradient.d.ts +0 -8
- package/dist/es/components/Carousel/useGradient.js +0 -11
- package/dist/lib/components/Carousel/Carousel.css +1 -1
- package/dist/lib/components/Carousel/Carousel.d.ts +10 -2
- package/dist/lib/components/Carousel/Carousel.js +11 -3
- package/dist/lib/components/Carousel/useGradient.d.ts +0 -8
- package/dist/lib/components/Carousel/useGradient.js +1 -13
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.15.2](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.15.1...@megafon/ui-core@4.15.2) (2023-04-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **carousel:** fix gradientColor type and gradient height ([2d7eea0](https://github.com/MegafonWebLab/megafon-ui/commit/2d7eea0f215433912542a5a6eb99f48c7331a6d2))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [4.15.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.15.0...@megafon/ui-core@4.15.1) (2023-04-04)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import SwiperCore from 'swiper';
|
|
3
3
|
import { PaginationOptions } from 'swiper/types/components/pagination';
|
|
4
|
-
import { GradientTheme } from './useGradient';
|
|
5
4
|
import './Carousel.less';
|
|
6
5
|
export declare const NavTheme: {
|
|
7
6
|
readonly LIGHT: "light";
|
|
@@ -14,9 +13,18 @@ export declare const EffectTheme: {
|
|
|
14
13
|
declare const SlidesPerView: {
|
|
15
14
|
readonly AUTO: "auto";
|
|
16
15
|
};
|
|
16
|
+
declare const GradientTheme: {
|
|
17
|
+
readonly DEFAULT: "default";
|
|
18
|
+
readonly GREEN: "green";
|
|
19
|
+
readonly BLACK: "black";
|
|
20
|
+
readonly SPB_SKY_0: "spbSky0";
|
|
21
|
+
readonly SPB_SKY_1: "spbSky1";
|
|
22
|
+
readonly SPB_SKY_2: "spbSky2";
|
|
23
|
+
};
|
|
17
24
|
declare type SlidesPerViewType = typeof SlidesPerView[keyof typeof SlidesPerView];
|
|
18
25
|
declare type NavThemeType = typeof NavTheme[keyof typeof NavTheme];
|
|
19
26
|
declare type EffectThemeType = typeof EffectTheme[keyof typeof EffectTheme];
|
|
27
|
+
declare type GradientThemeType = typeof GradientTheme[keyof typeof GradientTheme];
|
|
20
28
|
export declare type SlidesSettingsType = {
|
|
21
29
|
[key: number]: {
|
|
22
30
|
slidesPerView: number | SlidesPerViewType;
|
|
@@ -86,7 +94,7 @@ export interface ICarouselProps {
|
|
|
86
94
|
/** Наличие градиента по краям контейнера */
|
|
87
95
|
gradient?: boolean;
|
|
88
96
|
/** Цвет градиента */
|
|
89
|
-
gradientColor?:
|
|
97
|
+
gradientColor?: GradientThemeType;
|
|
90
98
|
}
|
|
91
99
|
declare const Carousel: React.FC<ICarouselProps>;
|
|
92
100
|
export default Carousel;
|
|
@@ -19,7 +19,7 @@ import NavArrow, { Theme as ArrowTheme } from "../NavArrow/NavArrow";
|
|
|
19
19
|
import throttleTime from "../../constants/throttleTime";
|
|
20
20
|
import usePrevious from "../../hooks/usePrevious";
|
|
21
21
|
import checkBreakpointsPropTypes from "./checkBreakpointsPropTypes";
|
|
22
|
-
import useGradient
|
|
22
|
+
import useGradient from "./useGradient";
|
|
23
23
|
import "./Carousel.css";
|
|
24
24
|
SwiperCore.use([Autoplay, Pagination, EffectFade]);
|
|
25
25
|
export var NavTheme = {
|
|
@@ -33,6 +33,14 @@ export var EffectTheme = {
|
|
|
33
33
|
var SlidesPerView = {
|
|
34
34
|
AUTO: 'auto'
|
|
35
35
|
};
|
|
36
|
+
var GradientTheme = {
|
|
37
|
+
DEFAULT: 'default',
|
|
38
|
+
GREEN: 'green',
|
|
39
|
+
BLACK: 'black',
|
|
40
|
+
SPB_SKY_0: 'spbSky0',
|
|
41
|
+
SPB_SKY_1: 'spbSky1',
|
|
42
|
+
SPB_SKY_2: 'spbSky2'
|
|
43
|
+
};
|
|
36
44
|
|
|
37
45
|
var getAutoPlayConfig = function getAutoPlayConfig(delay) {
|
|
38
46
|
return {
|
|
@@ -101,7 +109,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
101
109
|
_ref$gradient = _ref.gradient,
|
|
102
110
|
gradient = _ref$gradient === void 0 ? false : _ref$gradient,
|
|
103
111
|
_ref$gradientColor = _ref.gradientColor,
|
|
104
|
-
gradientColor = _ref$gradientColor === void 0 ?
|
|
112
|
+
gradientColor = _ref$gradientColor === void 0 ? 'default' : _ref$gradientColor;
|
|
105
113
|
|
|
106
114
|
var _React$useState = React.useState(),
|
|
107
115
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -6,13 +6,5 @@ declare type SwiperConfig = {
|
|
|
6
6
|
slidesSettings: SlidesSettingsType;
|
|
7
7
|
isLocked: boolean;
|
|
8
8
|
};
|
|
9
|
-
export declare enum GradientTheme {
|
|
10
|
-
DEFAULT = "default",
|
|
11
|
-
GREEN = "green",
|
|
12
|
-
BLACK = "black",
|
|
13
|
-
SPB_SKY_0 = "spbSky0",
|
|
14
|
-
SPB_SKY_1 = "spbSky1",
|
|
15
|
-
SPB_SKY_2 = "spbSky2"
|
|
16
|
-
}
|
|
17
9
|
declare const _default: (gradient: boolean, swiper: SwiperConfig) => CSSProperties;
|
|
18
10
|
export default _default;
|
|
@@ -3,17 +3,6 @@ import { useState, useEffect } from 'react';
|
|
|
3
3
|
import { breakpoints } from '@megafon/ui-helpers';
|
|
4
4
|
import throttle from 'lodash.throttle';
|
|
5
5
|
import throttleTime from "../../constants/throttleTime";
|
|
6
|
-
export var GradientTheme;
|
|
7
|
-
|
|
8
|
-
(function (GradientTheme) {
|
|
9
|
-
GradientTheme["DEFAULT"] = "default";
|
|
10
|
-
GradientTheme["GREEN"] = "green";
|
|
11
|
-
GradientTheme["BLACK"] = "black";
|
|
12
|
-
GradientTheme["SPB_SKY_0"] = "spbSky0";
|
|
13
|
-
GradientTheme["SPB_SKY_1"] = "spbSky1";
|
|
14
|
-
GradientTheme["SPB_SKY_2"] = "spbSky2";
|
|
15
|
-
})(GradientTheme || (GradientTheme = {}));
|
|
16
|
-
|
|
17
6
|
export default (function (gradient, swiper) {
|
|
18
7
|
var _useState = useState(0),
|
|
19
8
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import SwiperCore from 'swiper';
|
|
3
3
|
import { PaginationOptions } from 'swiper/types/components/pagination';
|
|
4
|
-
import { GradientTheme } from './useGradient';
|
|
5
4
|
import './Carousel.less';
|
|
6
5
|
export declare const NavTheme: {
|
|
7
6
|
readonly LIGHT: "light";
|
|
@@ -14,9 +13,18 @@ export declare const EffectTheme: {
|
|
|
14
13
|
declare const SlidesPerView: {
|
|
15
14
|
readonly AUTO: "auto";
|
|
16
15
|
};
|
|
16
|
+
declare const GradientTheme: {
|
|
17
|
+
readonly DEFAULT: "default";
|
|
18
|
+
readonly GREEN: "green";
|
|
19
|
+
readonly BLACK: "black";
|
|
20
|
+
readonly SPB_SKY_0: "spbSky0";
|
|
21
|
+
readonly SPB_SKY_1: "spbSky1";
|
|
22
|
+
readonly SPB_SKY_2: "spbSky2";
|
|
23
|
+
};
|
|
17
24
|
declare type SlidesPerViewType = typeof SlidesPerView[keyof typeof SlidesPerView];
|
|
18
25
|
declare type NavThemeType = typeof NavTheme[keyof typeof NavTheme];
|
|
19
26
|
declare type EffectThemeType = typeof EffectTheme[keyof typeof EffectTheme];
|
|
27
|
+
declare type GradientThemeType = typeof GradientTheme[keyof typeof GradientTheme];
|
|
20
28
|
export declare type SlidesSettingsType = {
|
|
21
29
|
[key: number]: {
|
|
22
30
|
slidesPerView: number | SlidesPerViewType;
|
|
@@ -86,7 +94,7 @@ export interface ICarouselProps {
|
|
|
86
94
|
/** Наличие градиента по краям контейнера */
|
|
87
95
|
gradient?: boolean;
|
|
88
96
|
/** Цвет градиента */
|
|
89
|
-
gradientColor?:
|
|
97
|
+
gradientColor?: GradientThemeType;
|
|
90
98
|
}
|
|
91
99
|
declare const Carousel: React.FC<ICarouselProps>;
|
|
92
100
|
export default Carousel;
|
|
@@ -43,7 +43,7 @@ var _usePrevious = _interopRequireDefault(require("../../hooks/usePrevious"));
|
|
|
43
43
|
|
|
44
44
|
var _checkBreakpointsPropTypes = _interopRequireDefault(require("./checkBreakpointsPropTypes"));
|
|
45
45
|
|
|
46
|
-
var _useGradient =
|
|
46
|
+
var _useGradient = _interopRequireDefault(require("./useGradient"));
|
|
47
47
|
|
|
48
48
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
49
49
|
|
|
@@ -68,6 +68,14 @@ exports.EffectTheme = EffectTheme;
|
|
|
68
68
|
var SlidesPerView = {
|
|
69
69
|
AUTO: 'auto'
|
|
70
70
|
};
|
|
71
|
+
var GradientTheme = {
|
|
72
|
+
DEFAULT: 'default',
|
|
73
|
+
GREEN: 'green',
|
|
74
|
+
BLACK: 'black',
|
|
75
|
+
SPB_SKY_0: 'spbSky0',
|
|
76
|
+
SPB_SKY_1: 'spbSky1',
|
|
77
|
+
SPB_SKY_2: 'spbSky2'
|
|
78
|
+
};
|
|
71
79
|
|
|
72
80
|
var getAutoPlayConfig = function getAutoPlayConfig(delay) {
|
|
73
81
|
return {
|
|
@@ -136,7 +144,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
136
144
|
_ref$gradient = _ref.gradient,
|
|
137
145
|
gradient = _ref$gradient === void 0 ? false : _ref$gradient,
|
|
138
146
|
_ref$gradientColor = _ref.gradientColor,
|
|
139
|
-
gradientColor = _ref$gradientColor === void 0 ?
|
|
147
|
+
gradientColor = _ref$gradientColor === void 0 ? 'default' : _ref$gradientColor;
|
|
140
148
|
|
|
141
149
|
var _React$useState = _react["default"].useState(),
|
|
142
150
|
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
@@ -429,7 +437,7 @@ Carousel.propTypes = {
|
|
|
429
437
|
onPrevClick: PropTypes.func,
|
|
430
438
|
onChange: PropTypes.func,
|
|
431
439
|
gradient: PropTypes.oneOfType([PropTypes.bool]),
|
|
432
|
-
gradientColor: PropTypes.oneOf(Object.values(
|
|
440
|
+
gradientColor: PropTypes.oneOf(Object.values(GradientTheme))
|
|
433
441
|
};
|
|
434
442
|
var _default = Carousel;
|
|
435
443
|
exports["default"] = _default;
|
|
@@ -6,13 +6,5 @@ declare type SwiperConfig = {
|
|
|
6
6
|
slidesSettings: SlidesSettingsType;
|
|
7
7
|
isLocked: boolean;
|
|
8
8
|
};
|
|
9
|
-
export declare enum GradientTheme {
|
|
10
|
-
DEFAULT = "default",
|
|
11
|
-
GREEN = "green",
|
|
12
|
-
BLACK = "black",
|
|
13
|
-
SPB_SKY_0 = "spbSky0",
|
|
14
|
-
SPB_SKY_1 = "spbSky1",
|
|
15
|
-
SPB_SKY_2 = "spbSky2"
|
|
16
|
-
}
|
|
17
9
|
declare const _default: (gradient: boolean, swiper: SwiperConfig) => CSSProperties;
|
|
18
10
|
export default _default;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] =
|
|
6
|
+
exports["default"] = void 0;
|
|
7
7
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
|
|
@@ -17,18 +17,6 @@ var _throttleTime = _interopRequireDefault(require("../../constants/throttleTime
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
19
|
|
|
20
|
-
var GradientTheme;
|
|
21
|
-
exports.GradientTheme = GradientTheme;
|
|
22
|
-
|
|
23
|
-
(function (GradientTheme) {
|
|
24
|
-
GradientTheme["DEFAULT"] = "default";
|
|
25
|
-
GradientTheme["GREEN"] = "green";
|
|
26
|
-
GradientTheme["BLACK"] = "black";
|
|
27
|
-
GradientTheme["SPB_SKY_0"] = "spbSky0";
|
|
28
|
-
GradientTheme["SPB_SKY_1"] = "spbSky1";
|
|
29
|
-
GradientTheme["SPB_SKY_2"] = "spbSky2";
|
|
30
|
-
})(GradientTheme || (exports.GradientTheme = GradientTheme = {}));
|
|
31
|
-
|
|
32
20
|
var _default = function _default(gradient, swiper) {
|
|
33
21
|
var _useState = (0, _react.useState)(0),
|
|
34
22
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@megafon/ui-core",
|
|
3
|
-
"version": "4.15.
|
|
3
|
+
"version": "4.15.2",
|
|
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": "^2.
|
|
57
|
+
"@megafon/ui-icons": "^2.9.0",
|
|
58
58
|
"@svgr/core": "^2.4.1",
|
|
59
59
|
"@testing-library/jest-dom": "5.16.2",
|
|
60
60
|
"@testing-library/react": "12.1.2",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"react-popper": "^2.2.3",
|
|
101
101
|
"swiper": "^6.5.6"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "c2d54353eccef1c32cac6aa03b91d48e98dcdb84"
|
|
104
104
|
}
|