/*! ratio-ui · design system for knowledge sharing · https://github.com/losol/ratio-ui · (c) 2026 Losol AS · MPL-2.0 */
import { cn } from "../../utils/cn.js";
import "react";
import { jsx } from "react/jsx-runtime";
import { ToggleButton } from "react-aria-components";
//#region src/core/ToggleButton/ToggleButton.tsx
var variantStyles = {
	default: {
		base: "border-2 border-border-1 bg-card",
		hover: "hover:border-(--primary) hover:bg-card-hover",
		selected: "border-(--primary) bg-primary-100 dark:bg-primary-800 shadow-sm",
		pressed: "pressed:scale-95"
	},
	primary: {
		base: "border-2 border-border-1 bg-card",
		hover: "hover:bg-card-hover",
		selected: "border-(--primary) bg-(--primary) text-(--text-on-primary) shadow-md",
		pressed: "pressed:scale-95"
	},
	outline: {
		base: "border-2 border-border-2 bg-transparent",
		hover: "hover:border-(--primary) hover:bg-card-hover",
		selected: "border-(--primary) bg-primary-100 dark:bg-primary-800",
		pressed: "pressed:scale-95"
	}
};
/**
* ToggleButton component based on React Aria Components
*
* A button that can be toggled between selected and unselected states.
* Provides built-in accessibility features including proper ARIA attributes,
* keyboard navigation, and focus management.
*
* @example
* ```tsx
* <ToggleButton>
*   Toggle me
* </ToggleButton>
*
* <ToggleButton isSelected variant="primary">
*   Selected
* </ToggleButton>
* ```
*/
var ToggleButton$1 = ({ variant = "default", className = "", children, ...props }) => {
	const styles = variantStyles[variant];
	return /* @__PURE__ */ jsx(ToggleButton, {
		...props,
		className: ({ isSelected, isPressed, isHovered, isFocusVisible }) => {
			return cn(...[
				"px-4 py-2 rounded-lg",
				"transition-all duration-200",
				"cursor-pointer",
				"outline-none",
				styles.base,
				isSelected ? styles.selected : styles.hover,
				isPressed && styles.pressed,
				isFocusVisible && "ring-2 ring-(--focus-ring) ring-offset-2",
				"disabled:opacity-50 disabled:cursor-not-allowed",
				className
			]);
		},
		children
	});
};
//#endregion
export { ToggleButton$1 as ToggleButton };

//# sourceMappingURL=ToggleButton.js.map