@semcore/carousel 16.1.13 → 17.0.0-prerelease.17
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 +6 -0
- package/README.md +4 -4
- package/lib/cjs/Carousel.js +536 -553
- package/lib/cjs/Carousel.js.map +1 -1
- package/lib/cjs/Carousel.types.js.map +1 -1
- package/lib/cjs/index.js +4 -4
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +16 -16
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/Carousel.js +527 -544
- package/lib/es6/Carousel.js.map +1 -1
- package/lib/es6/Carousel.types.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +15 -15
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/esm/Carousel.mjs +518 -481
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/types/Carousel.types.d.ts +2 -11
- package/package.json +9 -8
- package/src/Carousel.tsx +15 -15
- package/src/Carousel.types.ts +2 -8
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
/** @deprecated */
|
|
4
|
-
export interface ICarouselProps extends CarouselProps, UnknownProperties {
|
|
5
|
-
}
|
|
1
|
+
import type { BoxProps } from '@semcore/base-components';
|
|
2
|
+
import type { PropGetterFn, Intergalactic, IRootComponentProps } from '@semcore/core';
|
|
6
3
|
export type CarouselProps = BoxProps & {
|
|
7
4
|
/** Index active item */
|
|
8
5
|
index?: number;
|
|
@@ -30,9 +27,6 @@ export type CarouselProps = BoxProps & {
|
|
|
30
27
|
/** Type of indicators */
|
|
31
28
|
indicators?: 'default' | 'hide' | 'preview';
|
|
32
29
|
};
|
|
33
|
-
/** @deprecated */
|
|
34
|
-
export interface ICarouselContext extends CarouselContext, UnknownProperties {
|
|
35
|
-
}
|
|
36
30
|
export type CarouselContext = {
|
|
37
31
|
getContainerProps: PropGetterFn;
|
|
38
32
|
getItemProps: PropGetterFn;
|
|
@@ -75,9 +69,6 @@ export type CarouselItemProps = BoxProps & {
|
|
|
75
69
|
*/
|
|
76
70
|
isOpenZoom?: boolean;
|
|
77
71
|
};
|
|
78
|
-
/** @deprecated */
|
|
79
|
-
export interface ICarouselState extends CarouselState, UnknownProperties {
|
|
80
|
-
}
|
|
81
72
|
export type CarouselState = {
|
|
82
73
|
isOpenZoom: boolean;
|
|
83
74
|
selectedIndex: number;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/carousel",
|
|
3
3
|
"description": "Semrush Carousel Component",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "17.0.0-prerelease.17",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,14 +14,13 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/
|
|
18
|
-
"@semcore/
|
|
19
|
-
"@semcore/modal": "16.1.12",
|
|
20
|
-
"@semcore/flex-box": "16.0.11",
|
|
17
|
+
"@semcore/button": "^16.0.13-prerelease.17",
|
|
18
|
+
"@semcore/modal": "^17.0.0-prerelease.17",
|
|
21
19
|
"@semcore/breakpoints": "16.0.11"
|
|
22
20
|
},
|
|
23
21
|
"peerDependencies": {
|
|
24
|
-
"@semcore/base-components": "^
|
|
22
|
+
"@semcore/base-components": "^17.0.0-prerelease.17",
|
|
23
|
+
"@semcore/icon": "^16.7.2-prerelease.17"
|
|
25
24
|
},
|
|
26
25
|
"repository": {
|
|
27
26
|
"type": "git",
|
|
@@ -29,8 +28,10 @@
|
|
|
29
28
|
"directory": "semcore/carousel"
|
|
30
29
|
},
|
|
31
30
|
"devDependencies": {
|
|
32
|
-
"@semcore/
|
|
33
|
-
"@semcore/
|
|
31
|
+
"@semcore/core": "17.0.0-prerelease.17",
|
|
32
|
+
"@semcore/base-components": "17.0.0-prerelease.17",
|
|
33
|
+
"@semcore/icon": "16.7.2-prerelease.17",
|
|
34
|
+
"@semcore/testing-utils": "1.0.0"
|
|
34
35
|
},
|
|
35
36
|
"scripts": {
|
|
36
37
|
"build": "pnpm semcore-builder --source=js,ts && pnpm vite build"
|
package/src/Carousel.tsx
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { createBreakpoints } from '@semcore/
|
|
1
|
+
import { createBreakpoints, Box, Flex } from '@semcore/base-components';
|
|
2
|
+
import type { BoxProps } from '@semcore/base-components';
|
|
2
3
|
import Button from '@semcore/button';
|
|
3
4
|
import { createComponent, Component, sstyled, Root } from '@semcore/core';
|
|
4
5
|
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
5
6
|
import { findAllComponents } from '@semcore/core/lib/utils/findComponent';
|
|
6
7
|
import logger from '@semcore/core/lib/utils/logger';
|
|
7
8
|
import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
|
|
8
|
-
import { Box, Flex } from '@semcore/flex-box';
|
|
9
|
-
import type { BoxProps } from '@semcore/flex-box';
|
|
10
9
|
import ChevronLeft from '@semcore/icon/ChevronLeft/l';
|
|
11
10
|
import ChevronRight from '@semcore/icon/ChevronRight/l';
|
|
12
11
|
import Modal from '@semcore/modal';
|
|
@@ -38,9 +37,10 @@ const isSmallScreen = (index?: number) => index === 1;
|
|
|
38
37
|
|
|
39
38
|
class CarouselRoot extends Component<
|
|
40
39
|
CarouselProps,
|
|
40
|
+
typeof enhance,
|
|
41
|
+
{ index: any },
|
|
41
42
|
CarouselContext,
|
|
42
|
-
CarouselState
|
|
43
|
-
typeof enhance
|
|
43
|
+
CarouselState
|
|
44
44
|
> {
|
|
45
45
|
static displayName = 'Carousel';
|
|
46
46
|
static defaultProps = {
|
|
@@ -597,21 +597,21 @@ class CarouselRoot extends Component<
|
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
599
|
|
|
600
|
-
|
|
600
|
+
function Container(props: BoxProps & { duration?: number }) {
|
|
601
601
|
const SContainer = Root;
|
|
602
602
|
const { styles, duration } = props;
|
|
603
603
|
|
|
604
604
|
return sstyled(styles)(
|
|
605
605
|
<SContainer render={Box} use:duration={`${duration}ms`} aria-live='polite' />,
|
|
606
606
|
);
|
|
607
|
-
}
|
|
607
|
+
}
|
|
608
608
|
|
|
609
|
-
|
|
609
|
+
function ContentBox(props: BoxProps) {
|
|
610
610
|
const SContentBox = Root;
|
|
611
611
|
const { styles } = props;
|
|
612
612
|
|
|
613
613
|
return sstyled(styles)(<SContentBox render={Box} />);
|
|
614
|
-
}
|
|
614
|
+
}
|
|
615
615
|
|
|
616
616
|
class Item extends Component<CarouselItemProps> {
|
|
617
617
|
refItem = React.createRef<HTMLElement>();
|
|
@@ -667,7 +667,7 @@ class Item extends Component<CarouselItemProps> {
|
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
669
|
|
|
670
|
-
|
|
670
|
+
function Prev(props: CarouselButtonProps) {
|
|
671
671
|
const { styles, children, Children, label, top = 0, inverted } = props;
|
|
672
672
|
const SPrev = Root;
|
|
673
673
|
const SPrevButton = Button;
|
|
@@ -692,7 +692,7 @@ const Prev = (props: CarouselButtonProps) => {
|
|
|
692
692
|
);
|
|
693
693
|
};
|
|
694
694
|
|
|
695
|
-
|
|
695
|
+
function Next(props: CarouselButtonProps) {
|
|
696
696
|
const { styles, children, Children, label, top = 0, inverted } = props;
|
|
697
697
|
const SNext = Root;
|
|
698
698
|
const SNextButton = Button;
|
|
@@ -717,7 +717,7 @@ const Next = (props: CarouselButtonProps) => {
|
|
|
717
717
|
);
|
|
718
718
|
};
|
|
719
719
|
|
|
720
|
-
|
|
720
|
+
function Indicators({ items, styles, Children, inverted }: CarouselIndicatorsProps) {
|
|
721
721
|
const SIndicators = Root;
|
|
722
722
|
if (Children.origin) {
|
|
723
723
|
return sstyled(styles)(
|
|
@@ -735,7 +735,7 @@ const Indicators = ({ items, styles, Children, inverted }: CarouselIndicatorsPro
|
|
|
735
735
|
);
|
|
736
736
|
};
|
|
737
737
|
|
|
738
|
-
|
|
738
|
+
function Indicator({ styles, Children, inverted }: CarouselIndicatorProps) {
|
|
739
739
|
const SIndicator = Root;
|
|
740
740
|
return sstyled(styles)(
|
|
741
741
|
<SIndicator render={Box}>
|
|
@@ -744,7 +744,7 @@ const Indicator = ({ styles, Children, inverted }: CarouselIndicatorProps) => {
|
|
|
744
744
|
);
|
|
745
745
|
};
|
|
746
746
|
|
|
747
|
-
const Carousel
|
|
747
|
+
const Carousel = createComponent(CarouselRoot, {
|
|
748
748
|
Container,
|
|
749
749
|
ContentBox,
|
|
750
750
|
Indicators,
|
|
@@ -752,6 +752,6 @@ const Carousel: typeof CarouselType = createComponent(CarouselRoot, {
|
|
|
752
752
|
Item,
|
|
753
753
|
Prev,
|
|
754
754
|
Next,
|
|
755
|
-
});
|
|
755
|
+
}) as typeof CarouselType;
|
|
756
756
|
|
|
757
757
|
export default Carousel;
|
package/src/Carousel.types.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { BoxProps } from '@semcore/base-components';
|
|
2
|
+
import type { PropGetterFn, Intergalactic, IRootComponentProps } from '@semcore/core';
|
|
3
3
|
|
|
4
|
-
/** @deprecated */
|
|
5
|
-
export interface ICarouselProps extends CarouselProps, UnknownProperties {}
|
|
6
4
|
export type CarouselProps = BoxProps & {
|
|
7
5
|
/** Index active item */
|
|
8
6
|
index?: number;
|
|
@@ -31,8 +29,6 @@ export type CarouselProps = BoxProps & {
|
|
|
31
29
|
indicators?: 'default' | 'hide' | 'preview';
|
|
32
30
|
};
|
|
33
31
|
|
|
34
|
-
/** @deprecated */
|
|
35
|
-
export interface ICarouselContext extends CarouselContext, UnknownProperties {}
|
|
36
32
|
export type CarouselContext = {
|
|
37
33
|
getContainerProps: PropGetterFn;
|
|
38
34
|
getItemProps: PropGetterFn;
|
|
@@ -85,8 +81,6 @@ export type CarouselItemProps = BoxProps & {
|
|
|
85
81
|
isOpenZoom?: boolean;
|
|
86
82
|
};
|
|
87
83
|
|
|
88
|
-
/** @deprecated */
|
|
89
|
-
export interface ICarouselState extends CarouselState, UnknownProperties {}
|
|
90
84
|
export type CarouselState = {
|
|
91
85
|
isOpenZoom: boolean;
|
|
92
86
|
selectedIndex: number;
|