UNPKG

@shopgate/engage

Version:
8 lines 867 B
import React from'react';import PropTypes from'prop-types';import{css}from'glamor';var styles={root:css({position:'absolute !important',height:'1px',width:'1px',overflow:'hidden',clip:'rect(1px, 1px, 1px, 1px)',whiteSpace:'nowrap'})};/** * This component surrounds its children with a wrapper that takes care that they are not visible * on the screen, but still accessible by a screen reader. * @param {Object} props The component props * @param {Object} [props.tag='span'] The tag to be used for the component * @param {Object} props.children Component children * @returns {JSX.Element} */var VisuallyHidden=function VisuallyHidden(_ref){var _ref$tag=_ref.tag,tag=_ref$tag===void 0?'span':_ref$tag,children=_ref.children;return React.createElement(tag,{className:styles.root},children);};VisuallyHidden.defaultProps={tag:'span'};export default VisuallyHidden;