"use client";
import { t as e } from "./error-CAd3pM3X.js";
import { t } from "./useControlled-ZBScq72P.js";
import { t as n } from "./useIsoLayoutEffect-CKOv1bV_.js";
import { t as r, u as i } from "./useRenderElement-CmuWsiNa.js";
import { g as a, t as o } from "./createBaseUIEventDetails-ChcQXp54.js";
import { t as s } from "./useBaseUiId-DOm5ACje.js";
import { t as c } from "./useButton-AXffhTAZ.js";
import { cn as l } from "./lib/utils.js";
import { t as u } from "./dist-Ber_p4PA.js";
import { t as d } from "./CompositeItem-BWqRobLN.js";
import * as f from "react";
import { jsx as p } from "react/jsx-runtime";
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/toggle-group/ToggleGroupContext.js
var m = /*#__PURE__*/ f.createContext(void 0);
process.env.NODE_ENV !== "production" && (m.displayName = "ToggleGroupContext");
function h(e = !0) {
	let t = f.useContext(m);
	if (t === void 0 && !e) throw Error(process.env.NODE_ENV === "production" ? i(7) : "Base UI: ToggleGroupContext is missing. ToggleGroup parts must be placed within <ToggleGroup>.");
	return t;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/toggle/Toggle.js
var g = /*#__PURE__*/ f.forwardRef(function(i, l) {
	let { className: u, defaultPressed: f = !1, disabled: m = !1, form: g, onPressedChange: _, pressed: v, render: y, type: b, value: x, nativeButton: S = !0, style: C, ...w } = i, T = s(x || void 0), E = h(), D = E?.value ?? [], O = E ? void 0 : f, k = (m || E?.disabled) ?? !1;
	process.env.NODE_ENV !== "production" && n(() => {
		E && x === void 0 && E.isValueInitialized && e("A `<Toggle>` component rendered in a `<ToggleGroup>` has no explicit `value` prop.", "This will cause issues between the Toggle Group and Toggle values.", "Provide the `<Toggle>` with a `value` prop matching the `<ToggleGroup>` values prop type.");
	}, [
		E,
		x,
		E?.isValueInitialized
	]);
	let [A, j] = t({
		controlled: E ? T !== void 0 && D.indexOf(T) > -1 : v,
		default: O,
		name: "Toggle",
		state: "pressed"
	}), { getButtonProps: M, buttonRef: N } = c({
		disabled: k,
		native: S
	}), P = {
		disabled: k,
		pressed: A
	}, F = [N, l], I = [
		{
			"aria-pressed": A,
			onClick(e) {
				let t = !A, n = o(a, e.nativeEvent);
				T && E?.setGroupValue?.(T, t, n), _?.(t, n), !n.isCanceled && j(t);
			}
		},
		w,
		M
	], L = r("button", i, {
		enabled: !E,
		state: P,
		ref: F,
		props: I
	});
	return E ? /*#__PURE__*/ p(d, {
		tag: "button",
		render: y,
		className: u,
		style: C,
		state: P,
		refs: F,
		props: I
	}) : L;
});
process.env.NODE_ENV !== "production" && (g.displayName = "Toggle");
//#endregion
//#region lib/components/ui/atoms/toggle.tsx
var _ = u("group/toggle inline-flex items-center justify-center gap-1 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-[color,box-shadow] hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-pressed:bg-muted aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
	variants: {
		variant: {
			default: "bg-transparent",
			outline: "border border-input bg-transparent shadow-xs hover:bg-muted"
		},
		size: {
			default: "h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
			sm: "h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
			lg: "h-10 min-w-10 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"
		}
	},
	defaultVariants: {
		variant: "default",
		size: "default"
	}
});
function v({ className: e, variant: t = "default", size: n = "default", ...r }) {
	return /* @__PURE__ */ p(g, {
		className: l(_({
			variant: t,
			size: n,
			className: e
		})),
		"data-slot": "toggle",
		...r
	});
}
//#endregion
export { _ as n, v as t };
