@semcore/carousel 2.0.17 → 2.0.19
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 +12 -0
- package/lib/cjs/Carousel.js +13 -13
- package/lib/cjs/index.d.js +2 -0
- package/lib/cjs/index.d.js.map +1 -0
- package/lib/es6/Carousel.js +13 -13
- package/lib/es6/index.d.js +2 -0
- package/lib/es6/index.d.js.map +1 -0
- package/package.json +3 -2
- package/lib/cjs/index.d.ts +0 -59
- package/lib/es6/index.d.ts +0 -59
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [2.0.19] - 2022-10-04
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Version patch update due to children dependencies update (`@semcore/utils` [3.37.1 ~> 3.37.2]).
|
|
10
|
+
|
|
11
|
+
## [2.0.18] - 2022-10-03
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Version patch update due to children dependencies update (`@semcore/icon` [2.32.0 ~> 2.32.1]).
|
|
16
|
+
|
|
5
17
|
## [2.0.17] - 2022-09-29
|
|
6
18
|
|
|
7
19
|
### Changed
|
package/lib/cjs/Carousel.js
CHANGED
|
@@ -54,22 +54,22 @@ var style = (
|
|
|
54
54
|
/*__reshadow_css_start__*/
|
|
55
55
|
_core.sstyled.insert(
|
|
56
56
|
/*__inner_css_start__*/
|
|
57
|
-
".
|
|
57
|
+
".___SCarousel_3eynj_gg_{overflow:hidden;outline:none}.___SContainer_3eynj_gg_{display:flex;transition:transform var(--duration_3eynj) ease-in-out}.___SItem_3eynj_gg_{flex:0 0 100%;max-width:100%;box-sizing:border-box;transform:var(--transform_3eynj);border-radius:6px;overflow:hidden}.___SIndicators_3eynj_gg_{display:flex;justify-content:center;margin-top:16px}.___SIndicator_3eynj_gg_{margin:0 6px;cursor:pointer;display:block;width:12px;height:12px;border-radius:6px;background-color:#a9abb6;opacity:.3;-o-object-fit:cover;object-fit:cover;transition:opacity .1s ease-in-out}.___SIndicator_3eynj_gg_:hover{opacity:.6}.___SIndicator_3eynj_gg_.__active_3eynj_gg_{opacity:1}.___SNext_3eynj_gg_,.___SPrev_3eynj_gg_{display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.___SPrev_3eynj_gg_{margin-right:12px}.___SNext_3eynj_gg_{margin-left:12px}.___SNext_3eynj_gg_.__disabled_3eynj_gg_,.___SPrev_3eynj_gg_.__disabled_3eynj_gg_{opacity:0.3;cursor:default;pointer-events:none}@media (prefers-reduced-motion){.___SContainer_3eynj_gg_{transition:none}}"
|
|
58
58
|
/*__inner_css_end__*/
|
|
59
|
-
, "
|
|
59
|
+
, "3eynj_gg_")
|
|
60
60
|
/*__reshadow_css_end__*/
|
|
61
61
|
, {
|
|
62
|
-
"__SCarousel": "
|
|
63
|
-
"__SContainer": "
|
|
64
|
-
"--duration": "--
|
|
65
|
-
"__SItem": "
|
|
66
|
-
"--transform": "--
|
|
67
|
-
"__SIndicators": "
|
|
68
|
-
"__SIndicator": "
|
|
69
|
-
"_active": "
|
|
70
|
-
"__SNext": "
|
|
71
|
-
"__SPrev": "
|
|
72
|
-
"_disabled": "
|
|
62
|
+
"__SCarousel": "___SCarousel_3eynj_gg_",
|
|
63
|
+
"__SContainer": "___SContainer_3eynj_gg_",
|
|
64
|
+
"--duration": "--duration_3eynj",
|
|
65
|
+
"__SItem": "___SItem_3eynj_gg_",
|
|
66
|
+
"--transform": "--transform_3eynj",
|
|
67
|
+
"__SIndicators": "___SIndicators_3eynj_gg_",
|
|
68
|
+
"__SIndicator": "___SIndicator_3eynj_gg_",
|
|
69
|
+
"_active": "__active_3eynj_gg_",
|
|
70
|
+
"__SNext": "___SNext_3eynj_gg_",
|
|
71
|
+
"__SPrev": "___SPrev_3eynj_gg_",
|
|
72
|
+
"_disabled": "__disabled_3eynj_gg_"
|
|
73
73
|
});
|
|
74
74
|
var position = {
|
|
75
75
|
getItemMin: function getItemMin(items) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn, CProps, ReturnEl } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\n\ntype ChildRenderFn<Props> = Props & {\n children?: ({\n items,\n }: {\n items: { active: boolean; onClick: () => void }[];\n }) => React.ReactElement | React.ReactElement[];\n};\n\nexport interface ICarouselProps {\n /** Index active item */\n index?: number;\n /**\n * Index of the active item selected by default\n * @default 0\n */\n defaultIndex?: number;\n /** Called when the selection is changed */\n onIndexChange?: (index: number) => void;\n /** Animation duration\n * @default 300 */\n duration?: number;\n /** Disables infinite items change in the carousel\n * @default false */\n bounded?: boolean;\n /** @ignore */\n step?: number;\n}\n\nexport interface ICarouselContext {\n getContainerProps: PropGetterFn;\n getItemProps: PropGetterFn;\n getPrevProps: PropGetterFn;\n getNextProps: PropGetterFn;\n getIndicatorsProps: PropGetterFn;\n}\n\nexport interface ICarouselState {\n // eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope\n items: { transform: number; position: number; node: HTMLDivElement }[];\n}\n\ndeclare const Carousel: (<T>(\n props: CProps<ICarouselProps & T, ICarouselContext, ICarouselState>,\n) => ReturnEl) & {\n Container: <T>(props: IBoxProps & T) => ReturnEl;\n Indicators: <T>(props: ChildRenderFn<IBoxProps & T>) => ReturnEl;\n Indicator: <T>(\n props: ChildRenderFn<IBoxProps & { active: boolean; onClick: () => void } & T>,\n ) => ReturnEl;\n Item: <T>(props: IBoxProps & T) => ReturnEl;\n Prev: <T>(props: IBoxProps & T) => ReturnEl;\n Next: <T>(props: IBoxProps & T) => ReturnEl;\n};\n\nexport default Carousel;\n"],"mappings":""}
|
package/lib/es6/Carousel.js
CHANGED
|
@@ -36,22 +36,22 @@ var style = (
|
|
|
36
36
|
/*__reshadow_css_start__*/
|
|
37
37
|
_sstyled.insert(
|
|
38
38
|
/*__inner_css_start__*/
|
|
39
|
-
".
|
|
39
|
+
".___SCarousel_3eynj_gg_{overflow:hidden;outline:none}.___SContainer_3eynj_gg_{display:flex;transition:transform var(--duration_3eynj) ease-in-out}.___SItem_3eynj_gg_{flex:0 0 100%;max-width:100%;box-sizing:border-box;transform:var(--transform_3eynj);border-radius:6px;overflow:hidden}.___SIndicators_3eynj_gg_{display:flex;justify-content:center;margin-top:16px}.___SIndicator_3eynj_gg_{margin:0 6px;cursor:pointer;display:block;width:12px;height:12px;border-radius:6px;background-color:#a9abb6;opacity:.3;-o-object-fit:cover;object-fit:cover;transition:opacity .1s ease-in-out}.___SIndicator_3eynj_gg_:hover{opacity:.6}.___SIndicator_3eynj_gg_.__active_3eynj_gg_{opacity:1}.___SNext_3eynj_gg_,.___SPrev_3eynj_gg_{display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.___SPrev_3eynj_gg_{margin-right:12px}.___SNext_3eynj_gg_{margin-left:12px}.___SNext_3eynj_gg_.__disabled_3eynj_gg_,.___SPrev_3eynj_gg_.__disabled_3eynj_gg_{opacity:0.3;cursor:default;pointer-events:none}@media (prefers-reduced-motion){.___SContainer_3eynj_gg_{transition:none}}"
|
|
40
40
|
/*__inner_css_end__*/
|
|
41
|
-
, "
|
|
41
|
+
, "3eynj_gg_")
|
|
42
42
|
/*__reshadow_css_end__*/
|
|
43
43
|
, {
|
|
44
|
-
"__SCarousel": "
|
|
45
|
-
"__SContainer": "
|
|
46
|
-
"--duration": "--
|
|
47
|
-
"__SItem": "
|
|
48
|
-
"--transform": "--
|
|
49
|
-
"__SIndicators": "
|
|
50
|
-
"__SIndicator": "
|
|
51
|
-
"_active": "
|
|
52
|
-
"__SNext": "
|
|
53
|
-
"__SPrev": "
|
|
54
|
-
"_disabled": "
|
|
44
|
+
"__SCarousel": "___SCarousel_3eynj_gg_",
|
|
45
|
+
"__SContainer": "___SContainer_3eynj_gg_",
|
|
46
|
+
"--duration": "--duration_3eynj",
|
|
47
|
+
"__SItem": "___SItem_3eynj_gg_",
|
|
48
|
+
"--transform": "--transform_3eynj",
|
|
49
|
+
"__SIndicators": "___SIndicators_3eynj_gg_",
|
|
50
|
+
"__SIndicator": "___SIndicator_3eynj_gg_",
|
|
51
|
+
"_active": "__active_3eynj_gg_",
|
|
52
|
+
"__SNext": "___SNext_3eynj_gg_",
|
|
53
|
+
"__SPrev": "___SPrev_3eynj_gg_",
|
|
54
|
+
"_disabled": "__disabled_3eynj_gg_"
|
|
55
55
|
});
|
|
56
56
|
var position = {
|
|
57
57
|
getItemMin: function getItemMin(items) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn, CProps, ReturnEl } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\n\ntype ChildRenderFn<Props> = Props & {\n children?: ({\n items,\n }: {\n items: { active: boolean; onClick: () => void }[];\n }) => React.ReactElement | React.ReactElement[];\n};\n\nexport interface ICarouselProps {\n /** Index active item */\n index?: number;\n /**\n * Index of the active item selected by default\n * @default 0\n */\n defaultIndex?: number;\n /** Called when the selection is changed */\n onIndexChange?: (index: number) => void;\n /** Animation duration\n * @default 300 */\n duration?: number;\n /** Disables infinite items change in the carousel\n * @default false */\n bounded?: boolean;\n /** @ignore */\n step?: number;\n}\n\nexport interface ICarouselContext {\n getContainerProps: PropGetterFn;\n getItemProps: PropGetterFn;\n getPrevProps: PropGetterFn;\n getNextProps: PropGetterFn;\n getIndicatorsProps: PropGetterFn;\n}\n\nexport interface ICarouselState {\n // eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope\n items: { transform: number; position: number; node: HTMLDivElement }[];\n}\n\ndeclare const Carousel: (<T>(\n props: CProps<ICarouselProps & T, ICarouselContext, ICarouselState>,\n) => ReturnEl) & {\n Container: <T>(props: IBoxProps & T) => ReturnEl;\n Indicators: <T>(props: ChildRenderFn<IBoxProps & T>) => ReturnEl;\n Indicator: <T>(\n props: ChildRenderFn<IBoxProps & { active: boolean; onClick: () => void } & T>,\n ) => ReturnEl;\n Item: <T>(props: IBoxProps & T) => ReturnEl;\n Prev: <T>(props: IBoxProps & T) => ReturnEl;\n Next: <T>(props: IBoxProps & T) => ReturnEl;\n};\n\nexport default Carousel;\n"],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/carousel",
|
|
3
3
|
"description": "Semrush Carousel Component",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.19",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"author": "UI-kit team <ui-kit-team@semrush.com>",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "
|
|
12
|
+
"build": "pnpm semcore-builder --source=js",
|
|
13
13
|
"test": "jest"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"directory": "semcore/carousel"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
+
"@types/react": "16.8 - 17",
|
|
33
34
|
"@semcore/jest-preset-ui": "1.0.0"
|
|
34
35
|
}
|
|
35
36
|
}
|
package/lib/cjs/index.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PropGetterFn, CProps, ReturnEl } from '@semcore/core';
|
|
3
|
-
import { IBoxProps } from '@semcore/flex-box';
|
|
4
|
-
|
|
5
|
-
type ChildRenderFn<Props> = Props & {
|
|
6
|
-
children?: ({
|
|
7
|
-
items,
|
|
8
|
-
}: {
|
|
9
|
-
items: { active: boolean; onClick: () => void }[];
|
|
10
|
-
}) => React.ReactElement | React.ReactElement[];
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export interface ICarouselProps {
|
|
14
|
-
/** Index active item */
|
|
15
|
-
index?: number;
|
|
16
|
-
/**
|
|
17
|
-
* Index of the active item selected by default
|
|
18
|
-
* @default 0
|
|
19
|
-
*/
|
|
20
|
-
defaultIndex?: number;
|
|
21
|
-
/** Called when the selection is changed */
|
|
22
|
-
onIndexChange?: (index: number) => void;
|
|
23
|
-
/** Animation duration
|
|
24
|
-
* @default 300 */
|
|
25
|
-
duration?: number;
|
|
26
|
-
/** Disables infinite items change in the carousel
|
|
27
|
-
* @default false */
|
|
28
|
-
bounded?: boolean;
|
|
29
|
-
/** @ignore */
|
|
30
|
-
step?: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface ICarouselContext {
|
|
34
|
-
getContainerProps: PropGetterFn;
|
|
35
|
-
getItemProps: PropGetterFn;
|
|
36
|
-
getPrevProps: PropGetterFn;
|
|
37
|
-
getNextProps: PropGetterFn;
|
|
38
|
-
getIndicatorsProps: PropGetterFn;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface ICarouselState {
|
|
42
|
-
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope
|
|
43
|
-
items: { transform: number; position: number; node: HTMLDivElement }[];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
declare const Carousel: (<T>(
|
|
47
|
-
props: CProps<ICarouselProps & T, ICarouselContext, ICarouselState>,
|
|
48
|
-
) => ReturnEl) & {
|
|
49
|
-
Container: <T>(props: IBoxProps & T) => ReturnEl;
|
|
50
|
-
Indicators: <T>(props: ChildRenderFn<IBoxProps & T>) => ReturnEl;
|
|
51
|
-
Indicator: <T>(
|
|
52
|
-
props: ChildRenderFn<IBoxProps & { active: boolean; onClick: () => void } & T>,
|
|
53
|
-
) => ReturnEl;
|
|
54
|
-
Item: <T>(props: IBoxProps & T) => ReturnEl;
|
|
55
|
-
Prev: <T>(props: IBoxProps & T) => ReturnEl;
|
|
56
|
-
Next: <T>(props: IBoxProps & T) => ReturnEl;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export default Carousel;
|
package/lib/es6/index.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PropGetterFn, CProps, ReturnEl } from '@semcore/core';
|
|
3
|
-
import { IBoxProps } from '@semcore/flex-box';
|
|
4
|
-
|
|
5
|
-
type ChildRenderFn<Props> = Props & {
|
|
6
|
-
children?: ({
|
|
7
|
-
items,
|
|
8
|
-
}: {
|
|
9
|
-
items: { active: boolean; onClick: () => void }[];
|
|
10
|
-
}) => React.ReactElement | React.ReactElement[];
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export interface ICarouselProps {
|
|
14
|
-
/** Index active item */
|
|
15
|
-
index?: number;
|
|
16
|
-
/**
|
|
17
|
-
* Index of the active item selected by default
|
|
18
|
-
* @default 0
|
|
19
|
-
*/
|
|
20
|
-
defaultIndex?: number;
|
|
21
|
-
/** Called when the selection is changed */
|
|
22
|
-
onIndexChange?: (index: number) => void;
|
|
23
|
-
/** Animation duration
|
|
24
|
-
* @default 300 */
|
|
25
|
-
duration?: number;
|
|
26
|
-
/** Disables infinite items change in the carousel
|
|
27
|
-
* @default false */
|
|
28
|
-
bounded?: boolean;
|
|
29
|
-
/** @ignore */
|
|
30
|
-
step?: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface ICarouselContext {
|
|
34
|
-
getContainerProps: PropGetterFn;
|
|
35
|
-
getItemProps: PropGetterFn;
|
|
36
|
-
getPrevProps: PropGetterFn;
|
|
37
|
-
getNextProps: PropGetterFn;
|
|
38
|
-
getIndicatorsProps: PropGetterFn;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface ICarouselState {
|
|
42
|
-
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope
|
|
43
|
-
items: { transform: number; position: number; node: HTMLDivElement }[];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
declare const Carousel: (<T>(
|
|
47
|
-
props: CProps<ICarouselProps & T, ICarouselContext, ICarouselState>,
|
|
48
|
-
) => ReturnEl) & {
|
|
49
|
-
Container: <T>(props: IBoxProps & T) => ReturnEl;
|
|
50
|
-
Indicators: <T>(props: ChildRenderFn<IBoxProps & T>) => ReturnEl;
|
|
51
|
-
Indicator: <T>(
|
|
52
|
-
props: ChildRenderFn<IBoxProps & { active: boolean; onClick: () => void } & T>,
|
|
53
|
-
) => ReturnEl;
|
|
54
|
-
Item: <T>(props: IBoxProps & T) => ReturnEl;
|
|
55
|
-
Prev: <T>(props: IBoxProps & T) => ReturnEl;
|
|
56
|
-
Next: <T>(props: IBoxProps & T) => ReturnEl;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export default Carousel;
|