import { jsx as a } from "react/jsx-runtime";
import { classNames as d } from "./index-classNames.js";
import { Icon as p, IconSize as k } from "./index-Icon.js";
import { IconNames as o } from "./index-IconNames.js";
import { useState as I, useEffect as x } from "react";
import s from "./index-CheckBoxIcon.module.scss.js";
const C = (m) => {
  const {
    isChecked: e,
    intermediate: c,
    isHovered: r,
    hoverMode: t,
    size: f
  } = m, [u, n] = I(!0);
  x(() => {
    let i = -1;
    return r && (i = setTimeout(() => n(!0), 10)), e && n(!0), () => clearTimeout(i);
  }, [e, c, r, t]);
  const h = () => r && t === "check" && !e ? o.check : e ? c ? o.remove : o.check : o.check, l = () => r && t === "check" && !e ? "--p300" : e ? "--n000" : "--fn0bg";
  return a(p, {
    type: k.small,
    color: l(),
    className: d(s.checkboxIcon, u ? s.show : void 0),
    forceSize: f === "small" ? 10 : void 0,
    children: h()
  });
};
export {
  C as CheckBoxIcon
};
