"use strict";
const assert = require("assert");
const clsx = require("clsx");
const React = require("react");
const styles_lib_css_atoms_atoms_cjs = require("../../css/atoms/atoms.cjs");
const styles_lib_components_Heading_Heading_cjs = require("../Heading/Heading.cjs");
const styles_lib_components_Accordion_AccordionItem_cjs = require("../Accordion/AccordionItem.cjs");
const styles_lib_hooks_useIcon_icon_css_cjs = require("../../hooks/useIcon/icon.css.cjs");
const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
const assert__default = /* @__PURE__ */ _interopDefaultCompat(assert);
const clsx__default = /* @__PURE__ */ _interopDefaultCompat(clsx);
const iconInlineSize = ({
  alignY = "uppercase",
  verticalCorrection = "none"
} = {}) => clsx__default.default(
  styles_lib_css_atoms_atoms_cjs.atoms({
    display: "inlineBlock",
    position: "relative"
  }),
  styles_lib_hooks_useIcon_icon_css_cjs.size,
  styles_lib_hooks_useIcon_icon_css_cjs.inlineCrop,
  styles_lib_hooks_useIcon_icon_css_cjs.inline,
  styles_lib_hooks_useIcon_icon_css_cjs.alignY[alignY][verticalCorrection]
);
const IconRenderer = ({ children }) => {
  const textContext = React.useContext(styles_lib_components_Accordion_AccordionItem_cjs.TextContext);
  const headingContext = React.useContext(styles_lib_components_Heading_Heading_cjs.HeadingContext);
  assert__default.default(
    Boolean(textContext || headingContext),
    `IconRenderer must be inside either a \`Text\` or \`Heading\` component.`
  );
  return children({ className: iconInlineSize() });
};
exports.IconRenderer = IconRenderer;
exports.iconInlineSize = iconInlineSize;
