import { t as e } from "../chunks/ui.module-BisoTevy.js";
import { useId as t } from "react";
import { cn as n } from "@ryuzaki13/react-foundation-lib/utils";
import { jsx as r, jsxs as i } from "react/jsx-runtime";
var a = {
	row: "FFyoOs",
	wrapper: "zPYy7T",
	input: "j6ek6R",
	track: "HFTPXI",
	thumb: "_0RK4xF",
	unchecked: "kDPnKt",
	checked: "DQHqws",
	option: "nCQ9v4"
};
//#endregion
//#region src/toggle/Toggle.tsx
function o({ label: o, description: s, placeholder: c, disabled: l, size: u, className: d, onChange: f, value: p, id: m, checkedText: h = "ВКЛ", uncheckedText: g = "ВЫКЛ", labelPosition: _ = "before", ...v }) {
	let y = t(), b = m ?? y, x = s ? `${b}-description` : void 0, S = o ?? c, C = !!p, w = !S && !v["aria-label"] ? `${g} / ${h}` : void 0, T = S ? /* @__PURE__ */ r("label", {
		htmlFor: b,
		className: e.uiLabel,
		children: S
	}) : null;
	return /* @__PURE__ */ i("div", {
		className: n(e.uiElement, l && e.disabled, u && e.uiSizable, u && e[u], d),
		"aria-disabled": l || void 0,
		children: [/* @__PURE__ */ i("div", {
			className: a.row,
			children: [
				_ === "before" && T,
				/* @__PURE__ */ i("div", {
					className: a.wrapper,
					children: [/* @__PURE__ */ r("input", {
						...v,
						id: b,
						type: "checkbox",
						role: "switch",
						checked: C,
						disabled: l,
						"aria-checked": C,
						"aria-describedby": x,
						"aria-label": w,
						className: n(e.uiInputControl, a.input),
						onChange: (e) => f?.(e.currentTarget.checked)
					}), /* @__PURE__ */ i("div", {
						className: a.track,
						"data-disabled": l || void 0,
						"aria-hidden": "true",
						children: [
							/* @__PURE__ */ r("div", { className: a.thumb }),
							/* @__PURE__ */ r("div", {
								className: n(a.option, a.unchecked),
								children: g
							}),
							/* @__PURE__ */ r("div", {
								className: n(a.option, a.checked),
								children: h
							})
						]
					})]
				}),
				_ === "after" && T
			]
		}), s && /* @__PURE__ */ r("p", {
			id: x,
			className: e.uiDescription,
			children: s
		})]
	});
}
//#endregion
export { o as Toggle };

//# sourceMappingURL=index.js.map