import { cn } from "./index3.js";
import { Separator } from "./index7.js";
import { cva } from "class-variance-authority";
import { jsx } from "react/jsx-runtime";
import { mergeProps } from "@base-ui/react/merge-props";
import { useRender } from "@base-ui/react/use-render";
//#region src/components/ui/button-group.tsx
var buttonGroupVariants = cva("has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-e-md flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1", {
	variants: {
		orientation: {
			horizontal: "[&>[data-slot]~[data-slot]]:rounded-s-none [&>[data-slot]~[data-slot]]:border-s [&>[data-slot]~[data-slot]]:border-s-black/15 [&>[data-slot]]:rounded-e-none",
			vertical: "flex-col [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t [&>[data-slot]~[data-slot]]:border-t-black/15 [&>[data-slot]]:rounded-b-none"
		},
		shape: {
			rounded: "",
			round: ""
		}
	},
	compoundVariants: [
		{
			orientation: "horizontal",
			shape: "rounded",
			className: "[&>[data-slot]:first-child]:rounded-s-lg [&>[data-slot]:not(:has(~[data-slot]))]:rounded-e-lg!"
		},
		{
			orientation: "horizontal",
			shape: "round",
			className: "[&>[data-slot]:first-child]:rounded-s-full [&>[data-slot]:not(:has(~[data-slot]))]:rounded-e-full!"
		},
		{
			orientation: "vertical",
			shape: "rounded",
			className: "[&>[data-slot]:first-child]:rounded-t-lg [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!"
		},
		{
			orientation: "vertical",
			shape: "round",
			className: "[&>[data-slot]:first-child]:rounded-t-full [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-full!"
		}
	],
	defaultVariants: {
		orientation: "horizontal",
		shape: "rounded"
	}
});
var hasWarnedGroupLabel = false;
function ButtonGroup({ className, orientation, shape, "aria-label": ariaLabel, ...props }) {
	if (process.env.NODE_ENV !== "production" && !ariaLabel && !hasWarnedGroupLabel) {
		hasWarnedGroupLabel = true;
		console.warn("ButtonGroup: Provide an `aria-label` to describe the group for assistive technology (e.g., \"Text formatting\").");
	}
	return /* @__PURE__ */ jsx("div", {
		role: "group",
		"data-slot": "button-group",
		"data-orientation": orientation,
		"aria-label": ariaLabel,
		className: cn(buttonGroupVariants({
			orientation,
			shape
		}), className),
		...props
	});
}
function ButtonGroupText({ className, render, ...props }) {
	return useRender({
		defaultTagName: "div",
		props: mergeProps({ className: cn("bg-muted gap-2 rounded-md border px-2.5 text-sm font-medium shadow-xs [&_svg:not([class*='size-'])]:size-4 flex items-center [&_svg]:pointer-events-none", className) }, props),
		render,
		state: { slot: "button-group-text" }
	});
}
function ButtonGroupSeparator({ className, orientation = "vertical", ...props }) {
	return /* @__PURE__ */ jsx(Separator, {
		"data-slot": "button-group-separator",
		orientation,
		className: cn("bg-input relative self-stretch data-[orientation=horizontal]:mx-px data-[orientation=horizontal]:w-auto data-[orientation=vertical]:my-px data-[orientation=vertical]:h-auto", className),
		...props
	});
}
ButtonGroup.displayName = "ButtonGroup";
ButtonGroupText.displayName = "ButtonGroupText";
ButtonGroupSeparator.displayName = "ButtonGroupSeparator";
//#endregion
export { ButtonGroupText };

//# sourceMappingURL=index8.js.map