import { t as e } from "./utils-CHlhTiFC.js";
import { t } from "./dist-C2Jrcfwk.js";
import n, { useEffect as r, useEffectEvent as i } from "react";
import { jsx as a } from "react/jsx-runtime";
//#region src/components/ui/sidebar-nav.tsx
var o = t("w-full @2xl:w-1/2 @3xl:w-1/3 @7xl:w-1/4 @8xl:w-1/5", {
	variants: { variant: {
		noEffect: "",
		background: "bg-primary-gray-100 dark:bg-primary-gray-650",
		border: "border-r border-r-primary-gray-300 dark:border-r-primary-gray-600"
	} },
	defaultVariants: { variant: "background" }
}), s = n.createContext({
	selectedValue: void 0,
	classNames: void 0,
	activeValue: void 0,
	onValueChange: () => {}
}), c = n.forwardRef(({ className: t, children: c, variant: l, defaultValue: u, activeValue: d, activeItemClass: f, hoverItemClass: p, onValueChange: m, ...h }, g) => {
	let [_, v] = n.useState(d || u || ""), y = n.useCallback((e) => {
		v(d || e), m?.(e);
	}, [m, d]), b = i((e) => {
		v(e || u || "");
	});
	r(() => {
		b(d);
	}, [d]);
	let x = n.useMemo(() => ({
		activeItemClass: f,
		activeValue: d,
		selectedValue: _,
		hoverItemClass: p,
		onValueChange: y
	}), [
		f,
		d,
		_,
		p,
		y
	]);
	return /* @__PURE__ */ a(s.Provider, {
		value: x,
		children: /* @__PURE__ */ a("div", {
			className: "@container w-full",
			children: /* @__PURE__ */ a("div", {
				className: e(o({ variant: l }), t),
				ref: g,
				...h,
				children: c
			})
		})
	});
});
c.displayName = "Sidebar";
var l = n.forwardRef(({ className: t, children: r, value: i, ...o }, c) => {
	let { selectedValue: l, classNames: u, onValueChange: d } = n.useContext(s);
	return /* @__PURE__ */ a("button", {
		...o,
		ref: c,
		className: e("text-primary-black dark:text-primary-white text-base bg-transparent p-4 flex gap-2 items-center border-0 cursor-pointer hover:bg-primary-gray-300 dark:hover:bg-primary-gray-600", t, u?.controls, l === i && u?.active),
		onClick: () => {
			i && d(i);
		},
		children: r
	});
});
l.displayName = "SidebarItem";
//#endregion
export { c as Sidebar, l as SidebarItem };

//# sourceMappingURL=Sidebar.js.map