import { a as IconSize, n as AnalyticsId } from "./constants2.js";
import classNames from "classnames";
import React, { useId } from "react";
import { jsx, jsxs } from "react/jsx-runtime";
const Icon = (props) => {
	const { svgIcon, ariaLabel, className = "", size = IconSize.Small, color = "black", hoverColor = color || "black", isHovered = false, onColor, testId, ref, ...other } = props;
	const svgRaw = React.createElement(svgIcon, {
		size,
		isHovered,
		onColor
	});
	const titleId = useId();
	const svgColor = isHovered ? hoverColor : color;
	return /* @__PURE__ */ jsxs("svg", {
		"data-testid": testId,
		"data-analyticsid": AnalyticsId.Icon,
		ref,
		className: classNames(`hnds-style-icon`, className),
		role: ariaLabel ? "img" : "presentation",
		"aria-labelledby": ariaLabel ? titleId : void 0,
		focusable: false,
		"aria-hidden": ariaLabel ? void 0 : true,
		viewBox: "0 0 48 48",
		style: {
			minWidth: size,
			minHeight: size
		},
		width: size,
		height: size,
		fill: svgColor,
		color: svgColor,
		...other,
		children: [ariaLabel && /* @__PURE__ */ jsx("title", {
			id: titleId,
			children: ariaLabel
		}), svgRaw]
	});
};
Icon.displayName = "Icon";
var Icon_default = Icon;
export { Icon as n, Icon_default as t };

//# sourceMappingURL=Icon.js.map