"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.VisuallyHidden = void 0;
var _context = require("../context");
var _styles = require("./styles");
var _view = require("../view");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * External dependencies
 */

/**
 * Internal dependencies
 */

function UnconnectedVisuallyHidden(props, forwardedRef) {
  const {
    style: styleProp,
    ...contextProps
  } = (0, _context.useContextSystem)(props, 'VisuallyHidden');
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_view.View, {
    ref: forwardedRef,
    ...contextProps,
    style: {
      ..._styles.visuallyHidden,
      ...(styleProp || {})
    }
  });
}

/**
 * `VisuallyHidden` is a component used to render text intended to be visually
 * hidden, but will show for alternate devices, for example a screen reader.
 *
 * ```jsx
 * import { VisuallyHidden } from `@wordpress/components`;
 *
 * function Example() {
 *   return (
 *     <VisuallyHidden>
 *       <label>Code is Poetry</label>
 *     </VisuallyHidden>
 *   );
 * }
 * ```
 */
const VisuallyHidden = exports.VisuallyHidden = (0, _context.contextConnect)(UnconnectedVisuallyHidden, 'VisuallyHidden');
var _default = exports.default = VisuallyHidden;
//# sourceMappingURL=component.js.map