@underverse-ui/underverse 0.1.33 → 0.1.35
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/index.cjs +286 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +291 -51
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -56,6 +56,7 @@ interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElem
|
|
|
56
56
|
lockMs?: number;
|
|
57
57
|
asContainer?: boolean;
|
|
58
58
|
noWrap?: boolean;
|
|
59
|
+
noHoverOverlay?: boolean;
|
|
59
60
|
}
|
|
60
61
|
declare const Button: React__default.ForwardRefExoticComponent<ButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
61
62
|
|
|
@@ -888,12 +889,29 @@ interface ImageUploadProps {
|
|
|
888
889
|
declare function ImageUpload({ onUpload, onRemove, maxSize, // Convert bytes to MB
|
|
889
890
|
accept, multiple, disabled, className, showPreview, previewSize, dragDropText, browseText, supportedFormatsText }: ImageUploadProps): react_jsx_runtime.JSX.Element;
|
|
890
891
|
|
|
892
|
+
type AnimationVariant = "slide" | "fade" | "scale";
|
|
893
|
+
type Orientation = "horizontal" | "vertical";
|
|
891
894
|
interface CarouselProps {
|
|
892
895
|
children: React$1.ReactNode[];
|
|
893
896
|
autoScroll?: boolean;
|
|
894
897
|
autoScrollInterval?: number;
|
|
898
|
+
animation?: AnimationVariant;
|
|
899
|
+
orientation?: Orientation;
|
|
900
|
+
showArrows?: boolean;
|
|
901
|
+
showDots?: boolean;
|
|
902
|
+
showProgress?: boolean;
|
|
903
|
+
showThumbnails?: boolean;
|
|
904
|
+
loop?: boolean;
|
|
905
|
+
slidesToShow?: number;
|
|
906
|
+
slidesToScroll?: number;
|
|
907
|
+
className?: string;
|
|
908
|
+
containerClassName?: string;
|
|
909
|
+
slideClassName?: string;
|
|
910
|
+
onSlideChange?: (index: number) => void;
|
|
911
|
+
thumbnailRenderer?: (child: React$1.ReactNode, index: number) => React$1.ReactNode;
|
|
912
|
+
ariaLabel?: string;
|
|
895
913
|
}
|
|
896
|
-
declare function Carousel({ children, autoScroll, autoScrollInterval }: CarouselProps): react_jsx_runtime.JSX.Element;
|
|
914
|
+
declare function Carousel({ children, autoScroll, autoScrollInterval, animation, orientation, showArrows, showDots, showProgress, showThumbnails, loop, slidesToShow, slidesToScroll, className, containerClassName, slideClassName, onSlideChange, thumbnailRenderer, ariaLabel, }: CarouselProps): react_jsx_runtime.JSX.Element;
|
|
897
915
|
|
|
898
916
|
interface ClientOnlyProps {
|
|
899
917
|
children: React.ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElem
|
|
|
56
56
|
lockMs?: number;
|
|
57
57
|
asContainer?: boolean;
|
|
58
58
|
noWrap?: boolean;
|
|
59
|
+
noHoverOverlay?: boolean;
|
|
59
60
|
}
|
|
60
61
|
declare const Button: React__default.ForwardRefExoticComponent<ButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
61
62
|
|
|
@@ -888,12 +889,29 @@ interface ImageUploadProps {
|
|
|
888
889
|
declare function ImageUpload({ onUpload, onRemove, maxSize, // Convert bytes to MB
|
|
889
890
|
accept, multiple, disabled, className, showPreview, previewSize, dragDropText, browseText, supportedFormatsText }: ImageUploadProps): react_jsx_runtime.JSX.Element;
|
|
890
891
|
|
|
892
|
+
type AnimationVariant = "slide" | "fade" | "scale";
|
|
893
|
+
type Orientation = "horizontal" | "vertical";
|
|
891
894
|
interface CarouselProps {
|
|
892
895
|
children: React$1.ReactNode[];
|
|
893
896
|
autoScroll?: boolean;
|
|
894
897
|
autoScrollInterval?: number;
|
|
898
|
+
animation?: AnimationVariant;
|
|
899
|
+
orientation?: Orientation;
|
|
900
|
+
showArrows?: boolean;
|
|
901
|
+
showDots?: boolean;
|
|
902
|
+
showProgress?: boolean;
|
|
903
|
+
showThumbnails?: boolean;
|
|
904
|
+
loop?: boolean;
|
|
905
|
+
slidesToShow?: number;
|
|
906
|
+
slidesToScroll?: number;
|
|
907
|
+
className?: string;
|
|
908
|
+
containerClassName?: string;
|
|
909
|
+
slideClassName?: string;
|
|
910
|
+
onSlideChange?: (index: number) => void;
|
|
911
|
+
thumbnailRenderer?: (child: React$1.ReactNode, index: number) => React$1.ReactNode;
|
|
912
|
+
ariaLabel?: string;
|
|
895
913
|
}
|
|
896
|
-
declare function Carousel({ children, autoScroll, autoScrollInterval }: CarouselProps): react_jsx_runtime.JSX.Element;
|
|
914
|
+
declare function Carousel({ children, autoScroll, autoScrollInterval, animation, orientation, showArrows, showDots, showProgress, showThumbnails, loop, slidesToShow, slidesToScroll, className, containerClassName, slideClassName, onSlideChange, thumbnailRenderer, ariaLabel, }: CarouselProps): react_jsx_runtime.JSX.Element;
|
|
897
915
|
|
|
898
916
|
interface ClientOnlyProps {
|
|
899
917
|
children: React.ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -70,6 +70,7 @@ var Button = forwardRef(
|
|
|
70
70
|
lockMs = 600,
|
|
71
71
|
asContainer = false,
|
|
72
72
|
noWrap = true,
|
|
73
|
+
noHoverOverlay = false,
|
|
73
74
|
...rest
|
|
74
75
|
}, ref) => {
|
|
75
76
|
const baseStyles = asContainer ? "relative inline-flex justify-center rounded-md font-medium transition-colors duration-150 ease-soft outline-none focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background active:translate-y-px" : "relative inline-flex items-center justify-center gap-2 rounded-md font-medium overflow-hidden transition-colors duration-150 ease-soft outline-none focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background active:translate-y-px";
|
|
@@ -131,7 +132,7 @@ var Button = forwardRef(
|
|
|
131
132
|
"aria-label": rest["aria-label"] || title,
|
|
132
133
|
...rest,
|
|
133
134
|
children: [
|
|
134
|
-
/* @__PURE__ */ jsx("span", { className: "absolute inset-0 bg-gradient-to-r from-primary-foreground/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-200" }),
|
|
135
|
+
!noHoverOverlay && /* @__PURE__ */ jsx("span", { className: "absolute inset-0 bg-gradient-to-r from-primary-foreground/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-200" }),
|
|
135
136
|
loading2 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
136
137
|
/* @__PURE__ */ jsx(SpinnerIcon, { className: "w-4 h-4 animate-spin" }),
|
|
137
138
|
loadingText && /* @__PURE__ */ jsx("span", { className: "ml-2", "aria-live": "polite", children: loadingText }),
|
|
@@ -6751,59 +6752,298 @@ function ImageUpload({
|
|
|
6751
6752
|
|
|
6752
6753
|
// ../../components/ui/Carousel.tsx
|
|
6753
6754
|
import * as React27 from "react";
|
|
6754
|
-
import {
|
|
6755
|
+
import { ChevronLeft as ChevronLeft3, ChevronRight as ChevronRight5 } from "lucide-react";
|
|
6755
6756
|
import { Fragment as Fragment9, jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6756
|
-
function Carousel({
|
|
6757
|
+
function Carousel({
|
|
6758
|
+
children,
|
|
6759
|
+
autoScroll = true,
|
|
6760
|
+
autoScrollInterval = 5e3,
|
|
6761
|
+
animation = "slide",
|
|
6762
|
+
orientation = "horizontal",
|
|
6763
|
+
showArrows = true,
|
|
6764
|
+
showDots = true,
|
|
6765
|
+
showProgress = false,
|
|
6766
|
+
showThumbnails = false,
|
|
6767
|
+
loop = true,
|
|
6768
|
+
slidesToShow = 1,
|
|
6769
|
+
slidesToScroll = 1,
|
|
6770
|
+
className,
|
|
6771
|
+
containerClassName,
|
|
6772
|
+
slideClassName,
|
|
6773
|
+
onSlideChange,
|
|
6774
|
+
thumbnailRenderer,
|
|
6775
|
+
ariaLabel = "Carousel"
|
|
6776
|
+
}) {
|
|
6757
6777
|
const [currentIndex, setCurrentIndex] = React27.useState(0);
|
|
6758
|
-
const totalSlides = React27.Children.count(children);
|
|
6759
6778
|
const [isPaused, setIsPaused] = React27.useState(false);
|
|
6779
|
+
const [isDragging, setIsDragging] = React27.useState(false);
|
|
6780
|
+
const [startPos, setStartPos] = React27.useState(0);
|
|
6781
|
+
const [currentTranslate, setCurrentTranslate] = React27.useState(0);
|
|
6782
|
+
const [prevTranslate, setPrevTranslate] = React27.useState(0);
|
|
6783
|
+
const [progress, setProgress] = React27.useState(0);
|
|
6784
|
+
const carouselRef = React27.useRef(null);
|
|
6785
|
+
const progressIntervalRef = React27.useRef(null);
|
|
6786
|
+
const totalSlides = React27.Children.count(children);
|
|
6787
|
+
const maxIndex = Math.max(0, totalSlides - slidesToShow);
|
|
6788
|
+
const isHorizontal = orientation === "horizontal";
|
|
6760
6789
|
const scrollPrev = React27.useCallback(() => {
|
|
6761
|
-
setCurrentIndex((prev) =>
|
|
6762
|
-
|
|
6790
|
+
setCurrentIndex((prev) => {
|
|
6791
|
+
if (prev === 0) {
|
|
6792
|
+
return loop ? maxIndex : 0;
|
|
6793
|
+
}
|
|
6794
|
+
return Math.max(0, prev - slidesToScroll);
|
|
6795
|
+
});
|
|
6796
|
+
}, [loop, maxIndex, slidesToScroll]);
|
|
6763
6797
|
const scrollNext = React27.useCallback(() => {
|
|
6764
|
-
setCurrentIndex((prev) =>
|
|
6765
|
-
|
|
6798
|
+
setCurrentIndex((prev) => {
|
|
6799
|
+
if (prev >= maxIndex) {
|
|
6800
|
+
return loop ? 0 : maxIndex;
|
|
6801
|
+
}
|
|
6802
|
+
return Math.min(maxIndex, prev + slidesToScroll);
|
|
6803
|
+
});
|
|
6804
|
+
}, [loop, maxIndex, slidesToScroll]);
|
|
6805
|
+
const scrollTo = React27.useCallback(
|
|
6806
|
+
(index) => {
|
|
6807
|
+
setCurrentIndex(Math.min(maxIndex, Math.max(0, index)));
|
|
6808
|
+
},
|
|
6809
|
+
[maxIndex]
|
|
6810
|
+
);
|
|
6766
6811
|
React27.useEffect(() => {
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
),
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6812
|
+
const handleKeyDown = (e) => {
|
|
6813
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
|
|
6814
|
+
e.preventDefault();
|
|
6815
|
+
scrollPrev();
|
|
6816
|
+
} else if (e.key === "ArrowRight" || e.key === "ArrowDown") {
|
|
6817
|
+
e.preventDefault();
|
|
6818
|
+
scrollNext();
|
|
6819
|
+
} else if (e.key === "Home") {
|
|
6820
|
+
e.preventDefault();
|
|
6821
|
+
scrollTo(0);
|
|
6822
|
+
} else if (e.key === "End") {
|
|
6823
|
+
e.preventDefault();
|
|
6824
|
+
scrollTo(maxIndex);
|
|
6825
|
+
}
|
|
6826
|
+
};
|
|
6827
|
+
const carousel = carouselRef.current;
|
|
6828
|
+
if (carousel) {
|
|
6829
|
+
carousel.addEventListener("keydown", handleKeyDown);
|
|
6830
|
+
return () => carousel.removeEventListener("keydown", handleKeyDown);
|
|
6831
|
+
}
|
|
6832
|
+
}, [scrollPrev, scrollNext, scrollTo, maxIndex]);
|
|
6833
|
+
React27.useEffect(() => {
|
|
6834
|
+
if (!autoScroll || isPaused || totalSlides <= slidesToShow) {
|
|
6835
|
+
setProgress(0);
|
|
6836
|
+
if (progressIntervalRef.current) {
|
|
6837
|
+
clearInterval(progressIntervalRef.current);
|
|
6838
|
+
}
|
|
6839
|
+
return;
|
|
6840
|
+
}
|
|
6841
|
+
setProgress(0);
|
|
6842
|
+
const progressStep = 100 / (autoScrollInterval / 50);
|
|
6843
|
+
progressIntervalRef.current = setInterval(() => {
|
|
6844
|
+
setProgress((prev) => {
|
|
6845
|
+
if (prev >= 100) {
|
|
6846
|
+
scrollNext();
|
|
6847
|
+
return 0;
|
|
6794
6848
|
}
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
{
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
)
|
|
6806
|
-
|
|
6849
|
+
return prev + progressStep;
|
|
6850
|
+
});
|
|
6851
|
+
}, 50);
|
|
6852
|
+
return () => {
|
|
6853
|
+
if (progressIntervalRef.current) {
|
|
6854
|
+
clearInterval(progressIntervalRef.current);
|
|
6855
|
+
}
|
|
6856
|
+
};
|
|
6857
|
+
}, [autoScroll, isPaused, totalSlides, slidesToShow, autoScrollInterval, scrollNext]);
|
|
6858
|
+
const getPositionX = (event) => {
|
|
6859
|
+
return event.type.includes("mouse") ? event.pageX : event.touches[0].clientX;
|
|
6860
|
+
};
|
|
6861
|
+
const getPositionY = (event) => {
|
|
6862
|
+
return event.type.includes("mouse") ? event.pageY : event.touches[0].clientY;
|
|
6863
|
+
};
|
|
6864
|
+
const touchStart = (event) => {
|
|
6865
|
+
setIsDragging(true);
|
|
6866
|
+
const pos = isHorizontal ? getPositionX(event.nativeEvent) : getPositionY(event.nativeEvent);
|
|
6867
|
+
setStartPos(pos);
|
|
6868
|
+
setPrevTranslate(currentTranslate);
|
|
6869
|
+
};
|
|
6870
|
+
const touchMove = (event) => {
|
|
6871
|
+
if (!isDragging) return;
|
|
6872
|
+
const pos = isHorizontal ? getPositionX(event.nativeEvent) : getPositionY(event.nativeEvent);
|
|
6873
|
+
const currentPosition = pos;
|
|
6874
|
+
setCurrentTranslate(prevTranslate + currentPosition - startPos);
|
|
6875
|
+
};
|
|
6876
|
+
const touchEnd = () => {
|
|
6877
|
+
if (!isDragging) return;
|
|
6878
|
+
setIsDragging(false);
|
|
6879
|
+
const movedBy = currentTranslate - prevTranslate;
|
|
6880
|
+
const threshold = 50;
|
|
6881
|
+
if (movedBy < -threshold && currentIndex < maxIndex) {
|
|
6882
|
+
scrollNext();
|
|
6883
|
+
} else if (movedBy > threshold && currentIndex > 0) {
|
|
6884
|
+
scrollPrev();
|
|
6885
|
+
}
|
|
6886
|
+
setCurrentTranslate(0);
|
|
6887
|
+
setPrevTranslate(0);
|
|
6888
|
+
};
|
|
6889
|
+
React27.useEffect(() => {
|
|
6890
|
+
onSlideChange?.(currentIndex);
|
|
6891
|
+
}, [currentIndex, onSlideChange]);
|
|
6892
|
+
const getAnimationStyles = () => {
|
|
6893
|
+
const baseTransform = isHorizontal ? `translateX(-${currentIndex * (100 / slidesToShow)}%)` : `translateY(-${currentIndex * (100 / slidesToShow)}%)`;
|
|
6894
|
+
if (animation === "fade") {
|
|
6895
|
+
return {
|
|
6896
|
+
transition: "opacity 500ms ease-in-out"
|
|
6897
|
+
};
|
|
6898
|
+
}
|
|
6899
|
+
if (animation === "scale") {
|
|
6900
|
+
return {
|
|
6901
|
+
transform: baseTransform,
|
|
6902
|
+
transition: "transform 500ms ease-in-out, scale 500ms ease-in-out"
|
|
6903
|
+
};
|
|
6904
|
+
}
|
|
6905
|
+
return {
|
|
6906
|
+
transform: baseTransform,
|
|
6907
|
+
transition: isDragging ? "none" : "transform 500ms ease-in-out"
|
|
6908
|
+
};
|
|
6909
|
+
};
|
|
6910
|
+
const slideWidth = 100 / slidesToShow;
|
|
6911
|
+
return /* @__PURE__ */ jsxs30(
|
|
6912
|
+
"div",
|
|
6913
|
+
{
|
|
6914
|
+
ref: carouselRef,
|
|
6915
|
+
className: cn("relative w-full overflow-hidden focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 rounded-lg", className),
|
|
6916
|
+
onMouseEnter: () => setIsPaused(true),
|
|
6917
|
+
onMouseLeave: () => setIsPaused(false),
|
|
6918
|
+
role: "region",
|
|
6919
|
+
"aria-label": ariaLabel,
|
|
6920
|
+
"aria-roledescription": "carousel",
|
|
6921
|
+
tabIndex: 0,
|
|
6922
|
+
children: [
|
|
6923
|
+
showProgress && autoScroll && /* @__PURE__ */ jsx35("div", { className: "absolute top-0 left-0 right-0 h-1 bg-muted z-20", children: /* @__PURE__ */ jsx35("div", { className: "h-full bg-primary transition-all duration-50 ease-linear", style: { width: `${progress}%` } }) }),
|
|
6924
|
+
/* @__PURE__ */ jsx35(
|
|
6925
|
+
"div",
|
|
6926
|
+
{
|
|
6927
|
+
className: cn("flex", isHorizontal ? "flex-row" : "flex-col", containerClassName),
|
|
6928
|
+
style: getAnimationStyles(),
|
|
6929
|
+
onTouchStart: touchStart,
|
|
6930
|
+
onTouchMove: touchMove,
|
|
6931
|
+
onTouchEnd: touchEnd,
|
|
6932
|
+
onMouseDown: touchStart,
|
|
6933
|
+
onMouseMove: touchMove,
|
|
6934
|
+
onMouseUp: touchEnd,
|
|
6935
|
+
onMouseLeave: touchEnd,
|
|
6936
|
+
role: "group",
|
|
6937
|
+
"aria-atomic": "false",
|
|
6938
|
+
"aria-live": autoScroll ? "off" : "polite",
|
|
6939
|
+
children: React27.Children.map(children, (child, idx) => /* @__PURE__ */ jsx35(
|
|
6940
|
+
"div",
|
|
6941
|
+
{
|
|
6942
|
+
className: cn(
|
|
6943
|
+
"flex-shrink-0",
|
|
6944
|
+
isHorizontal ? "h-full" : "w-full",
|
|
6945
|
+
animation === "fade" && idx !== currentIndex && "opacity-0",
|
|
6946
|
+
animation === "scale" && idx !== currentIndex && "scale-95",
|
|
6947
|
+
slideClassName
|
|
6948
|
+
),
|
|
6949
|
+
style: {
|
|
6950
|
+
[isHorizontal ? "width" : "height"]: `${slideWidth}%`
|
|
6951
|
+
},
|
|
6952
|
+
role: "group",
|
|
6953
|
+
"aria-roledescription": "slide",
|
|
6954
|
+
"aria-label": `${idx + 1} of ${totalSlides}`,
|
|
6955
|
+
"aria-hidden": idx < currentIndex || idx >= currentIndex + slidesToShow,
|
|
6956
|
+
children: child
|
|
6957
|
+
},
|
|
6958
|
+
idx
|
|
6959
|
+
))
|
|
6960
|
+
}
|
|
6961
|
+
),
|
|
6962
|
+
showArrows && totalSlides > slidesToShow && /* @__PURE__ */ jsxs30(Fragment9, { children: [
|
|
6963
|
+
/* @__PURE__ */ jsx35(
|
|
6964
|
+
Button_default,
|
|
6965
|
+
{
|
|
6966
|
+
onClick: scrollPrev,
|
|
6967
|
+
variant: "ghost",
|
|
6968
|
+
size: "icon",
|
|
6969
|
+
icon: ChevronLeft3,
|
|
6970
|
+
noHoverOverlay: true,
|
|
6971
|
+
disabled: !loop && currentIndex === 0,
|
|
6972
|
+
className: cn(
|
|
6973
|
+
"absolute top-1/2 -translate-y-1/2 hover:-translate-y-1/2 active:-translate-y-1/2 z-10 rounded-full will-change-transform backdrop-blur-0 hover:backdrop-blur-0 hover:bg-transparent border-0",
|
|
6974
|
+
isHorizontal ? "left-4" : "top-4 left-1/2 -translate-x-1/2 rotate-90"
|
|
6975
|
+
),
|
|
6976
|
+
"aria-label": "Previous slide"
|
|
6977
|
+
}
|
|
6978
|
+
),
|
|
6979
|
+
/* @__PURE__ */ jsx35(
|
|
6980
|
+
Button_default,
|
|
6981
|
+
{
|
|
6982
|
+
onClick: scrollNext,
|
|
6983
|
+
variant: "ghost",
|
|
6984
|
+
size: "icon",
|
|
6985
|
+
icon: ChevronRight5,
|
|
6986
|
+
noHoverOverlay: true,
|
|
6987
|
+
disabled: !loop && currentIndex >= maxIndex,
|
|
6988
|
+
className: cn(
|
|
6989
|
+
"absolute top-1/2 -translate-y-1/2 hover:-translate-y-1/2 active:-translate-y-1/2 z-10 rounded-full will-change-transform backdrop-blur-0 hover:backdrop-blur-0 hover:bg-transparent border-0",
|
|
6990
|
+
isHorizontal ? "right-4" : "bottom-4 left-1/2 -translate-x-1/2 rotate-90"
|
|
6991
|
+
),
|
|
6992
|
+
"aria-label": "Next slide"
|
|
6993
|
+
}
|
|
6994
|
+
)
|
|
6995
|
+
] }),
|
|
6996
|
+
showDots && totalSlides > slidesToShow && /* @__PURE__ */ jsx35(
|
|
6997
|
+
"div",
|
|
6998
|
+
{
|
|
6999
|
+
className: cn(
|
|
7000
|
+
"absolute flex gap-2 z-10",
|
|
7001
|
+
isHorizontal ? "bottom-4 left-1/2 -translate-x-1/2 flex-row" : "right-4 top-1/2 -translate-y-1/2 flex-col"
|
|
7002
|
+
),
|
|
7003
|
+
role: "tablist",
|
|
7004
|
+
"aria-label": "Carousel pagination",
|
|
7005
|
+
children: Array.from({ length: maxIndex + 1 }, (_, idx) => /* @__PURE__ */ jsx35(
|
|
7006
|
+
"button",
|
|
7007
|
+
{
|
|
7008
|
+
onClick: () => scrollTo(idx),
|
|
7009
|
+
className: cn(
|
|
7010
|
+
"rounded-full transition-all focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
7011
|
+
isHorizontal ? "w-2 h-2" : "w-2 h-2",
|
|
7012
|
+
idx === currentIndex ? `bg-primary ${isHorizontal ? "w-6" : "h-6"}` : "bg-muted-foreground/50 hover:bg-muted-foreground/75"
|
|
7013
|
+
),
|
|
7014
|
+
"aria-label": `Go to slide ${idx + 1}`,
|
|
7015
|
+
"aria-selected": idx === currentIndex,
|
|
7016
|
+
role: "tab"
|
|
7017
|
+
},
|
|
7018
|
+
idx
|
|
7019
|
+
))
|
|
7020
|
+
}
|
|
7021
|
+
),
|
|
7022
|
+
showThumbnails && totalSlides > slidesToShow && /* @__PURE__ */ jsx35(
|
|
7023
|
+
"div",
|
|
7024
|
+
{
|
|
7025
|
+
className: cn(
|
|
7026
|
+
"absolute bottom-0 left-0 right-0 flex gap-2 p-4 bg-gradient-to-t from-black/50 to-transparent overflow-x-auto",
|
|
7027
|
+
isHorizontal ? "flex-row" : "flex-col"
|
|
7028
|
+
),
|
|
7029
|
+
children: React27.Children.map(children, (child, idx) => /* @__PURE__ */ jsx35(
|
|
7030
|
+
"button",
|
|
7031
|
+
{
|
|
7032
|
+
onClick: () => scrollTo(idx),
|
|
7033
|
+
className: cn(
|
|
7034
|
+
"flex-shrink-0 w-16 h-16 rounded-md overflow-hidden border-2 transition-all focus:outline-none focus:ring-2 focus:ring-primary",
|
|
7035
|
+
idx === currentIndex ? "border-primary scale-110" : "border-transparent opacity-70 hover:opacity-100"
|
|
7036
|
+
),
|
|
7037
|
+
"aria-label": `Thumbnail ${idx + 1}`,
|
|
7038
|
+
children: thumbnailRenderer ? thumbnailRenderer(child, idx) : child
|
|
7039
|
+
},
|
|
7040
|
+
idx
|
|
7041
|
+
))
|
|
7042
|
+
}
|
|
7043
|
+
)
|
|
7044
|
+
]
|
|
7045
|
+
}
|
|
7046
|
+
);
|
|
6807
7047
|
}
|
|
6808
7048
|
|
|
6809
7049
|
// ../../components/ui/ClientOnly.tsx
|
|
@@ -9594,7 +9834,7 @@ function AccessDenied({
|
|
|
9594
9834
|
|
|
9595
9835
|
// ../../components/ui/ThemeToggleHeadless.tsx
|
|
9596
9836
|
import { Moon, Sun, Monitor } from "lucide-react";
|
|
9597
|
-
import { useEffect as useEffect16, useRef as
|
|
9837
|
+
import { useEffect as useEffect16, useRef as useRef11, useState as useState26 } from "react";
|
|
9598
9838
|
import { createPortal as createPortal9 } from "react-dom";
|
|
9599
9839
|
import { Fragment as Fragment11, jsx as jsx44, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
9600
9840
|
function ThemeToggleHeadless({
|
|
@@ -9605,7 +9845,7 @@ function ThemeToggleHeadless({
|
|
|
9605
9845
|
}) {
|
|
9606
9846
|
const [isOpen, setIsOpen] = useState26(false);
|
|
9607
9847
|
const [mounted, setMounted] = useState26(false);
|
|
9608
|
-
const triggerRef =
|
|
9848
|
+
const triggerRef = useRef11(null);
|
|
9609
9849
|
const [dropdownPosition, setDropdownPosition] = useState26(null);
|
|
9610
9850
|
useEffect16(() => setMounted(true), []);
|
|
9611
9851
|
const themes = [
|
|
@@ -9696,7 +9936,7 @@ function ThemeToggleHeadless({
|
|
|
9696
9936
|
}
|
|
9697
9937
|
|
|
9698
9938
|
// ../../components/ui/LanguageSwitcherHeadless.tsx
|
|
9699
|
-
import { useRef as
|
|
9939
|
+
import { useRef as useRef12, useState as useState27 } from "react";
|
|
9700
9940
|
import { createPortal as createPortal10 } from "react-dom";
|
|
9701
9941
|
import { Globe } from "lucide-react";
|
|
9702
9942
|
import { Fragment as Fragment12, jsx as jsx45, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
@@ -9709,7 +9949,7 @@ function LanguageSwitcherHeadless({
|
|
|
9709
9949
|
}) {
|
|
9710
9950
|
const [isOpen, setIsOpen] = useState27(false);
|
|
9711
9951
|
const [dropdownPosition, setDropdownPosition] = useState27(null);
|
|
9712
|
-
const triggerButtonRef =
|
|
9952
|
+
const triggerButtonRef = useRef12(null);
|
|
9713
9953
|
const currentLanguage = locales.find((l) => l.code === currentLocale) || locales[0];
|
|
9714
9954
|
const calculatePosition = () => {
|
|
9715
9955
|
const rect = triggerButtonRef.current?.getBoundingClientRect();
|