@vite-mf-monorepo/ui 0.4.5 → 0.4.7
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/dist/Avatar/Avatar.d.ts +19 -0
- package/dist/Avatar/Avatar.js +62 -0
- package/dist/Avatar/Avatar.js.map +1 -0
- package/dist/Avatar/index.d.ts +3 -0
- package/dist/Avatar/index.js +5 -0
- package/dist/Avatar/index.js.map +1 -0
- package/dist/Badge/Badge.d.ts +23 -0
- package/dist/Badge/Badge.js +48 -0
- package/dist/Badge/Badge.js.map +1 -0
- package/dist/Badge/index.d.ts +4 -0
- package/dist/Badge/index.js +5 -0
- package/dist/Badge/index.js.map +1 -0
- package/dist/Button/Button.utils.d.ts +23 -0
- package/dist/{chunk-IUGKH376.js → Button/Button.utils.js} +8 -7
- package/dist/Button/Button.utils.js.map +1 -0
- package/dist/Button/index.d.ts +6 -26
- package/dist/Button/index.js +4 -5
- package/dist/Button/index.js.map +1 -1
- package/dist/Card/Card.d.ts +11 -0
- package/dist/{chunk-RZU2FFBW.js → Card/Card.js} +7 -8
- package/dist/Card/Card.js.map +1 -0
- package/dist/Card/index.d.ts +3 -11
- package/dist/Card/index.js +4 -2
- package/dist/Card/index.js.map +1 -1
- package/dist/Carousel/Carousel.d.ts +65 -0
- package/dist/Carousel/Carousel.js +268 -0
- package/dist/Carousel/Carousel.js.map +1 -0
- package/dist/Carousel/CarouselCounter.d.ts +17 -0
- package/dist/Carousel/CarouselCounter.js +28 -0
- package/dist/Carousel/CarouselCounter.js.map +1 -0
- package/dist/Carousel/CarouselError.d.ts +8 -0
- package/dist/Carousel/CarouselError.js +18 -0
- package/dist/Carousel/CarouselError.js.map +1 -0
- package/dist/Carousel/CarouselItem.d.ts +16 -0
- package/dist/Carousel/CarouselItem.js +28 -0
- package/dist/Carousel/CarouselItem.js.map +1 -0
- package/dist/Carousel/CarouselLoading.d.ts +25 -0
- package/dist/Carousel/CarouselLoading.js +63 -0
- package/dist/Carousel/CarouselLoading.js.map +1 -0
- package/dist/Carousel/CarouselNavigation.d.ts +31 -0
- package/dist/Carousel/CarouselNavigation.js +97 -0
- package/dist/Carousel/CarouselNavigation.js.map +1 -0
- package/dist/Carousel/CarouselPagination.d.ts +20 -0
- package/dist/Carousel/CarouselPagination.js +29 -0
- package/dist/Carousel/CarouselPagination.js.map +1 -0
- package/dist/Carousel/index.d.ts +8 -0
- package/dist/Carousel/index.js +15 -0
- package/dist/Carousel/index.js.map +1 -0
- package/dist/HeroImage/HeroImage.d.ts +15 -0
- package/dist/HeroImage/HeroImage.js +47 -0
- package/dist/HeroImage/HeroImage.js.map +1 -0
- package/dist/HeroImage/index.d.ts +2 -0
- package/dist/HeroImage/index.js +5 -0
- package/dist/HeroImage/index.js.map +1 -0
- package/dist/Icon/Icon.d.ts +14 -0
- package/dist/Icon/Icon.js +204 -0
- package/dist/Icon/Icon.js.map +1 -0
- package/dist/Icon/index.d.ts +3 -14
- package/dist/Icon/index.js +4 -2
- package/dist/Icon/index.js.map +1 -1
- package/dist/IconButton/IconButton.d.ts +17 -0
- package/dist/IconButton/IconButton.js +44 -0
- package/dist/IconButton/IconButton.js.map +1 -0
- package/dist/IconButton/index.d.ts +4 -0
- package/dist/IconButton/index.js +5 -0
- package/dist/IconButton/index.js.map +1 -0
- package/dist/{MovieCard.utils-D8i4d7qA.d.ts → Image/Image.d.ts} +1 -28
- package/dist/Image/Image.js +125 -0
- package/dist/Image/Image.js.map +1 -0
- package/dist/Image/index.d.ts +3 -0
- package/dist/Image/index.js +5 -0
- package/dist/Image/index.js.map +1 -0
- package/dist/Modal/Modal.d.ts +20 -0
- package/dist/Modal/Modal.js +55 -0
- package/dist/Modal/Modal.js.map +1 -0
- package/dist/Modal/index.d.ts +3 -0
- package/dist/Modal/index.js +5 -0
- package/dist/Modal/index.js.map +1 -0
- package/dist/MovieCard/MovieCard.utils.d.ts +34 -0
- package/dist/MovieCard/MovieCard.utils.js +20 -0
- package/dist/MovieCard/MovieCard.utils.js.map +1 -0
- package/dist/MovieCard/MovieCardContent.d.ts +18 -0
- package/dist/MovieCard/MovieCardContent.js +75 -0
- package/dist/MovieCard/MovieCardContent.js.map +1 -0
- package/dist/MovieCard/index.d.ts +6 -0
- package/dist/MovieCard/index.js +5 -0
- package/dist/MovieCard/index.js.map +1 -0
- package/dist/Rating/CircleRating.d.ts +20 -0
- package/dist/Rating/CircleRating.js +75 -0
- package/dist/Rating/CircleRating.js.map +1 -0
- package/dist/Rating/Rating.d.ts +23 -0
- package/dist/Rating/Rating.js +41 -0
- package/dist/Rating/Rating.js.map +1 -0
- package/dist/Rating/StarsRating.d.ts +18 -0
- package/dist/Rating/StarsRating.js +47 -0
- package/dist/Rating/StarsRating.js.map +1 -0
- package/dist/Rating/index.d.ts +2 -0
- package/dist/Rating/index.js +5 -0
- package/dist/Rating/index.js.map +1 -0
- package/dist/Skeleton/Skeleton.d.ts +23 -0
- package/dist/{chunk-FJZK3PY6.js → Skeleton/Skeleton.js} +6 -7
- package/dist/Skeleton/Skeleton.js.map +1 -0
- package/dist/Skeleton/index.d.ts +3 -0
- package/dist/Skeleton/index.js +5 -0
- package/dist/Skeleton/index.js.map +1 -0
- package/dist/Spinner/Spinner.d.ts +8 -0
- package/dist/Spinner/Spinner.js +20 -0
- package/dist/Spinner/Spinner.js.map +1 -0
- package/dist/Spinner/index.d.ts +2 -0
- package/dist/Spinner/index.js +5 -0
- package/dist/Spinner/index.js.map +1 -0
- package/dist/Tabs/Tabs.d.ts +34 -0
- package/dist/Tabs/Tabs.js +47 -0
- package/dist/Tabs/Tabs.js.map +1 -0
- package/dist/Tabs/TabsContext.d.ts +21 -0
- package/dist/Tabs/TabsContext.js +16 -0
- package/dist/Tabs/TabsContext.js.map +1 -0
- package/dist/Tabs/TabsList.d.ts +7 -0
- package/dist/Tabs/TabsList.js +51 -0
- package/dist/Tabs/TabsList.js.map +1 -0
- package/dist/Tabs/TabsListContext.d.ts +16 -0
- package/dist/Tabs/TabsListContext.js +16 -0
- package/dist/Tabs/TabsListContext.js.map +1 -0
- package/dist/Tabs/TabsPanel.d.ts +17 -0
- package/dist/Tabs/TabsPanel.js +26 -0
- package/dist/Tabs/TabsPanel.js.map +1 -0
- package/dist/Tabs/TabsTrigger.d.ts +12 -0
- package/dist/Tabs/TabsTrigger.js +124 -0
- package/dist/Tabs/TabsTrigger.js.map +1 -0
- package/dist/Tabs/index.d.ts +6 -0
- package/dist/Tabs/index.js +5 -0
- package/dist/Tabs/index.js.map +1 -0
- package/dist/Talent/Talent.d.ts +19 -0
- package/dist/Talent/Talent.js +69 -0
- package/dist/Talent/Talent.js.map +1 -0
- package/dist/Talent/index.d.ts +4 -0
- package/dist/Talent/index.js +5 -0
- package/dist/Talent/index.js.map +1 -0
- package/dist/TrailerCard/TrailerCard.d.ts +15 -0
- package/dist/TrailerCard/TrailerCard.js +86 -0
- package/dist/TrailerCard/TrailerCard.js.map +1 -0
- package/dist/TrailerCard/index.d.ts +2 -0
- package/dist/TrailerCard/index.js +5 -0
- package/dist/TrailerCard/index.js.map +1 -0
- package/dist/Typography/Typography.d.ts +17 -0
- package/dist/Typography/Typography.js +55 -0
- package/dist/Typography/Typography.js.map +1 -0
- package/dist/Typography/index.d.ts +2 -0
- package/dist/Typography/index.js +5 -0
- package/dist/Typography/index.js.map +1 -0
- package/dist/index.d.ts +31 -372
- package/dist/index.js +50 -1099
- package/dist/index.js.map +1 -1
- package/dist/next/Button/Button.d.ts +9 -0
- package/dist/{chunk-ZTQU4GMY.js → next/Button/Button.js} +13 -10
- package/dist/next/Button/Button.js.map +1 -0
- package/dist/next/Button/Button.types.d.ts +26 -0
- package/dist/next/Button/Button.types.js +1 -0
- package/dist/next/Button/Button.types.js.map +1 -0
- package/dist/next/Button/index.d.ts +6 -0
- package/dist/next/Button/index.js +5 -0
- package/dist/next/Button/index.js.map +1 -0
- package/dist/next/HeroImage/HeroImage.d.ts +11 -0
- package/dist/next/HeroImage/HeroImage.js +44 -0
- package/dist/next/HeroImage/HeroImage.js.map +1 -0
- package/dist/next/HeroImage/index.d.ts +2 -0
- package/dist/next/HeroImage/index.js +5 -0
- package/dist/next/HeroImage/index.js.map +1 -0
- package/dist/next/Image/NextImage.d.ts +8 -0
- package/dist/next/Image/NextImage.js +84 -0
- package/dist/next/Image/NextImage.js.map +1 -0
- package/dist/next/Image/NextImage.types.d.ts +13 -0
- package/dist/next/Image/NextImage.types.js +1 -0
- package/dist/next/Image/NextImage.types.js.map +1 -0
- package/dist/next/Image/index.d.ts +5 -0
- package/dist/next/Image/index.js +5 -0
- package/dist/next/Image/index.js.map +1 -0
- package/dist/next/MovieCard/MovieCard.d.ts +9 -0
- package/dist/next/MovieCard/MovieCard.js +44 -0
- package/dist/next/MovieCard/MovieCard.js.map +1 -0
- package/dist/next/MovieCard/MovieCard.types.d.ts +15 -0
- package/dist/next/MovieCard/MovieCard.types.js +1 -0
- package/dist/next/MovieCard/MovieCard.types.js.map +1 -0
- package/dist/next/MovieCard/MovieCardContent.d.ts +19 -0
- package/dist/next/MovieCard/MovieCardContent.js +79 -0
- package/dist/next/MovieCard/MovieCardContent.js.map +1 -0
- package/dist/next/MovieCard/index.d.ts +6 -0
- package/dist/next/MovieCard/index.js +5 -0
- package/dist/next/MovieCard/index.js.map +1 -0
- package/dist/next/index.d.ts +14 -60
- package/dist/next/index.js +10 -270
- package/dist/next/index.js.map +1 -1
- package/dist/react-router/Button/Button.d.ts +9 -0
- package/dist/react-router/Button/Button.js +52 -0
- package/dist/react-router/Button/Button.js.map +1 -0
- package/dist/react-router/Button/Button.types.d.ts +24 -0
- package/dist/react-router/Button/Button.types.js +1 -0
- package/dist/react-router/Button/Button.types.js.map +1 -0
- package/dist/react-router/Button/index.d.ts +6 -0
- package/dist/react-router/Button/index.js +5 -0
- package/dist/react-router/Button/index.js.map +1 -0
- package/dist/react-router/MovieCard/MovieCard.d.ts +9 -0
- package/dist/react-router/MovieCard/MovieCard.js +42 -0
- package/dist/react-router/MovieCard/MovieCard.js.map +1 -0
- package/dist/react-router/MovieCard/MovieCard.types.d.ts +15 -0
- package/dist/react-router/MovieCard/MovieCard.types.js +1 -0
- package/dist/react-router/MovieCard/MovieCard.types.js.map +1 -0
- package/dist/react-router/MovieCard/index.d.ts +6 -0
- package/dist/react-router/MovieCard/index.js +5 -0
- package/dist/react-router/MovieCard/index.js.map +1 -0
- package/dist/react-router/index.d.ts +8 -17
- package/dist/react-router/index.js +6 -7
- package/dist/react-router/index.js.map +1 -1
- package/dist/styles.css +2 -0
- package/package.json +4 -4
- package/dist/chunk-6DP3KZQG.js +0 -214
- package/dist/chunk-6DP3KZQG.js.map +0 -1
- package/dist/chunk-6FBMTGXQ.js +0 -119
- package/dist/chunk-6FBMTGXQ.js.map +0 -1
- package/dist/chunk-7IAJQE27.js +0 -228
- package/dist/chunk-7IAJQE27.js.map +0 -1
- package/dist/chunk-DGJI4VNO.js +0 -3
- package/dist/chunk-DGJI4VNO.js.map +0 -1
- package/dist/chunk-FJZK3PY6.js.map +0 -1
- package/dist/chunk-IUGKH376.js.map +0 -1
- package/dist/chunk-RZU2FFBW.js.map +0 -1
- package/dist/chunk-ZTQU4GMY.js.map +0 -1
- package/dist/index.css +0 -1313
- package/dist/index.css.map +0 -1
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import {
|
|
4
|
+
useCallback,
|
|
5
|
+
useEffect,
|
|
6
|
+
useLayoutEffect,
|
|
7
|
+
useRef,
|
|
8
|
+
useState
|
|
9
|
+
} from "react";
|
|
10
|
+
import CarouselCounter from "./CarouselCounter";
|
|
11
|
+
import CarouselError from "./CarouselError";
|
|
12
|
+
import CarouselNavigation from "./CarouselNavigation";
|
|
13
|
+
import CarouselPagination from "./CarouselPagination";
|
|
14
|
+
function Carousel({
|
|
15
|
+
children,
|
|
16
|
+
variant = "standard",
|
|
17
|
+
showPagination = true,
|
|
18
|
+
showArrows = true,
|
|
19
|
+
arrowPosition = "sides",
|
|
20
|
+
gap = 16,
|
|
21
|
+
className,
|
|
22
|
+
heroControlsClassName,
|
|
23
|
+
errorMessage,
|
|
24
|
+
rounded = true,
|
|
25
|
+
initialIndex,
|
|
26
|
+
onPrev,
|
|
27
|
+
onNext,
|
|
28
|
+
disableAnimation = false,
|
|
29
|
+
disableScroll = false
|
|
30
|
+
}) {
|
|
31
|
+
const scrollRef = useRef(null);
|
|
32
|
+
const [totalPositions, setTotalPositions] = useState(1);
|
|
33
|
+
const [scrollIndex, setScrollIndex] = useState(initialIndex ?? 0);
|
|
34
|
+
const currentIndex = disableScroll ? initialIndex ?? 0 : scrollIndex;
|
|
35
|
+
const isHero = variant === "hero";
|
|
36
|
+
const isLightbox = variant === "lightbox";
|
|
37
|
+
const isFullWidth = isHero || isLightbox;
|
|
38
|
+
const calculatePositions = useCallback(() => {
|
|
39
|
+
const container = scrollRef.current;
|
|
40
|
+
if (!container) return;
|
|
41
|
+
const items = container.children;
|
|
42
|
+
if (isFullWidth) {
|
|
43
|
+
setTotalPositions(items.length);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const firstItem = items[0];
|
|
47
|
+
if (!firstItem) {
|
|
48
|
+
setTotalPositions(1);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const itemWidth = firstItem.offsetWidth;
|
|
52
|
+
const maxScrollLeft = container.scrollWidth - container.offsetWidth;
|
|
53
|
+
if (maxScrollLeft <= 0) {
|
|
54
|
+
setTotalPositions(1);
|
|
55
|
+
} else if (itemWidth > 0) {
|
|
56
|
+
const positions = Math.round(maxScrollLeft / (itemWidth + gap)) + 1;
|
|
57
|
+
setTotalPositions(Math.max(1, positions));
|
|
58
|
+
}
|
|
59
|
+
}, [gap, isFullWidth]);
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
calculatePositions();
|
|
62
|
+
}, [children, calculatePositions]);
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
const container = scrollRef.current;
|
|
65
|
+
if (!container) return;
|
|
66
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
67
|
+
calculatePositions();
|
|
68
|
+
});
|
|
69
|
+
resizeObserver.observe(container);
|
|
70
|
+
return () => {
|
|
71
|
+
resizeObserver.disconnect();
|
|
72
|
+
};
|
|
73
|
+
}, [calculatePositions]);
|
|
74
|
+
const initialScrollRef = useRef({
|
|
75
|
+
index: initialIndex ?? 0,
|
|
76
|
+
isFullWidth,
|
|
77
|
+
gap
|
|
78
|
+
});
|
|
79
|
+
useLayoutEffect(() => {
|
|
80
|
+
const { index, isFullWidth: fw, gap: g } = initialScrollRef.current;
|
|
81
|
+
if (index <= 0) return;
|
|
82
|
+
const container = scrollRef.current;
|
|
83
|
+
if (!container) return;
|
|
84
|
+
const firstItem = container.children[0];
|
|
85
|
+
const itemWidth = fw ? container.offsetWidth : firstItem?.offsetWidth ?? 0;
|
|
86
|
+
container.style.scrollBehavior = "auto";
|
|
87
|
+
container.scrollLeft = index * (itemWidth + (fw ? 0 : g));
|
|
88
|
+
container.style.scrollBehavior = "";
|
|
89
|
+
}, []);
|
|
90
|
+
const handleScroll = useCallback(() => {
|
|
91
|
+
const container = scrollRef.current;
|
|
92
|
+
if (!container) return;
|
|
93
|
+
const scrollLeft = container.scrollLeft;
|
|
94
|
+
const firstItem = container.children[0];
|
|
95
|
+
const itemWidth = isFullWidth ? container.offsetWidth : firstItem?.offsetWidth ?? 0;
|
|
96
|
+
if (itemWidth > 0) {
|
|
97
|
+
const index = Math.round(scrollLeft / (itemWidth + gap));
|
|
98
|
+
setScrollIndex(Math.min(index, totalPositions - 1));
|
|
99
|
+
}
|
|
100
|
+
}, [gap, isFullWidth, totalPositions]);
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
if (disableScroll) return;
|
|
103
|
+
const container = scrollRef.current;
|
|
104
|
+
if (!container) return;
|
|
105
|
+
container.addEventListener("scroll", handleScroll);
|
|
106
|
+
return () => {
|
|
107
|
+
container.removeEventListener("scroll", handleScroll);
|
|
108
|
+
};
|
|
109
|
+
}, [disableScroll, handleScroll]);
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
if (!disableScroll) return;
|
|
112
|
+
const container = scrollRef.current;
|
|
113
|
+
if (!container) return;
|
|
114
|
+
const preventScroll = (e) => {
|
|
115
|
+
e.preventDefault();
|
|
116
|
+
};
|
|
117
|
+
container.addEventListener("wheel", preventScroll, { passive: false });
|
|
118
|
+
return () => {
|
|
119
|
+
container.removeEventListener("wheel", preventScroll);
|
|
120
|
+
};
|
|
121
|
+
}, [disableScroll]);
|
|
122
|
+
const scrollTo = useCallback(
|
|
123
|
+
(index) => {
|
|
124
|
+
const container = scrollRef.current;
|
|
125
|
+
if (!container) return;
|
|
126
|
+
const firstItem = container.children[0];
|
|
127
|
+
const itemWidth = isFullWidth ? container.offsetWidth : firstItem?.offsetWidth ?? 0;
|
|
128
|
+
const isLastPosition = index === totalPositions - 1;
|
|
129
|
+
const scrollLeft = isLastPosition ? container.scrollWidth - container.offsetWidth : index * (itemWidth + gap);
|
|
130
|
+
container.scrollTo({
|
|
131
|
+
left: scrollLeft,
|
|
132
|
+
behavior: disableAnimation ? "auto" : "smooth"
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
[gap, isFullWidth, totalPositions, disableAnimation]
|
|
136
|
+
);
|
|
137
|
+
const scrollPrev = useCallback(() => {
|
|
138
|
+
if (currentIndex > 0) {
|
|
139
|
+
scrollTo(currentIndex - 1);
|
|
140
|
+
}
|
|
141
|
+
}, [currentIndex, scrollTo]);
|
|
142
|
+
const scrollNext = useCallback(() => {
|
|
143
|
+
if (currentIndex < totalPositions - 1) {
|
|
144
|
+
scrollTo(currentIndex + 1);
|
|
145
|
+
}
|
|
146
|
+
}, [currentIndex, totalPositions, scrollTo]);
|
|
147
|
+
const handlePrev = onPrev ?? scrollPrev;
|
|
148
|
+
const handleNext = onNext ?? scrollNext;
|
|
149
|
+
const handlePrevRef = useRef(handlePrev);
|
|
150
|
+
const handleNextRef = useRef(handleNext);
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
handlePrevRef.current = handlePrev;
|
|
153
|
+
handleNextRef.current = handleNext;
|
|
154
|
+
});
|
|
155
|
+
useEffect(() => {
|
|
156
|
+
const handleKeyDown = (e) => {
|
|
157
|
+
if (e.key === "ArrowLeft") handlePrevRef.current();
|
|
158
|
+
if (e.key === "ArrowRight") handleNextRef.current();
|
|
159
|
+
};
|
|
160
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
161
|
+
return () => {
|
|
162
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
163
|
+
};
|
|
164
|
+
}, []);
|
|
165
|
+
if (errorMessage) {
|
|
166
|
+
return /* @__PURE__ */ jsx(CarouselError, { message: errorMessage });
|
|
167
|
+
}
|
|
168
|
+
const canScrollPrev = currentIndex > 0;
|
|
169
|
+
const canScrollNext = currentIndex < totalPositions - 1;
|
|
170
|
+
const showControls = totalPositions > 1;
|
|
171
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx("ui:relative", isLightbox && "ui:h-full", className), children: [
|
|
172
|
+
/* @__PURE__ */ jsx(
|
|
173
|
+
"div",
|
|
174
|
+
{
|
|
175
|
+
ref: scrollRef,
|
|
176
|
+
className: clsx(
|
|
177
|
+
"ui:flex ui:overflow-x-auto ui:scroll-smooth ui:scrollbar-none",
|
|
178
|
+
isFullWidth && "ui:snap-x ui:snap-mandatory",
|
|
179
|
+
isLightbox && "ui:h-full",
|
|
180
|
+
rounded && "ui:rounded-lg ui:overflow-hidden"
|
|
181
|
+
),
|
|
182
|
+
style: { gap: `${String(gap)}px` },
|
|
183
|
+
children
|
|
184
|
+
}
|
|
185
|
+
),
|
|
186
|
+
showControls && showArrows && arrowPosition === "sides" && !isHero && !isLightbox && /* @__PURE__ */ jsx(
|
|
187
|
+
CarouselNavigation,
|
|
188
|
+
{
|
|
189
|
+
onPrev: handlePrev,
|
|
190
|
+
onNext: handleNext,
|
|
191
|
+
canPrev: canScrollPrev,
|
|
192
|
+
canNext: canScrollNext,
|
|
193
|
+
size: "md",
|
|
194
|
+
position: "sides"
|
|
195
|
+
}
|
|
196
|
+
),
|
|
197
|
+
showControls && isHero && (showPagination || showArrows) && /* @__PURE__ */ jsxs(
|
|
198
|
+
"div",
|
|
199
|
+
{
|
|
200
|
+
className: clsx(
|
|
201
|
+
"ui:absolute ui:bottom-4 ui:left-1/2 ui:-translate-x-1/2 ui:w-full ui:z-10 ui:flex ui:items-end",
|
|
202
|
+
heroControlsClassName
|
|
203
|
+
),
|
|
204
|
+
children: [
|
|
205
|
+
/* @__PURE__ */ jsx("div", { className: "ui:flex-1" }),
|
|
206
|
+
showPagination && /* @__PURE__ */ jsx(
|
|
207
|
+
CarouselPagination,
|
|
208
|
+
{
|
|
209
|
+
total: totalPositions,
|
|
210
|
+
current: currentIndex,
|
|
211
|
+
light: true
|
|
212
|
+
}
|
|
213
|
+
),
|
|
214
|
+
/* @__PURE__ */ jsx("div", { className: "ui:flex-1 ui:flex ui:justify-end", children: showArrows && /* @__PURE__ */ jsx(
|
|
215
|
+
CarouselNavigation,
|
|
216
|
+
{
|
|
217
|
+
onPrev: handlePrev,
|
|
218
|
+
onNext: handleNext,
|
|
219
|
+
canPrev: canScrollPrev,
|
|
220
|
+
canNext: canScrollNext,
|
|
221
|
+
size: "sm"
|
|
222
|
+
}
|
|
223
|
+
) })
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
),
|
|
227
|
+
showControls && !isHero && !isLightbox && (showArrows && arrowPosition === "bottom-right" || showPagination) ? /* @__PURE__ */ jsxs(
|
|
228
|
+
"div",
|
|
229
|
+
{
|
|
230
|
+
className: clsx(
|
|
231
|
+
"ui:mt-4 ui:flex ui:items-center",
|
|
232
|
+
arrowPosition === "bottom-right" ? "ui:justify-end ui:gap-4" : "ui:justify-center"
|
|
233
|
+
),
|
|
234
|
+
children: [
|
|
235
|
+
showPagination && /* @__PURE__ */ jsx(CarouselPagination, { total: totalPositions, current: currentIndex }),
|
|
236
|
+
showArrows && arrowPosition === "bottom-right" && /* @__PURE__ */ jsx(
|
|
237
|
+
CarouselNavigation,
|
|
238
|
+
{
|
|
239
|
+
onPrev: handlePrev,
|
|
240
|
+
onNext: handleNext,
|
|
241
|
+
canPrev: canScrollPrev,
|
|
242
|
+
canNext: canScrollNext,
|
|
243
|
+
size: "sm"
|
|
244
|
+
}
|
|
245
|
+
)
|
|
246
|
+
]
|
|
247
|
+
}
|
|
248
|
+
) : null,
|
|
249
|
+
showControls && isLightbox && /* @__PURE__ */ jsx("div", { className: "ui:absolute ui:top-4 ui:right-4 ui:z-10", children: /* @__PURE__ */ jsx(CarouselCounter, { current: currentIndex, total: totalPositions }) }),
|
|
250
|
+
showControls && isLightbox && showArrows && /* @__PURE__ */ jsx(
|
|
251
|
+
CarouselNavigation,
|
|
252
|
+
{
|
|
253
|
+
onPrev: handlePrev,
|
|
254
|
+
onNext: handleNext,
|
|
255
|
+
canPrev: canScrollPrev,
|
|
256
|
+
canNext: canScrollNext,
|
|
257
|
+
size: "md",
|
|
258
|
+
position: "sides-inset",
|
|
259
|
+
iconVariant: "ghost"
|
|
260
|
+
}
|
|
261
|
+
)
|
|
262
|
+
] });
|
|
263
|
+
}
|
|
264
|
+
var Carousel_default = Carousel;
|
|
265
|
+
export {
|
|
266
|
+
Carousel_default as default
|
|
267
|
+
};
|
|
268
|
+
//# sourceMappingURL=Carousel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Carousel/Carousel.tsx"],"sourcesContent":["import clsx from 'clsx'\nimport {\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react'\n\nimport CarouselCounter from './CarouselCounter'\nimport CarouselError from './CarouselError'\nimport CarouselNavigation from './CarouselNavigation'\nimport CarouselPagination from './CarouselPagination'\n\nimport type { ReactNode } from 'react'\n\n/** Carousel visual variant */\nexport type CarouselVariant = 'standard' | 'hero' | 'lightbox'\n\n/** Arrow position for navigation buttons */\nexport type CarouselArrowPosition = 'sides' | 'bottom-right'\n\nexport interface CarouselProps {\n /** Carousel items */\n children?: ReactNode\n /** Visual variant */\n variant?: CarouselVariant\n /** Show pagination dots (ignored for lightbox — counter is shown instead) */\n showPagination?: boolean\n /** Show navigation arrows */\n showArrows?: boolean\n /** Arrow position */\n arrowPosition?: CarouselArrowPosition\n /** Gap between items in pixels */\n gap?: number\n /** Additional class name */\n className?: string\n /** Class name for the hero controls container (pagination + arrows) — use to constrain width/padding */\n heroControlsClassName?: string\n /** Error message to display instead of carousel content */\n errorMessage?: string\n /** Apply rounded corners to viewport */\n rounded?: boolean\n /**\n * Initial scroll index — jumps to this item on mount without animation.\n * Use with key={index} on Carousel for URL-based navigation (lightbox).\n */\n initialIndex?: number\n /**\n * Override internal prev navigation (e.g. navigate to previous URL in lightbox).\n * When provided, replaces internal scrollPrev.\n */\n onPrev?: () => void\n /**\n * Override internal next navigation (e.g. navigate to next URL in lightbox).\n * When provided, replaces internal scrollNext.\n */\n onNext?: () => void\n /**\n * When true, all internal scroll transitions are instant (no smooth animation).\n * Use for lightbox with URL-based navigation where the Carousel remounts each time.\n */\n disableAnimation?: boolean\n /**\n * When true, user-initiated wheel/trackpad scroll is blocked on the container,\n * and currentIndex is driven entirely by initialIndex (no scroll tracking).\n * Use for URL-driven carousels (lightbox) to avoid scroll/resize desync.\n */\n disableScroll?: boolean\n}\n\n/**\n * Carousel component with horizontal scroll, pagination, and navigation.\n * Supports three variants:\n * - standard: multi-items horizontal scroll\n * - hero: single panoramic item with snap\n * - lightbox: single item per view, ghost arrows, counter (for PhotoViewer)\n */\nfunction Carousel({\n children,\n variant = 'standard',\n showPagination = true,\n showArrows = true,\n arrowPosition = 'sides',\n gap = 16,\n className,\n heroControlsClassName,\n errorMessage,\n rounded = true,\n initialIndex,\n onPrev,\n onNext,\n disableAnimation = false,\n disableScroll = false,\n}: Readonly<CarouselProps>) {\n const scrollRef = useRef<HTMLDivElement>(null)\n const [totalPositions, setTotalPositions] = useState(1)\n\n /**\n * Internal scroll-tracked index — updated by handleScroll on every scroll event.\n * Only used when disableScroll=false (scroll-driven mode).\n */\n const [scrollIndex, setScrollIndex] = useState(initialIndex ?? 0)\n\n /**\n * Effective current index.\n * - disableScroll=true → driven by initialIndex prop (URL-driven, no scroll tracking)\n * - disableScroll=false → driven by scroll events via scrollIndex state\n * This separation prevents ResizeObserver/snap drift from corrupting the index\n * in URL-driven carousels (lightbox).\n */\n const currentIndex = disableScroll ? (initialIndex ?? 0) : scrollIndex\n\n const isHero = variant === 'hero'\n const isLightbox = variant === 'lightbox'\n /** Hero and lightbox both use container width for per-item scroll calculation */\n const isFullWidth = isHero || isLightbox\n\n /**\n * Calculates the total number of scroll positions based on container and item dimensions.\n * For hero/lightbox: positions = number of items (one per slide).\n * For standard: positions = ceil(maxScrollLeft / itemWidth) + 1.\n */\n const calculatePositions = useCallback(() => {\n const container = scrollRef.current\n if (!container) return\n\n const items = container.children\n\n if (isFullWidth) {\n setTotalPositions(items.length)\n return\n }\n\n const firstItem = items[0] as HTMLElement | undefined\n if (!firstItem) {\n setTotalPositions(1)\n return\n }\n\n const itemWidth = firstItem.offsetWidth\n const maxScrollLeft = container.scrollWidth - container.offsetWidth\n\n if (maxScrollLeft <= 0) {\n setTotalPositions(1)\n } else if (itemWidth > 0) {\n const positions = Math.round(maxScrollLeft / (itemWidth + gap)) + 1\n setTotalPositions(Math.max(1, positions))\n }\n }, [gap, isFullWidth])\n\n /**\n * Effect: Recalculates positions when children or calculatePositions function changes.\n */\n useEffect(() => {\n calculatePositions()\n }, [children, calculatePositions])\n\n /**\n * Effect: Sets up ResizeObserver to recalculate positions on viewport/container resize.\n */\n useEffect(() => {\n const container = scrollRef.current\n if (!container) return\n\n const resizeObserver = new ResizeObserver(() => {\n calculatePositions()\n })\n\n resizeObserver.observe(container)\n return () => {\n resizeObserver.disconnect()\n }\n }, [calculatePositions])\n\n /**\n * Effect: Jumps to initialIndex on mount (no animation).\n * Consumed by lightbox via key={index} remounting — refs avoid stale closure.\n */\n const initialScrollRef = useRef({\n index: initialIndex ?? 0,\n isFullWidth,\n gap,\n })\n\n useLayoutEffect(() => {\n const { index, isFullWidth: fw, gap: g } = initialScrollRef.current\n if (index <= 0) return\n const container = scrollRef.current\n if (!container) return\n const firstItem = container.children[0] as HTMLElement | undefined\n const itemWidth = fw ? container.offsetWidth : (firstItem?.offsetWidth ?? 0)\n // Override CSS scroll-behavior: smooth — jump must be instant before first paint\n container.style.scrollBehavior = 'auto'\n container.scrollLeft = index * (itemWidth + (fw ? 0 : g))\n container.style.scrollBehavior = ''\n }, [])\n\n /**\n * Effect: Tracks scroll position to update currentIndex.\n * Skipped entirely when disableScroll=true (currentIndex comes from initialIndex).\n */\n const handleScroll = useCallback(() => {\n const container = scrollRef.current\n if (!container) return\n\n const scrollLeft = container.scrollLeft\n const firstItem = container.children[0] as HTMLElement | undefined\n const itemWidth = isFullWidth\n ? container.offsetWidth\n : (firstItem?.offsetWidth ?? 0)\n\n if (itemWidth > 0) {\n const index = Math.round(scrollLeft / (itemWidth + gap))\n setScrollIndex(Math.min(index, totalPositions - 1))\n }\n }, [gap, isFullWidth, totalPositions])\n\n /**\n * Effect: Attaches scroll listener to update scrollIndex.\n * Skipped when disableScroll=true — currentIndex is driven by initialIndex prop instead.\n */\n useEffect(() => {\n if (disableScroll) return\n const container = scrollRef.current\n if (!container) return\n\n container.addEventListener('scroll', handleScroll)\n return () => {\n container.removeEventListener('scroll', handleScroll)\n }\n }, [disableScroll, handleScroll])\n\n /**\n * Effect: Blocks wheel/trackpad scroll when disableScroll=true.\n * Uses preventDefault on wheel events — must be non-passive to work.\n */\n useEffect(() => {\n if (!disableScroll) return\n const container = scrollRef.current\n if (!container) return\n\n const preventScroll = (e: WheelEvent) => {\n e.preventDefault()\n }\n\n container.addEventListener('wheel', preventScroll, { passive: false })\n return () => {\n container.removeEventListener('wheel', preventScroll)\n }\n }, [disableScroll])\n\n /**\n * Scrolls to a specific position index with smooth animation.\n */\n const scrollTo = useCallback(\n (index: number) => {\n const container = scrollRef.current\n if (!container) return\n\n const firstItem = container.children[0] as HTMLElement | undefined\n const itemWidth = isFullWidth\n ? container.offsetWidth\n : (firstItem?.offsetWidth ?? 0)\n\n const isLastPosition = index === totalPositions - 1\n const scrollLeft = isLastPosition\n ? container.scrollWidth - container.offsetWidth\n : index * (itemWidth + gap)\n\n container.scrollTo({\n left: scrollLeft,\n behavior: disableAnimation ? 'auto' : 'smooth',\n })\n },\n [gap, isFullWidth, totalPositions, disableAnimation]\n )\n\n /** Scrolls to the previous position (internal fallback when onPrev is not provided) */\n const scrollPrev = useCallback(() => {\n if (currentIndex > 0) {\n scrollTo(currentIndex - 1)\n }\n }, [currentIndex, scrollTo])\n\n /** Scrolls to the next position (internal fallback when onNext is not provided) */\n const scrollNext = useCallback(() => {\n if (currentIndex < totalPositions - 1) {\n scrollTo(currentIndex + 1)\n }\n }, [currentIndex, totalPositions, scrollTo])\n\n /** Effective prev handler: external callback takes priority over internal scroll */\n const handlePrev = onPrev ?? scrollPrev\n /** Effective next handler: external callback takes priority over internal scroll */\n const handleNext = onNext ?? scrollNext\n\n /**\n * Refs that always point to the latest handlePrev/handleNext.\n * Allows the keyboard effect to use a stable listener (empty deps) without stale closures.\n */\n const handlePrevRef = useRef(handlePrev)\n const handleNextRef = useRef(handleNext)\n useEffect(() => {\n handlePrevRef.current = handlePrev\n handleNextRef.current = handleNext\n })\n\n /**\n * Effect: Keyboard navigation — ArrowLeft/ArrowRight trigger prev/next.\n * Listens on document so it works in lightbox (fullscreen) without requiring focus.\n */\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'ArrowLeft') handlePrevRef.current()\n if (e.key === 'ArrowRight') handleNextRef.current()\n }\n document.addEventListener('keydown', handleKeyDown)\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n }\n }, [])\n\n if (errorMessage) {\n return <CarouselError message={errorMessage} />\n }\n\n const canScrollPrev = currentIndex > 0\n const canScrollNext = currentIndex < totalPositions - 1\n const showControls = totalPositions > 1\n\n return (\n <div className={clsx('ui:relative', isLightbox && 'ui:h-full', className)}>\n {/* Scroll container */}\n <div\n ref={scrollRef}\n className={clsx(\n 'ui:flex ui:overflow-x-auto ui:scroll-smooth ui:scrollbar-none',\n isFullWidth && 'ui:snap-x ui:snap-mandatory',\n isLightbox && 'ui:h-full',\n rounded && 'ui:rounded-lg ui:overflow-hidden'\n )}\n style={{ gap: `${String(gap)}px` }}\n >\n {children}\n </div>\n\n {/* Standard: Arrows on sides */}\n {showControls &&\n showArrows &&\n arrowPosition === 'sides' &&\n !isHero &&\n !isLightbox && (\n <CarouselNavigation\n onPrev={handlePrev}\n onNext={handleNext}\n canPrev={canScrollPrev}\n canNext={canScrollNext}\n size=\"md\"\n position=\"sides\"\n />\n )}\n\n {/* Hero: single container — pagination centered, arrows right-aligned */}\n {showControls && isHero && (showPagination || showArrows) && (\n <div\n className={clsx(\n 'ui:absolute ui:bottom-4 ui:left-1/2 ui:-translate-x-1/2 ui:w-full ui:z-10 ui:flex ui:items-end',\n heroControlsClassName\n )}\n >\n <div className=\"ui:flex-1\" />\n {showPagination && (\n <CarouselPagination\n total={totalPositions}\n current={currentIndex}\n light\n />\n )}\n <div className=\"ui:flex-1 ui:flex ui:justify-end\">\n {showArrows && (\n <CarouselNavigation\n onPrev={handlePrev}\n onNext={handleNext}\n canPrev={canScrollPrev}\n canNext={canScrollNext}\n size=\"sm\"\n />\n )}\n </div>\n </div>\n )}\n\n {/* Standard: Pagination + Arrows below */}\n {showControls &&\n !isHero &&\n !isLightbox &&\n ((showArrows && arrowPosition === 'bottom-right') || showPagination) ? (\n <div\n className={clsx(\n 'ui:mt-4 ui:flex ui:items-center',\n arrowPosition === 'bottom-right'\n ? 'ui:justify-end ui:gap-4'\n : 'ui:justify-center'\n )}\n >\n {showPagination && (\n <CarouselPagination total={totalPositions} current={currentIndex} />\n )}\n {showArrows && arrowPosition === 'bottom-right' && (\n <CarouselNavigation\n onPrev={handlePrev}\n onNext={handleNext}\n canPrev={canScrollPrev}\n canNext={canScrollNext}\n size=\"sm\"\n />\n )}\n </div>\n ) : null}\n\n {/* Lightbox: Counter top-right, ghost arrows on sides */}\n {showControls && isLightbox && (\n <div className=\"ui:absolute ui:top-4 ui:right-4 ui:z-10\">\n <CarouselCounter current={currentIndex} total={totalPositions} />\n </div>\n )}\n {showControls && isLightbox && showArrows && (\n <CarouselNavigation\n onPrev={handlePrev}\n onNext={handleNext}\n canPrev={canScrollPrev}\n canNext={canScrollNext}\n size=\"md\"\n position=\"sides-inset\"\n iconVariant=\"ghost\"\n />\n )}\n </div>\n )\n}\n\nexport default Carousel\n"],"mappings":"AAoUW,cAyCH,YAzCG;AApUX,OAAO,UAAU;AACjB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,OAAO,qBAAqB;AAC5B,OAAO,mBAAmB;AAC1B,OAAO,wBAAwB;AAC/B,OAAO,wBAAwB;AAkE/B,SAAS,SAAS;AAAA,EAChB;AAAA,EACA,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,mBAAmB;AAAA,EACnB,gBAAgB;AAClB,GAA4B;AAC1B,QAAM,YAAY,OAAuB,IAAI;AAC7C,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAS,CAAC;AAMtD,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,gBAAgB,CAAC;AAShE,QAAM,eAAe,gBAAiB,gBAAgB,IAAK;AAE3D,QAAM,SAAS,YAAY;AAC3B,QAAM,aAAa,YAAY;AAE/B,QAAM,cAAc,UAAU;AAO9B,QAAM,qBAAqB,YAAY,MAAM;AAC3C,UAAM,YAAY,UAAU;AAC5B,QAAI,CAAC,UAAW;AAEhB,UAAM,QAAQ,UAAU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;AAAA,IAED,gBAAgB,cAAc,cAC7B;AAAA,MAAC;AAAA;AAAA,QACC,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,SAAS;AAAA,QACT,MAAK;AAAA,QACL,UAAS;AAAA,QACT,aAAY;AAAA;AAAA,IACd;AAAA,KAEJ;AAEJ;AAEA,IAAO,mBAAQ;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface CarouselCounterProps {
|
|
4
|
+
/** Current index (0-based) — displayed as 1-based */
|
|
5
|
+
current: number;
|
|
6
|
+
/** Total number of items */
|
|
7
|
+
total: number;
|
|
8
|
+
/** Additional class name */
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Counter for Carousel lightbox variant.
|
|
13
|
+
* Displays current position as "3 / 20" (1-indexed).
|
|
14
|
+
*/
|
|
15
|
+
declare function CarouselCounter({ current, total, className, }: Readonly<CarouselCounterProps>): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { type CarouselCounterProps, CarouselCounter as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
function CarouselCounter({
|
|
4
|
+
current,
|
|
5
|
+
total,
|
|
6
|
+
className
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ jsxs(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
className: clsx(
|
|
12
|
+
"ui:bg-black/50 ui:rounded-full ui:px-3 ui:py-1",
|
|
13
|
+
"ui:text-white/90 ui:text-sm ui:font-medium ui:tabular-nums",
|
|
14
|
+
className
|
|
15
|
+
),
|
|
16
|
+
children: [
|
|
17
|
+
current + 1,
|
|
18
|
+
" / ",
|
|
19
|
+
total
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
var CarouselCounter_default = CarouselCounter;
|
|
25
|
+
export {
|
|
26
|
+
CarouselCounter_default as default
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=CarouselCounter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Carousel/CarouselCounter.tsx"],"sourcesContent":["import clsx from 'clsx'\n\nexport interface CarouselCounterProps {\n /** Current index (0-based) — displayed as 1-based */\n current: number\n /** Total number of items */\n total: number\n /** Additional class name */\n className?: string\n}\n\n/**\n * Counter for Carousel lightbox variant.\n * Displays current position as \"3 / 20\" (1-indexed).\n */\nfunction CarouselCounter({\n current,\n total,\n className,\n}: Readonly<CarouselCounterProps>) {\n return (\n <div\n className={clsx(\n 'ui:bg-black/50 ui:rounded-full ui:px-3 ui:py-1',\n 'ui:text-white/90 ui:text-sm ui:font-medium ui:tabular-nums',\n className\n )}\n >\n {current + 1} / {total}\n </div>\n )\n}\n\nexport default CarouselCounter\n"],"mappings":"AAqBI;AArBJ,OAAO,UAAU;AAejB,SAAS,gBAAgB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACF,GAAmC;AACjC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MAEC;AAAA,kBAAU;AAAA,QAAE;AAAA,QAAI;AAAA;AAAA;AAAA,EACnB;AAEJ;AAEA,IAAO,0BAAQ;","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface CarouselErrorProps {
|
|
4
|
+
message?: string;
|
|
5
|
+
}
|
|
6
|
+
declare function CarouselError({ message, }: Readonly<CarouselErrorProps>): react_jsx_runtime.JSX.Element;
|
|
7
|
+
|
|
8
|
+
export { type CarouselErrorProps, CarouselError as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Icon } from "../Icon";
|
|
3
|
+
function CarouselError({
|
|
4
|
+
message = "Failed to load data"
|
|
5
|
+
}) {
|
|
6
|
+
return /* @__PURE__ */ jsxs("div", { className: "ui:flex ui:flex-col ui:items-center ui:justify-center ui:gap-3 ui:rounded-lg ui:border ui:border-red-200 ui:bg-red-50 ui:p-8 ui:text-center", children: [
|
|
7
|
+
/* @__PURE__ */ jsx(Icon, { name: "ExclamationTriangle", size: 48, className: "ui:text-red-500" }),
|
|
8
|
+
/* @__PURE__ */ jsxs("div", { className: "ui:flex ui:flex-col ui:gap-1", children: [
|
|
9
|
+
/* @__PURE__ */ jsx("p", { className: "ui:text-sm ui:font-semibold ui:text-red-900", children: "Failed to fetch data" }),
|
|
10
|
+
/* @__PURE__ */ jsx("p", { className: "ui:text-sm ui:text-red-700", children: message })
|
|
11
|
+
] })
|
|
12
|
+
] });
|
|
13
|
+
}
|
|
14
|
+
var CarouselError_default = CarouselError;
|
|
15
|
+
export {
|
|
16
|
+
CarouselError_default as default
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=CarouselError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Carousel/CarouselError.tsx"],"sourcesContent":["import { Icon } from '../Icon'\n\nexport interface CarouselErrorProps {\n message?: string\n}\n\nfunction CarouselError({\n message = 'Failed to load data',\n}: Readonly<CarouselErrorProps>) {\n return (\n <div className=\"ui:flex ui:flex-col ui:items-center ui:justify-center ui:gap-3 ui:rounded-lg ui:border ui:border-red-200 ui:bg-red-50 ui:p-8 ui:text-center\">\n <Icon name=\"ExclamationTriangle\" size={48} className=\"ui:text-red-500\" />\n <div className=\"ui:flex ui:flex-col ui:gap-1\">\n <p className=\"ui:text-sm ui:font-semibold ui:text-red-900\">\n Failed to fetch data\n </p>\n <p className=\"ui:text-sm ui:text-red-700\">{message}</p>\n </div>\n </div>\n )\n}\n\nexport default CarouselError\n"],"mappings":"AAWM,cACA,YADA;AAXN,SAAS,YAAY;AAMrB,SAAS,cAAc;AAAA,EACrB,UAAU;AACZ,GAAiC;AAC/B,SACE,qBAAC,SAAI,WAAU,+IACb;AAAA,wBAAC,QAAK,MAAK,uBAAsB,MAAM,IAAI,WAAU,mBAAkB;AAAA,IACvE,qBAAC,SAAI,WAAU,gCACb;AAAA,0BAAC,OAAE,WAAU,+CAA8C,kCAE3D;AAAA,MACA,oBAAC,OAAE,WAAU,8BAA8B,mBAAQ;AAAA,OACrD;AAAA,KACF;AAEJ;AAEA,IAAO,wBAAQ;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
interface CarouselItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/** Whether this is a hero item (full width with snap) */
|
|
6
|
+
isHero?: boolean;
|
|
7
|
+
/** Whether this is a lightbox item (full width with snap, same layout as hero) */
|
|
8
|
+
isLightbox?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Wrapper for individual carousel items.
|
|
12
|
+
* For hero and lightbox variants, items take full width and snap to center.
|
|
13
|
+
*/
|
|
14
|
+
declare function CarouselItem({ children, isHero, isLightbox, className, ...rest }: Readonly<CarouselItemProps>): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { type CarouselItemProps, CarouselItem as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
function CarouselItem({
|
|
4
|
+
children,
|
|
5
|
+
isHero = false,
|
|
6
|
+
isLightbox = false,
|
|
7
|
+
className,
|
|
8
|
+
...rest
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
className: clsx(
|
|
14
|
+
"ui:flex-shrink-0",
|
|
15
|
+
(isHero || isLightbox) && "ui:w-full ui:snap-center",
|
|
16
|
+
isLightbox && "ui:flex ui:items-center ui:justify-center ui:h-full",
|
|
17
|
+
className
|
|
18
|
+
),
|
|
19
|
+
...rest,
|
|
20
|
+
children
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
var CarouselItem_default = CarouselItem;
|
|
25
|
+
export {
|
|
26
|
+
CarouselItem_default as default
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=CarouselItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Carousel/CarouselItem.tsx"],"sourcesContent":["import clsx from 'clsx'\n\nimport type { HTMLAttributes } from 'react'\n\nexport interface CarouselItemProps extends HTMLAttributes<HTMLDivElement> {\n /** Whether this is a hero item (full width with snap) */\n isHero?: boolean\n /** Whether this is a lightbox item (full width with snap, same layout as hero) */\n isLightbox?: boolean\n}\n\n/**\n * Wrapper for individual carousel items.\n * For hero and lightbox variants, items take full width and snap to center.\n */\nfunction CarouselItem({\n children,\n isHero = false,\n isLightbox = false,\n className,\n ...rest\n}: Readonly<CarouselItemProps>) {\n return (\n <div\n className={clsx(\n 'ui:flex-shrink-0',\n (isHero || isLightbox) && 'ui:w-full ui:snap-center',\n isLightbox && 'ui:flex ui:items-center ui:justify-center ui:h-full',\n className\n )}\n {...rest}\n >\n {children}\n </div>\n )\n}\n\nexport default CarouselItem\n"],"mappings":"AAuBI;AAvBJ,OAAO,UAAU;AAejB,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AAAA,EACb;AAAA,EACA,GAAG;AACL,GAAgC;AAC9B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,SACC,UAAU,eAAe;AAAA,QAC1B,cAAc;AAAA,QACd;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,uBAAQ;","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface CarouselLoadingProps {
|
|
4
|
+
/** Number of skeleton cards to display */
|
|
5
|
+
count?: number;
|
|
6
|
+
/** Width of each card in pixels */
|
|
7
|
+
cardWidth?: number;
|
|
8
|
+
/** Height of each card in pixels */
|
|
9
|
+
cardHeight?: number;
|
|
10
|
+
/** Show skeleton for title */
|
|
11
|
+
showTitle?: boolean;
|
|
12
|
+
/** Show skeleton for subtitle/date */
|
|
13
|
+
showSubtitle?: boolean;
|
|
14
|
+
/** Apply rounded corners to skeleton */
|
|
15
|
+
rounded?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* CarouselLoading - Loading state for carousel with skeleton cards
|
|
19
|
+
*
|
|
20
|
+
* Displays a horizontal scrollable list of skeleton placeholders
|
|
21
|
+
* matching the structure of MovieCard components.
|
|
22
|
+
*/
|
|
23
|
+
declare function CarouselLoading({ count, cardWidth, cardHeight, showTitle, showSubtitle, rounded, }: Readonly<CarouselLoadingProps>): react_jsx_runtime.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { type CarouselLoadingProps, CarouselLoading as default };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Skeleton from "../Skeleton/Skeleton";
|
|
3
|
+
function CarouselLoading({
|
|
4
|
+
count = 6,
|
|
5
|
+
cardWidth = 150,
|
|
6
|
+
cardHeight = 225,
|
|
7
|
+
showTitle = true,
|
|
8
|
+
showSubtitle = true,
|
|
9
|
+
rounded = true
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ jsx("div", { className: "ui:overflow-x-auto ui:flex ui:gap-4", children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsxs(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
style: { width: cardWidth, minWidth: cardWidth, maxWidth: cardWidth },
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ jsx("div", { style: { width: cardWidth, height: cardHeight }, children: /* @__PURE__ */ jsx(
|
|
17
|
+
Skeleton,
|
|
18
|
+
{
|
|
19
|
+
variant: "rectangle",
|
|
20
|
+
width: "ui:w-full",
|
|
21
|
+
height: "ui:h-full",
|
|
22
|
+
rounded
|
|
23
|
+
}
|
|
24
|
+
) }),
|
|
25
|
+
(showTitle || showSubtitle) && /* @__PURE__ */ jsxs(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
style: {
|
|
29
|
+
marginTop: 8,
|
|
30
|
+
display: "flex",
|
|
31
|
+
flexDirection: "column",
|
|
32
|
+
gap: 8
|
|
33
|
+
},
|
|
34
|
+
children: [
|
|
35
|
+
showTitle && /* @__PURE__ */ jsx("div", { style: { width: cardWidth, height: 16 }, children: /* @__PURE__ */ jsx(
|
|
36
|
+
Skeleton,
|
|
37
|
+
{
|
|
38
|
+
variant: "line",
|
|
39
|
+
width: "ui:w-full",
|
|
40
|
+
height: "ui:h-full"
|
|
41
|
+
}
|
|
42
|
+
) }),
|
|
43
|
+
showSubtitle && /* @__PURE__ */ jsx("div", { style: { width: cardWidth * 0.75, height: 12 }, children: /* @__PURE__ */ jsx(
|
|
44
|
+
Skeleton,
|
|
45
|
+
{
|
|
46
|
+
variant: "line",
|
|
47
|
+
width: "ui:w-full",
|
|
48
|
+
height: "ui:h-full"
|
|
49
|
+
}
|
|
50
|
+
) })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
i
|
|
57
|
+
)) });
|
|
58
|
+
}
|
|
59
|
+
var CarouselLoading_default = CarouselLoading;
|
|
60
|
+
export {
|
|
61
|
+
CarouselLoading_default as default
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=CarouselLoading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Carousel/CarouselLoading.tsx"],"sourcesContent":["import Skeleton from '../Skeleton/Skeleton'\n\nexport interface CarouselLoadingProps {\n /** Number of skeleton cards to display */\n count?: number\n /** Width of each card in pixels */\n cardWidth?: number\n /** Height of each card in pixels */\n cardHeight?: number\n /** Show skeleton for title */\n showTitle?: boolean\n /** Show skeleton for subtitle/date */\n showSubtitle?: boolean\n /** Apply rounded corners to skeleton */\n rounded?: boolean\n}\n\n/**\n * CarouselLoading - Loading state for carousel with skeleton cards\n *\n * Displays a horizontal scrollable list of skeleton placeholders\n * matching the structure of MovieCard components.\n */\nfunction CarouselLoading({\n count = 6,\n cardWidth = 150,\n cardHeight = 225,\n showTitle = true,\n showSubtitle = true,\n rounded = true,\n}: Readonly<CarouselLoadingProps>) {\n return (\n <div className=\"ui:overflow-x-auto ui:flex ui:gap-4\">\n {Array.from({ length: count }).map((_, i) => (\n <div\n key={i}\n style={{ width: cardWidth, minWidth: cardWidth, maxWidth: cardWidth }}\n >\n <div style={{ width: cardWidth, height: cardHeight }}>\n <Skeleton\n variant=\"rectangle\"\n width=\"ui:w-full\"\n height=\"ui:h-full\"\n rounded={rounded}\n />\n </div>\n {(showTitle || showSubtitle) && (\n <div\n style={{\n marginTop: 8,\n display: 'flex',\n flexDirection: 'column',\n gap: 8,\n }}\n >\n {showTitle && (\n <div style={{ width: cardWidth, height: 16 }}>\n <Skeleton\n variant=\"line\"\n width=\"ui:w-full\"\n height=\"ui:h-full\"\n />\n </div>\n )}\n {showSubtitle && (\n <div style={{ width: cardWidth * 0.75, height: 12 }}>\n <Skeleton\n variant=\"line\"\n width=\"ui:w-full\"\n height=\"ui:h-full\"\n />\n </div>\n )}\n </div>\n )}\n </div>\n ))}\n </div>\n )\n}\n\nexport default CarouselLoading\n"],"mappings":"AAuCY,cAQA,YARA;AAvCZ,OAAO,cAAc;AAuBrB,SAAS,gBAAgB;AAAA,EACvB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,UAAU;AACZ,GAAmC;AACjC,SACE,oBAAC,SAAI,WAAU,uCACZ,gBAAM,KAAK,EAAE,QAAQ,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,MACrC;AAAA,IAAC;AAAA;AAAA,MAEC,OAAO,EAAE,OAAO,WAAW,UAAU,WAAW,UAAU,UAAU;AAAA,MAEpE;AAAA,4BAAC,SAAI,OAAO,EAAE,OAAO,WAAW,QAAQ,WAAW,GACjD;AAAA,UAAC;AAAA;AAAA,YACC,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,QAAO;AAAA,YACP;AAAA;AAAA,QACF,GACF;AAAA,SACE,aAAa,iBACb;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,cACL,WAAW;AAAA,cACX,SAAS;AAAA,cACT,eAAe;AAAA,cACf,KAAK;AAAA,YACP;AAAA,YAEC;AAAA,2BACC,oBAAC,SAAI,OAAO,EAAE,OAAO,WAAW,QAAQ,GAAG,GACzC;AAAA,gBAAC;AAAA;AAAA,kBACC,SAAQ;AAAA,kBACR,OAAM;AAAA,kBACN,QAAO;AAAA;AAAA,cACT,GACF;AAAA,cAED,gBACC,oBAAC,SAAI,OAAO,EAAE,OAAO,YAAY,MAAM,QAAQ,GAAG,GAChD;AAAA,gBAAC;AAAA;AAAA,kBACC,SAAQ;AAAA,kBACR,OAAM;AAAA,kBACN,QAAO;AAAA;AAAA,cACT,GACF;AAAA;AAAA;AAAA,QAEJ;AAAA;AAAA;AAAA,IAtCG;AAAA,EAwCP,CACD,GACH;AAEJ;AAEA,IAAO,0BAAQ;","names":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/** Position mode for navigation buttons */
|
|
4
|
+
type CarouselNavigationPosition = 'inline' | 'sides' | 'sides-inset';
|
|
5
|
+
interface CarouselNavigationProps {
|
|
6
|
+
/** Callback for previous button */
|
|
7
|
+
onPrev: () => void;
|
|
8
|
+
/** Callback for next button */
|
|
9
|
+
onNext: () => void;
|
|
10
|
+
/** Whether previous is disabled */
|
|
11
|
+
canPrev: boolean;
|
|
12
|
+
/** Whether next is disabled */
|
|
13
|
+
canNext: boolean;
|
|
14
|
+
/** Button size */
|
|
15
|
+
size?: 'sm' | 'md';
|
|
16
|
+
/** Position mode */
|
|
17
|
+
position?: CarouselNavigationPosition;
|
|
18
|
+
/** Icon button visual variant — ghost for lightbox (white arrows on dark bg) */
|
|
19
|
+
iconVariant?: 'secondary' | 'ghost';
|
|
20
|
+
/** Additional class name */
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Navigation buttons for Carousel (previous/next).
|
|
25
|
+
* - inline: side by side (for bottom-right layout)
|
|
26
|
+
* - sides: absolute, centered on the carousel edges (overhangs container — standard carousel)
|
|
27
|
+
* - sides-inset: absolute, inside the container with padding (lightbox, fullscreen contexts)
|
|
28
|
+
*/
|
|
29
|
+
declare function CarouselNavigation({ onPrev, onNext, canPrev, canNext, size, position, iconVariant, className, }: Readonly<CarouselNavigationProps>): react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
export { type CarouselNavigationPosition, type CarouselNavigationProps, CarouselNavigation as default };
|