/**
 * Copyright IBM Corp. 2020, 2026
 *
 * This source code is licensed under the Apache-2.0 license found in the
 * LICENSE file in the root directory of this source tree.
 */

import { __toESM } from "../../_virtual/_rolldown/runtime.js";
import { require_classnames } from "../../node_modules/classnames/index.js";
import { pkg } from "../../settings.js";
import { getDevtoolsProps } from "../../global/js/utils/devtools.js";
import React from "react";
import PropTypes from "prop-types";
import { Caution, ChevronMini, CircleFill, CircleStroke, DiamondFill, SquareFill } from "@carbon/react/icons";

//#region src/components/DecoratorBase/DecoratorIcon.jsx
/**
* Copyright IBM Corp. 2024, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
var import_classnames = /* @__PURE__ */ __toESM(require_classnames());
const blockClass = `${pkg.prefix}--decorator-icon`;
const componentName = "DecoratorIcon";
const defaults = {
	magnitude: "unknown",
	small: false
};
/**
* The shape and color of the Decorator's icon.
*/
let DecoratorIcon = React.forwardRef(({ className, magnitude = defaults.magnitude, small = defaults.small, ...rest }, ref) => {
	let Icon;
	switch (magnitude) {
		case "benign":
			Icon = CircleFill;
			break;
		case "low":
			Icon = SquareFill;
			break;
		case "medium":
			Icon = DiamondFill;
			break;
		case "high":
			Icon = Caution;
			break;
		case "critical":
			Icon = ChevronMini;
			break;
		default:
			Icon = CircleStroke;
			break;
	}
	return /* @__PURE__ */ React.createElement(Icon, {
		...rest,
		"aria-hidden": true,
		className: (0, import_classnames.default)(blockClass, className, `${blockClass}__magnitude-${magnitude}`, { [`${blockClass}--sm`]: small }),
		focusable: false,
		ref,
		viewBox: magnitude === "critical" ? "8 8 8 8" : "0 0 16 16",
		...getDevtoolsProps(componentName)
	});
});
DecoratorIcon = pkg.checkComponentEnabled(DecoratorIcon, componentName);
DecoratorIcon.displayName = componentName;
DecoratorIcon.propTypes = {
	className: PropTypes.string,
	magnitude: PropTypes.oneOf([
		"unknown",
		"benign",
		"low",
		"medium",
		"high",
		"critical"
	]),
	small: PropTypes.bool
};

//#endregion
export { DecoratorIcon };