/**
 * 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 { Kinds, Themes } from "./Checklist.types.js";
import React from "react";
import PropTypes from "prop-types";
import { CheckmarkOutline, CircleDash, Incomplete, Warning } from "@carbon/react/icons";

//#region src/components/Checklist/ChecklistIcon.jsx
/**
* Copyright IBM Corp. 2023, 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.
*/
/**
* TODO: Breakdown titles, icons, clickable items into sub-components
* See
*   ModifiedTabs (ModifiedTabLabelNew, ModifiedTabLabelWithClose)
*   PageHeader (PageHeaderTitle, PageHeaderUtils)
*/
var import_classnames = /* @__PURE__ */ __toESM(require_classnames());
const blockClass = `${pkg.prefix}--checklist__icon`;
const componentName = "ChecklistIcon";
const defaults = { theme: Themes.light };
/**
* TODO: A description of the component.
*/
let ChecklistIcon = React.forwardRef(
	/**
	* @param {{className?: string, kind?: import('./Checklist.types').Kind, theme?: import('./Checklist.types').Theme}} props type description
	*/
	({ className, kind, theme = defaults.theme, ...rest }, ref) => {
		let Icon;
		switch (kind) {
			case "error":
				Icon = Warning;
				break;
			case "indeterminate":
				Icon = Incomplete;
				break;
			case "checked":
				Icon = CheckmarkOutline;
				break;
			default:
				Icon = CircleDash;
				break;
		}
		return /* @__PURE__ */ React.createElement("span", {
			...rest,
			className: (0, import_classnames.default)(blockClass, className, `${blockClass}--${kind}`, `${blockClass}__${theme}`),
			ref,
			...getDevtoolsProps(componentName)
		}, /* @__PURE__ */ React.createElement(Icon, { size: 16 }));
	}
);
ChecklistIcon.propTypes = {
	className: PropTypes.string,
	kind: PropTypes.oneOf([
		Kinds.unchecked,
		Kinds.indeterminate,
		Kinds.checked,
		Kinds.disabled,
		Kinds.error
	]),
	theme: PropTypes.oneOf([Themes.light, Themes.dark])
};

//#endregion
export { ChecklistIcon };