UNPKG

@ariakit/react

Version:

Toolkit for building accessible web apps with React

39 lines (29 loc) 1.01 kB
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _LZ6L3ECGcjs = require('./LZ6L3ECG.cjs'); // ../ariakit-react-components/dist/visually-hidden/visually-hidden.js var TagName = "span"; function getVisuallyHiddenStyle(style) { return { borderWidth: 0, clipPath: "inset(50%)", height: "1px", margin: "-1px", overflow: "hidden", padding: 0, position: "absolute", whiteSpace: "nowrap", width: "1px", ...style }; } var useVisuallyHidden = _LZ6L3ECGcjs.createHook.call(void 0, function useVisuallyHidden2(props) { props = { ...props, style: getVisuallyHiddenStyle(props.style) }; return props; }); var VisuallyHidden = _LZ6L3ECGcjs.forwardRef.call(void 0, function VisuallyHidden2(props) { return _LZ6L3ECGcjs.createElement.call(void 0, TagName, useVisuallyHidden(props)); }); exports.getVisuallyHiddenStyle = getVisuallyHiddenStyle; exports.useVisuallyHidden = useVisuallyHidden; exports.VisuallyHidden = VisuallyHidden;