"use strict";
const jsxRuntime = require("react/jsx-runtime");
const React = require("react");
const styles_lib_components_Box_Box_cjs = require("../Box/Box.cjs");
const styles_lib_components_Accordion_AccordionItem_cjs = require("../Accordion/AccordionItem.cjs");
const styles_lib_components_Heading_Heading_cjs = require("../Heading/Heading.cjs");
const styles_lib_components_Accordion_Accordion_cjs = require("../Accordion/Accordion.cjs");
const styles_lib_components_HiddenVisually_HiddenVisually_css_cjs = require("./HiddenVisually.css.cjs");
const HiddenVisually = ({
  id,
  data,
  children,
  ...restProps
}) => {
  const inText = Boolean(React.useContext(styles_lib_components_Accordion_AccordionItem_cjs.TextContext));
  const inHeading = Boolean(React.useContext(styles_lib_components_Heading_Heading_cjs.HeadingContext));
  const component = inText || inHeading ? "span" : "div";
  return /* @__PURE__ */ jsxRuntime.jsx(
    styles_lib_components_Box_Box_cjs.Box,
    {
      component,
      id,
      position: "absolute",
      overflow: "hidden",
      className: styles_lib_components_HiddenVisually_HiddenVisually_css_cjs.root,
      ...styles_lib_components_Accordion_Accordion_cjs.buildDataAttributes({ data, validateRestProps: restProps }),
      children
    }
  );
};
exports.HiddenVisually = HiddenVisually;
