"use client";
import * as React from "react";
import { useIsoLayoutEffect } from "../../../utils/esm/useIsoLayoutEffect.js";
import { isSafari } from "../../../utils/esm/detectBrowser.js";
import { visuallyHidden } from "../../../utils/esm/visuallyHidden.js";
import { jsx } from "react/jsx-runtime";
const FocusGuard = /* @__PURE__ */ React.forwardRef(function FocusGuard2(props, ref) {
  const [role, setRole] = React.useState();
  useIsoLayoutEffect(() => {
    if (isSafari) {
      setRole("button");
    }
  }, []);
  const restProps = {
    tabIndex: 0,
    // Role is only for VoiceOver
    role
  };
  return /* @__PURE__ */ jsx("span", {
    ...props,
    ref,
    style: visuallyHidden,
    "aria-hidden": role ? void 0 : true,
    ...restProps,
    "data-base-ui-focus-guard": ""
  });
});
if (process.env.NODE_ENV !== "production") FocusGuard.displayName = "FocusGuard";
export {
  FocusGuard
};
//# sourceMappingURL=FocusGuard.js.map
