@pipelinesolucoes/carousel 1.0.0-beta.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/LICENSE +78 -0
- package/README.md +171 -0
- package/dist/app/layout.d.ts +6 -0
- package/dist/app/layout.js +19 -0
- package/dist/app/layout.js.map +1 -0
- package/dist/app/page.d.ts +1 -0
- package/dist/app/page.js +6 -0
- package/dist/app/page.js.map +1 -0
- package/dist/components/BookCarousel.d.ts +5 -0
- package/dist/components/BookCarousel.js +288 -0
- package/dist/components/BookCarousel.js.map +1 -0
- package/dist/components/CardMarquee.d.ts +8 -0
- package/dist/components/CardMarquee.js +56 -0
- package/dist/components/CardMarquee.js.map +1 -0
- package/dist/components/CarouselCircular.d.ts +11 -0
- package/dist/components/CarouselCircular.js +83 -0
- package/dist/components/CarouselCircular.js.map +1 -0
- package/dist/components/Carrossel.d.ts +15 -0
- package/dist/components/Carrossel.js +118 -0
- package/dist/components/Carrossel.js.map +1 -0
- package/dist/components/ImageCarousel.d.ts +16 -0
- package/dist/components/ImageCarousel.js +126 -0
- package/dist/components/ImageCarousel.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/pages/_app.d.ts +2 -0
- package/dist/pages/_app.js +20 -0
- package/dist/pages/_app.js.map +1 -0
- package/dist/pages/_document.d.ts +9 -0
- package/dist/pages/_document.js +33 -0
- package/dist/pages/_document.js.map +1 -0
- package/dist/theme.d.ts +35 -0
- package/dist/theme.js +142 -0
- package/dist/theme.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface DataCarouselCircular {
|
|
2
|
+
src: string;
|
|
3
|
+
caption: string;
|
|
4
|
+
}
|
|
5
|
+
interface CarouselCircularProps {
|
|
6
|
+
images: DataCarouselCircular[];
|
|
7
|
+
margin: string;
|
|
8
|
+
color: string;
|
|
9
|
+
}
|
|
10
|
+
declare const CarouselCircular: React.FC<CarouselCircularProps>;
|
|
11
|
+
export default CarouselCircular;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Box, Typography } from "@mui/material";
|
|
4
|
+
import { motion } from "framer-motion";
|
|
5
|
+
import { useEffect, useState } from "react";
|
|
6
|
+
const CarouselCircular = ({ images, margin, color }) => {
|
|
7
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const interval = setInterval(() => {
|
|
10
|
+
setCurrentIndex((prev) => (prev - 1 + images.length) % images.length); // decrementa
|
|
11
|
+
}, 3000);
|
|
12
|
+
return () => clearInterval(interval);
|
|
13
|
+
}, [images.length]);
|
|
14
|
+
// calcula posição relativa de cada item em relação ao central
|
|
15
|
+
const getPosition = (index) => {
|
|
16
|
+
const middle = 2; // posição central na tela
|
|
17
|
+
let pos = index - currentIndex;
|
|
18
|
+
if (pos < -Math.floor(images.length / 2))
|
|
19
|
+
pos += images.length;
|
|
20
|
+
if (pos > Math.floor(images.length / 2))
|
|
21
|
+
pos -= images.length;
|
|
22
|
+
return pos;
|
|
23
|
+
};
|
|
24
|
+
const getScale = (pos) => {
|
|
25
|
+
switch (pos) {
|
|
26
|
+
case 0:
|
|
27
|
+
return 2.0;
|
|
28
|
+
case -1:
|
|
29
|
+
case 1:
|
|
30
|
+
return 1.5;
|
|
31
|
+
default:
|
|
32
|
+
return 1.0;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const getZIndex = (pos) => {
|
|
36
|
+
switch (pos) {
|
|
37
|
+
case 0:
|
|
38
|
+
return 3;
|
|
39
|
+
case -1:
|
|
40
|
+
case 1:
|
|
41
|
+
return 2;
|
|
42
|
+
default:
|
|
43
|
+
return 1;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return (_jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "space-between", sx: {
|
|
47
|
+
width: "100%",
|
|
48
|
+
minHeight: "350px",
|
|
49
|
+
margin: margin,
|
|
50
|
+
overflow: "hidden",
|
|
51
|
+
}, children: [_jsx(Box, { flex: 1, display: "flex", justifyContent: "center", alignItems: "center", sx: {
|
|
52
|
+
position: "relative",
|
|
53
|
+
width: "100%",
|
|
54
|
+
minHeight: "250px",
|
|
55
|
+
}, children: images.map((item, index) => {
|
|
56
|
+
const pos = getPosition(index);
|
|
57
|
+
return (_jsx(motion.img, { src: item.src, style: {
|
|
58
|
+
position: "absolute",
|
|
59
|
+
width: "200px",
|
|
60
|
+
height: "140px",
|
|
61
|
+
borderRadius: "12px",
|
|
62
|
+
objectFit: "cover",
|
|
63
|
+
zIndex: getZIndex(pos),
|
|
64
|
+
}, animate: {
|
|
65
|
+
x: pos * 220, // deslocamento horizontal
|
|
66
|
+
scale: getScale(pos),
|
|
67
|
+
opacity: pos === 0 ? 1 : 0.8,
|
|
68
|
+
}, transition: {
|
|
69
|
+
duration: 1, // transição mais suave
|
|
70
|
+
ease: "easeInOut",
|
|
71
|
+
} }, `${item.src}-${index}`));
|
|
72
|
+
}) }), _jsx(Box, { sx: {
|
|
73
|
+
minHeight: "auto",
|
|
74
|
+
display: "flex",
|
|
75
|
+
flexDirection: "column",
|
|
76
|
+
alignItems: "center",
|
|
77
|
+
justifyContent: "center",
|
|
78
|
+
width: "100%",
|
|
79
|
+
gap: "16px",
|
|
80
|
+
}, children: _jsx(Typography, { variant: "h5", textAlign: "center", maxWidth: "80%", color: color, children: images[currentIndex].caption }) })] }));
|
|
81
|
+
};
|
|
82
|
+
export default CarouselCircular;
|
|
83
|
+
//# sourceMappingURL=CarouselCircular.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarouselCircular.js","sourceRoot":"","sources":["../../src/components/CarouselCircular.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AA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AM;4BACpB,SAAS,EAAE,OAAO;4BAClB,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC;yBACvB,EACD,OAAO,EAAE;4BACP,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,0BAA0B;4BACxC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC;4BACpB,OAAO,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;yBAC7B,EACD,UAAU,EAAE;4BACV,QAAQ,EAAE,CAAC,EAAE,uBAAuB;4BACpC,IAAI,EAAE,WAAW;yBAClB,IAlBI,GAAG,IAAI,CAAC,GAAG,IAAI,KAAK,EAAE,CAmB3B,CACH,CAAC;gBACJ,CAAC,CAAC,GACE,EAGN,KAAC,GAAG,IACF,EAAE,EAAE;oBACF,SAAS,EAAE,MAAM;oBACjB,OAAO,EAAE,MAAM;oBACf,aAAa,EAAE,QAAQ;oBACvB,UAAU,EAAE,QAAQ;oBACpB,cAAc,EAAE,QAAQ;oBACxB,KAAK,EAAE,MAAM;oBACb,GAAG,EAAE,MAAM;iBACZ,YAED,KAAC,UAAU,IAAC,OAAO,EAAC,IAAI,EAAC,SAAS,EAAC,QAAQ,EAAC,QAAQ,EAAC,KAAK,EAAC,KAAK,EAAE,KAAK,YACpE,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,GAClB,GACT,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface CarrosselProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
cardsCount: number;
|
|
5
|
+
cardWidth: number;
|
|
6
|
+
background_color_button: string;
|
|
7
|
+
background_color_hover_button: string;
|
|
8
|
+
color_button: string;
|
|
9
|
+
color_hover_button: string;
|
|
10
|
+
color_dot_active: string;
|
|
11
|
+
border_radius_button: string;
|
|
12
|
+
texto?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const Carrossel: React.FC<CarrosselProps>;
|
|
15
|
+
export default Carrossel;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { motion, useMotionValue } from 'framer-motion';
|
|
4
|
+
import { ChevronLeft, ChevronRight } from '@mui/icons-material';
|
|
5
|
+
import { styled } from '@mui/material';
|
|
6
|
+
const CarouselWrapper = styled('div')(() => ({
|
|
7
|
+
position: 'relative',
|
|
8
|
+
width: '100%',
|
|
9
|
+
margin: '0 auto',
|
|
10
|
+
overflow: 'hidden',
|
|
11
|
+
'@media (min-width:1921px)': { maxWidth: '1920px' },
|
|
12
|
+
'@media (min-width:1441px) and (max-width:1920px)': { maxWidth: '1500px' },
|
|
13
|
+
'@media (min-width:1280px) and (max-width:1440px)': { maxWidth: '1200px' },
|
|
14
|
+
'@media (min-width:960px) and (max-width:1279px)': { maxWidth: '940px' },
|
|
15
|
+
'@media (min-width:600px) and (max-width:959px)': { maxWidth: '600px' },
|
|
16
|
+
'@media (max-width:599px)': { maxWidth: '300px' },
|
|
17
|
+
}));
|
|
18
|
+
const CarouselContainer = styled(motion.div)(() => ({
|
|
19
|
+
display: 'flex',
|
|
20
|
+
gap: '24px',
|
|
21
|
+
}));
|
|
22
|
+
const ButtonContainer = styled(motion.div)(() => ({
|
|
23
|
+
display: 'flex',
|
|
24
|
+
width: '100%',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
justifyContent: 'flex-end',
|
|
27
|
+
padding: '16px 8px',
|
|
28
|
+
boxSizing: 'border-box',
|
|
29
|
+
}));
|
|
30
|
+
const ButtonStyle = styled('button', {
|
|
31
|
+
shouldForwardProp: (prop) => !['background_color', 'background_color_hover', 'color', 'color_hover', 'border_radius'].includes(prop),
|
|
32
|
+
})(({ background_color, background_color_hover, color, color_hover, border_radius }) => ({
|
|
33
|
+
backgroundColor: background_color,
|
|
34
|
+
color: color,
|
|
35
|
+
border: 'none',
|
|
36
|
+
padding: '8px',
|
|
37
|
+
cursor: 'pointer',
|
|
38
|
+
borderRadius: border_radius,
|
|
39
|
+
transition: 'all 0.3s ease',
|
|
40
|
+
'&:hover': {
|
|
41
|
+
backgroundColor: background_color_hover,
|
|
42
|
+
color: color_hover,
|
|
43
|
+
},
|
|
44
|
+
}));
|
|
45
|
+
const PaginationWrapper = styled('div')(() => ({
|
|
46
|
+
display: 'flex',
|
|
47
|
+
justifyContent: 'center',
|
|
48
|
+
gap: '8px',
|
|
49
|
+
marginTop: '16px',
|
|
50
|
+
}));
|
|
51
|
+
const Dot = styled('button', {
|
|
52
|
+
shouldForwardProp: (prop) => prop !== 'active',
|
|
53
|
+
})(({ active, color }) => ({
|
|
54
|
+
width: '10px',
|
|
55
|
+
height: '10px',
|
|
56
|
+
borderRadius: '50%',
|
|
57
|
+
border: 'none',
|
|
58
|
+
backgroundColor: active ? color : '#ccc',
|
|
59
|
+
transition: 'background-color 0.3s',
|
|
60
|
+
cursor: 'pointer',
|
|
61
|
+
'&:hover': {
|
|
62
|
+
backgroundColor: color,
|
|
63
|
+
},
|
|
64
|
+
}));
|
|
65
|
+
const Carrossel = ({ children, cardsCount, cardWidth, background_color_button, background_color_hover_button, color_button, color_hover_button, color_dot_active, border_radius_button, texto, }) => {
|
|
66
|
+
const wrapperRef = useRef(null);
|
|
67
|
+
const [maxOffset, setMaxOffset] = useState(0);
|
|
68
|
+
const [visibleCards, setVisibleCards] = useState(1);
|
|
69
|
+
const [currentPage, setCurrentPage] = useState(0);
|
|
70
|
+
const GAP = 24;
|
|
71
|
+
const x = useMotionValue(0);
|
|
72
|
+
// Calcula cards visíveis e maxOffset
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const calculateVisibleCards = () => {
|
|
75
|
+
if (wrapperRef.current) {
|
|
76
|
+
const wrapperWidth = wrapperRef.current.offsetWidth;
|
|
77
|
+
const totalCardWidth = (cardWidth + GAP) * cardsCount;
|
|
78
|
+
const maxScroll = wrapperWidth - totalCardWidth;
|
|
79
|
+
const visible = Math.floor(wrapperWidth / (cardWidth + GAP));
|
|
80
|
+
setVisibleCards(visible > 0 ? visible : 1);
|
|
81
|
+
setMaxOffset(maxScroll < 0 ? maxScroll : 0);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
calculateVisibleCards();
|
|
85
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
86
|
+
calculateVisibleCards();
|
|
87
|
+
});
|
|
88
|
+
if (wrapperRef.current)
|
|
89
|
+
resizeObserver.observe(wrapperRef.current);
|
|
90
|
+
return () => resizeObserver.disconnect();
|
|
91
|
+
}, [cardsCount, cardWidth]);
|
|
92
|
+
const totalPages = Math.ceil(cardsCount / visibleCards);
|
|
93
|
+
// Atualiza currentPage quando arrasta
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
const unsubscribe = x.onChange((latestX) => {
|
|
96
|
+
const page = Math.round(-latestX / ((cardWidth + GAP) * visibleCards));
|
|
97
|
+
setCurrentPage(Math.min(Math.max(page, 0), totalPages - 1));
|
|
98
|
+
});
|
|
99
|
+
return () => unsubscribe();
|
|
100
|
+
}, [x, cardWidth, visibleCards, totalPages]);
|
|
101
|
+
const goToPage = (pageIndex) => {
|
|
102
|
+
const newPosition = -((cardWidth + GAP) * visibleCards * pageIndex);
|
|
103
|
+
const clamped = Math.max(newPosition, maxOffset);
|
|
104
|
+
x.set(clamped);
|
|
105
|
+
setCurrentPage(pageIndex);
|
|
106
|
+
};
|
|
107
|
+
const handlePrev = () => {
|
|
108
|
+
if (currentPage > 0)
|
|
109
|
+
goToPage(currentPage - 1);
|
|
110
|
+
};
|
|
111
|
+
const handleNext = () => {
|
|
112
|
+
if (currentPage < totalPages - 1)
|
|
113
|
+
goToPage(currentPage + 1);
|
|
114
|
+
};
|
|
115
|
+
return (_jsxs(CarouselWrapper, { ref: wrapperRef, id: "carrossel", children: [_jsxs(ButtonContainer, { children: [texto && _jsx("span", { style: { flex: 1 }, children: texto }), _jsx(ButtonStyle, { onClick: handlePrev, background_color: background_color_button, background_color_hover: background_color_hover_button, color: color_button, color_hover: color_hover_button, border_radius: border_radius_button, "aria-label": "bot\u00E3o mover carrossel para a esquerda", children: _jsx(ChevronLeft, {}) }), _jsx(ButtonStyle, { onClick: handleNext, background_color: background_color_button, background_color_hover: background_color_hover_button, color: color_button, color_hover: color_hover_button, border_radius: border_radius_button, "aria-label": "bot\u00E3o mover carrossel para a direita", children: _jsx(ChevronRight, {}) })] }), _jsx(CarouselContainer, { style: { x }, drag: "x", dragConstraints: { left: maxOffset, right: 0 }, whileTap: { cursor: 'grabbing' }, transition: { type: 'spring', stiffness: 300, damping: 30 }, children: children }), _jsx(PaginationWrapper, { children: Array.from({ length: totalPages }).map((_, index) => (_jsx(Dot, { color: color_dot_active, active: index === currentPage, onClick: () => goToPage(index), "aria-label": `marcador ${index}` }, index))) })] }));
|
|
116
|
+
};
|
|
117
|
+
export default Carrossel;
|
|
118
|
+
//# sourceMappingURL=Carrossel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Carrossel.js","sourceRoot":"","sources":["../../src/components/Carrossel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3C,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,QAAQ;IAElB,2BAA2B,EAAE,EAAE,QAAQ,EAAE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}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ImageCarouselImage {
|
|
3
|
+
alt?: string;
|
|
4
|
+
src: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ImageCarouselProps {
|
|
7
|
+
width: string;
|
|
8
|
+
height: string;
|
|
9
|
+
dotColor: string;
|
|
10
|
+
activeDotColor: string;
|
|
11
|
+
autoPlay?: boolean;
|
|
12
|
+
autoPlayInterval?: number;
|
|
13
|
+
images: Array<string | ImageCarouselImage>;
|
|
14
|
+
}
|
|
15
|
+
declare const ImageCarousel: React.FC<ImageCarouselProps>;
|
|
16
|
+
export default ImageCarousel;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { styled } from "@mui/material/styles";
|
|
5
|
+
import Box from "@mui/material/Box";
|
|
6
|
+
import { gsap } from "gsap";
|
|
7
|
+
const CarouselRoot = styled("div", {
|
|
8
|
+
shouldForwardProp: (prop) => !["width", "height"].includes(prop),
|
|
9
|
+
})(({ width, height }) => ({
|
|
10
|
+
position: "relative",
|
|
11
|
+
width,
|
|
12
|
+
height,
|
|
13
|
+
overflow: "hidden",
|
|
14
|
+
display: "flex",
|
|
15
|
+
flexDirection: "column",
|
|
16
|
+
}));
|
|
17
|
+
const SlidesWrapper = styled(Box)({
|
|
18
|
+
position: "relative",
|
|
19
|
+
width: "100%",
|
|
20
|
+
height: "100%",
|
|
21
|
+
flex: 1,
|
|
22
|
+
});
|
|
23
|
+
const Slide = styled("div")(() => ({
|
|
24
|
+
position: "absolute",
|
|
25
|
+
width: "100%",
|
|
26
|
+
height: "100%",
|
|
27
|
+
opacity: 0,
|
|
28
|
+
pointerEvents: "none",
|
|
29
|
+
display: "flex",
|
|
30
|
+
alignItems: "center",
|
|
31
|
+
justifyContent: "center",
|
|
32
|
+
}));
|
|
33
|
+
const SlideImage = styled("img")(() => ({
|
|
34
|
+
width: "100%",
|
|
35
|
+
height: "100%",
|
|
36
|
+
objectFit: "contain",
|
|
37
|
+
display: "block",
|
|
38
|
+
}));
|
|
39
|
+
const DotsWrapper = styled("div")({
|
|
40
|
+
display: "flex",
|
|
41
|
+
justifyContent: "center",
|
|
42
|
+
gap: 8,
|
|
43
|
+
padding: "8px 0",
|
|
44
|
+
});
|
|
45
|
+
const Dot = styled("button", {
|
|
46
|
+
shouldForwardProp: (prop) => !["isActive", "dotColor", "activeDotColor"].includes(prop),
|
|
47
|
+
})(({ isActive, dotColor, activeDotColor }) => ({
|
|
48
|
+
width: 10,
|
|
49
|
+
height: 10,
|
|
50
|
+
borderRadius: "50%",
|
|
51
|
+
border: "none",
|
|
52
|
+
padding: 0,
|
|
53
|
+
cursor: "pointer",
|
|
54
|
+
backgroundColor: isActive ? activeDotColor : dotColor,
|
|
55
|
+
transition: "transform 0.2s ease, background-color 0.2s ease",
|
|
56
|
+
outline: "none",
|
|
57
|
+
"&:hover": { transform: "scale(1.1)" },
|
|
58
|
+
}));
|
|
59
|
+
const ImageCarousel = ({ width, height, dotColor, activeDotColor, autoPlay = true, autoPlayInterval = 5000, images, }) => {
|
|
60
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
61
|
+
const slidesRef = useRef([]);
|
|
62
|
+
const prevIndexRef = useRef(0);
|
|
63
|
+
const normalizedImages = useMemo(() => images.map((img) => (typeof img === "string" ? { src: img, alt: "" } : img)), [images]);
|
|
64
|
+
// 🔑 chave baseada nos src (resolve troca de arrays com mesmo length)
|
|
65
|
+
const imagesKey = useMemo(() => normalizedImages.map((i) => i.src).join("|"), [normalizedImages]);
|
|
66
|
+
// Sempre que mudar o conjunto de imagens, resetar index e estados internos
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (!normalizedImages.length)
|
|
69
|
+
return;
|
|
70
|
+
setActiveIndex(0);
|
|
71
|
+
prevIndexRef.current = 0;
|
|
72
|
+
// garante ref alinhado ao novo tamanho
|
|
73
|
+
slidesRef.current = slidesRef.current.slice(0, normalizedImages.length);
|
|
74
|
+
}, [imagesKey, normalizedImages.length]);
|
|
75
|
+
// Inicializa opacidades sempre que mudar o conjunto de imagens (ou refs)
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (!normalizedImages.length)
|
|
78
|
+
return;
|
|
79
|
+
slidesRef.current.forEach((slide, index) => {
|
|
80
|
+
if (!slide)
|
|
81
|
+
return;
|
|
82
|
+
gsap.killTweensOf(slide);
|
|
83
|
+
gsap.set(slide, { opacity: index === activeIndex ? 1 : 0 });
|
|
84
|
+
});
|
|
85
|
+
prevIndexRef.current = activeIndex;
|
|
86
|
+
}, [imagesKey, normalizedImages.length, activeIndex]);
|
|
87
|
+
// Anima transição (e também reage quando imagesKey muda)
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
const slides = slidesRef.current;
|
|
90
|
+
const current = slides[activeIndex];
|
|
91
|
+
if (!current)
|
|
92
|
+
return;
|
|
93
|
+
const prevIndex = prevIndexRef.current;
|
|
94
|
+
const prev = slides[prevIndex];
|
|
95
|
+
if (prev && prev !== current) {
|
|
96
|
+
gsap.killTweensOf(prev);
|
|
97
|
+
gsap.to(prev, { opacity: 0, duration: 0.6, ease: "power2.out" });
|
|
98
|
+
}
|
|
99
|
+
gsap.killTweensOf(current);
|
|
100
|
+
gsap.to(current, { opacity: 1, duration: 0.6, ease: "power2.out" });
|
|
101
|
+
prevIndexRef.current = activeIndex;
|
|
102
|
+
}, [activeIndex, imagesKey]);
|
|
103
|
+
// Autoplay
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (!autoPlay || !normalizedImages.length)
|
|
106
|
+
return;
|
|
107
|
+
const interval = window.setInterval(() => {
|
|
108
|
+
setActiveIndex((prev) => (prev + 1 >= normalizedImages.length ? 0 : prev + 1));
|
|
109
|
+
}, autoPlayInterval);
|
|
110
|
+
return () => window.clearInterval(interval);
|
|
111
|
+
}, [autoPlay, autoPlayInterval, normalizedImages.length]);
|
|
112
|
+
const handleDotClick = (index) => setActiveIndex(index);
|
|
113
|
+
if (!normalizedImages.length)
|
|
114
|
+
return null;
|
|
115
|
+
return (_jsxs(CarouselRoot, { width: width, height: height, children: [_jsx(SlidesWrapper, { children: normalizedImages.map((image, index) => {
|
|
116
|
+
var _a;
|
|
117
|
+
return (_jsx(Slide, { ref: (el) => {
|
|
118
|
+
slidesRef.current[index] = el;
|
|
119
|
+
},
|
|
120
|
+
// ✅ garante que mesmo com autoPlay=false a primeira imagem apareça
|
|
121
|
+
style: { opacity: index === activeIndex ? 1 : 0 }, children: _jsx(SlideImage, { src: image.src, alt: (_a = image.alt) !== null && _a !== void 0 ? _a : "" }) }, image.src + index));
|
|
122
|
+
}) }), _jsx(DotsWrapper, { children: normalizedImages.map((_, index) => (_jsx(Dot, { type: "button", onClick: () => handleDotClick(index), isActive: index === activeIndex, dotColor: dotColor, activeDotColor: activeDotColor, "aria-label": `Ir para imagem ${index + 1}` }, index))) })] }));
|
|
123
|
+
};
|
|
124
|
+
ImageCarousel.displayName = "ImageCarousel";
|
|
125
|
+
export default ImageCarousel;
|
|
126
|
+
//# sourceMappingURL=ImageCarousel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageCarousel.js","sourceRoot":"","sources":["../../src/components/ImageCarousel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,EAAE;IACjC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAA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+1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAC,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAC,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
|
|
4
|
+
import CssBaseline from '@mui/material/CssBaseline';
|
|
5
|
+
import { CacheProvider } from '@emotion/react';
|
|
6
|
+
import createCache from '@emotion/cache';
|
|
7
|
+
import { theme } from '@/theme';
|
|
8
|
+
// Crie uma instância de cache para o Emotion
|
|
9
|
+
const cache = createCache({ key: 'css', prepend: true });
|
|
10
|
+
export default function MyApp({ Component, pageProps }) {
|
|
11
|
+
React.useEffect(() => {
|
|
12
|
+
// Remove o CSS injetado pelo servidor, se existir
|
|
13
|
+
const jssStyles = document.querySelector('#jss-server-side');
|
|
14
|
+
if (jssStyles && jssStyles.parentElement) {
|
|
15
|
+
jssStyles.parentElement.removeChild(jssStyles);
|
|
16
|
+
}
|
|
17
|
+
}, []);
|
|
18
|
+
return (_jsx(CacheProvider, { value: cache, children: _jsxs(MuiThemeProvider, { theme: theme, children: [_jsx(CssBaseline, {}), _jsx(Component, Object.assign({}, pageProps))] }) }));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=_app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_app.js","sourceRoot":"","sources":["../../src/pages/_app.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,6CAA6C;AAC7C,MAAM,KAAK,GAAG,WAAW,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AAEzD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,SAAS,EAAE,SAAS,EAAY;IAC9D,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,kDAAkD;QAClD,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;QAC7D,IAAI,SAAS,IAAI,SAAS,CAAC,aAAa,EAAE,CAAC;YACzC,SAAS,CAAC,aAAa,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QACjD,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YACzB,MAAC,gBAAgB,IAAC,KAAK,EAAE,KAAK,aAC5B,KAAC,WAAW,KAAe,EAC3B,KAAC,SAAS,oBAAK,SAAS,EAAe,IACtB,GACL,CACjB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Document, { DocumentContext } from "next/document";
|
|
2
|
+
export default class MyDocument extends Document {
|
|
3
|
+
static getInitialProps(ctx: DocumentContext): Promise<{
|
|
4
|
+
styles: import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
html: string;
|
|
6
|
+
head?: Array<import("react").JSX.Element | null>;
|
|
7
|
+
}>;
|
|
8
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Document, { Html, Head, Main, NextScript } from "next/document";
|
|
3
|
+
import createCache from "@emotion/cache";
|
|
4
|
+
import createEmotionServer from "@emotion/server/create-instance";
|
|
5
|
+
import { CacheProvider } from "@emotion/react";
|
|
6
|
+
// Função para criar o cache do Emotion
|
|
7
|
+
const createEmotionCache = () => {
|
|
8
|
+
return createCache({ key: "css", prepend: true });
|
|
9
|
+
};
|
|
10
|
+
export default class MyDocument extends Document {
|
|
11
|
+
static async getInitialProps(ctx) {
|
|
12
|
+
const cache = createEmotionCache();
|
|
13
|
+
const { extractCriticalToChunks } = createEmotionServer(cache);
|
|
14
|
+
const originalRenderPage = ctx.renderPage;
|
|
15
|
+
try {
|
|
16
|
+
ctx.renderPage = () => originalRenderPage({
|
|
17
|
+
enhanceApp: (App) => (props) => (_jsx(CacheProvider, { value: cache, children: _jsx(App, Object.assign({}, props)) })),
|
|
18
|
+
});
|
|
19
|
+
const initialProps = await Document.getInitialProps(ctx);
|
|
20
|
+
// Extrai os estilos críticos para renderização no lado do servidor
|
|
21
|
+
const emotionStyles = extractCriticalToChunks(initialProps.html);
|
|
22
|
+
const emotionStyleTags = emotionStyles.styles.map((style) => (_jsx("style", { "data-emotion": `${style.key} ${style.ids.join(" ")}`, dangerouslySetInnerHTML: { __html: style.css } }, style.key)));
|
|
23
|
+
return Object.assign(Object.assign({}, initialProps), { styles: (_jsxs(_Fragment, { children: [initialProps.styles, emotionStyleTags] })) });
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
// Nada a liberar como no caso do styled-components
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
return (_jsxs(Html, { lang: "pt", children: [_jsx(Head, {}), _jsxs("body", { children: [_jsx(Main, {}), _jsx(NextScript, {})] })] }));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=_document.js.map
|
|
@@ -0,0 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CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC3D,gCAEgB,GAAG,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EACnD,uBAAuB,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,EAAE,IAFzC,KAAK,CAAC,GAAG,CAGd,CACH,CAAC,CAAC;YAEH,uCACK,YAAY,KACf,MAAM,EAAE,CACN,8BACG,YAAY,CAAC,MAAM,EACnB,gBAAgB,IAChB,CACJ,IACD;QACJ,CAAC;gBAAS,CAAC;YACT,mDAAmD;QACrD,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO,CACL,MAAC,IAAI,IAAC,IAAI,EAAC,IAAI,aACb,KAAC,IAAI,KACE,EACP,2BACE,KAAC,IAAI,KAAG,EACR,KAAC,UAAU,KAAG,IACT,IACF,CACR,CAAC;IACJ,CAAC;CACF"}
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare module '@mui/material/styles' {
|
|
2
|
+
interface Palette {
|
|
3
|
+
custom: {
|
|
4
|
+
transparent: string;
|
|
5
|
+
backgroundSectionMain: string;
|
|
6
|
+
backgroundSectionAlternative: string;
|
|
7
|
+
backgroundSectionHighlight?: string;
|
|
8
|
+
colorSectionMain: string;
|
|
9
|
+
backgroundButtonCTA: string;
|
|
10
|
+
backgroundHoverButtonCTA: string;
|
|
11
|
+
colorButtonCTA: string;
|
|
12
|
+
colorHoverButtonCTA: string;
|
|
13
|
+
borderRadiusButtonCTA: string;
|
|
14
|
+
carouselColorIndicators: string;
|
|
15
|
+
carouselColorFocus: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
interface PaletteOptions {
|
|
19
|
+
custom?: {
|
|
20
|
+
transparent: string;
|
|
21
|
+
backgroundSectionMain: string;
|
|
22
|
+
backgroundSectionAlternative: string;
|
|
23
|
+
backgroundSectionHighlight?: string;
|
|
24
|
+
backgroundButtonCTA: string;
|
|
25
|
+
backgroundHoverButtonCTA: string;
|
|
26
|
+
colorButtonCTA: string;
|
|
27
|
+
colorHoverButtonCTA: string;
|
|
28
|
+
borderRadiusButtonCTA: string;
|
|
29
|
+
carouselColorIndicators: string;
|
|
30
|
+
carouselColorFocus: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
declare const theme: import("@mui/material/styles").Theme;
|
|
35
|
+
export { theme };
|