import { jsx as f } from "react/jsx-runtime";
import { useRef as u, useEffect as m } from "react";
import { mergeRefs as p } from "@chakra-ui/react";
import { $ as b } from "./useObjectRef-CaJ5pgjX.es.js";
import { B as d } from "./button-BEJnxXsL.es.js";
const h = (e) => {
  const { children: a, ref: s, ...o } = e, r = u(null), i = b(p(r, s));
  return m(() => {
    if (process.env.NODE_ENV !== "production") {
      const n = setTimeout(() => {
        const t = r.current;
        if (t) {
          const l = t.hasAttribute("aria-label") || t.hasAttribute("aria-labelledby"), c = t.hasAttribute("slot");
          !l && !c && console.warn(
            `Nimbus: IconButton requires an accessible label. Either provide an 'aria-label' prop or use within a component that provides it via context (e.g., slot="clear" in ComboBox).`,
            t
          );
        }
      }, 0);
      return () => clearTimeout(n);
    }
  }, [e["aria-label"], o.slot]), /* @__PURE__ */ f(d, { px: 0, py: 0, ...o, ref: i, children: a });
};
h.displayName = "IconButton";
export {
  h as I
};
//# sourceMappingURL=icon-button-CosIm3oY.es.js.map
