import { t as e } from "./utils-CHlhTiFC.js";
import { t } from "./dist-C2Jrcfwk.js";
import n from "react";
import { jsx as r } from "react/jsx-runtime";
//#region src/components/ui/carousel.tsx
var i = n.forwardRef(({ className: t, children: i, ...a }, o) => {
	let s = n.useRef(null), [c, l] = n.useState("url(https://cdn.jsdelivr.net/npm/@undp/design-system-assets@1.6.1/images/arrow-right.svg)");
	return /* @__PURE__ */ r("div", {
		ref: s,
		className: e("mr-auto ml-auto mb-0 undp-scrollbar w-full pb-4 flex snap-x snap-mandatory scroll-p-0 scroll-pl-0 overflow-x-auto", t),
		...a,
		onKeyDown: (e) => {
			s.current && (e.key === "ArrowRight" && s.current.scrollBy(280, 0), e.key === "ArrowLeft" && s.current.scrollBy(-280, 0));
		},
		onClick: (e) => {
			s.current && (e.clientX > window.innerWidth / 2 ? s.current.scrollBy(280, 0) : s.current.scrollBy(-280, 0));
		},
		onMouseMove: (e) => {
			e.clientX > window.innerWidth / 2 ? l("url(https://cdn.jsdelivr.net/npm/@undp/design-system-assets@1.6.1/images/arrow-right.svg)") : l("url(https://cdn.jsdelivr.net/npm/@undp/design-system-assets@1.6.1/images/arrow-left.svg)");
		},
		children: /* @__PURE__ */ r("div", {
			ref: o,
			className: "flex gap-4 items-stretch w-full",
			style: { cursor: `${c}, auto` },
			children: i
		})
	});
});
i.displayName = "Carousel";
var a = t("shrink-0 min-w-[320px] snap-start", {
	variants: { size: {
		xs: "w-1/4 snap-start",
		sm: "w-1/3 snap-start",
		base: "w-1/2 snap-start",
		lg: "w-2/3 snap-start",
		xl: "w-[calc(100%-80px)] snap-start",
		full: "w-full snap-start"
	} },
	defaultVariants: { size: "sm" }
}), o = n.forwardRef(({ className: t, size: n, ...i }, o) => /* @__PURE__ */ r("div", {
	ref: o,
	className: e(a({ size: n }), t),
	...i
}));
o.displayName = "CarouselCard";
//#endregion
export { i as Carousel, o as CarouselCard };

//# sourceMappingURL=Carousel.js.map