UNPKG

3.39 kBJavaScriptView Raw
1"use strict";
2/**
3 * @reach/visually-hidden v0.18.0
4 *
5 * Copyright (c) 2018-2022, React Training LLC
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE.md file in the root directory of this source tree.
9 *
10 * @license MIT
11 */
12
13var __create = Object.create;
14var __defProp = Object.defineProperty;
15var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
16var __getOwnPropNames = Object.getOwnPropertyNames;
17var __getOwnPropSymbols = Object.getOwnPropertySymbols;
18var __getProtoOf = Object.getPrototypeOf;
19var __hasOwnProp = Object.prototype.hasOwnProperty;
20var __propIsEnum = Object.prototype.propertyIsEnumerable;
21var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
22var __spreadValues = (a, b) => {
23 for (var prop in b || (b = {}))
24 if (__hasOwnProp.call(b, prop))
25 __defNormalProp(a, prop, b[prop]);
26 if (__getOwnPropSymbols)
27 for (var prop of __getOwnPropSymbols(b)) {
28 if (__propIsEnum.call(b, prop))
29 __defNormalProp(a, prop, b[prop]);
30 }
31 return a;
32};
33var __objRest = (source, exclude) => {
34 var target = {};
35 for (var prop in source)
36 if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
37 target[prop] = source[prop];
38 if (source != null && __getOwnPropSymbols)
39 for (var prop of __getOwnPropSymbols(source)) {
40 if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
41 target[prop] = source[prop];
42 }
43 return target;
44};
45var __export = (target, all) => {
46 for (var name in all)
47 __defProp(target, name, { get: all[name], enumerable: true });
48};
49var __copyProps = (to, from, except, desc) => {
50 if (from && typeof from === "object" || typeof from === "function") {
51 for (let key of __getOwnPropNames(from))
52 if (!__hasOwnProp.call(to, key) && key !== except)
53 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
54 }
55 return to;
56};
57var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
58var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
59
60// src/reach-visually-hidden.tsx
61var reach_visually_hidden_exports = {};
62__export(reach_visually_hidden_exports, {
63 VisuallyHidden: () => VisuallyHidden
64});
65module.exports = __toCommonJS(reach_visually_hidden_exports);
66var React = __toESM(require("react"));
67var VisuallyHidden = React.forwardRef(function VisuallyHidden2(_a, ref) {
68 var _b = _a, { as: Comp = "span", style = {} } = _b, props = __objRest(_b, ["as", "style"]);
69 return /* @__PURE__ */ React.createElement(Comp, __spreadValues({
70 ref,
71 style: __spreadValues({
72 border: 0,
73 clip: "rect(0 0 0 0)",
74 height: "1px",
75 margin: "-1px",
76 overflow: "hidden",
77 padding: 0,
78 position: "absolute",
79 width: "1px",
80 whiteSpace: "nowrap",
81 wordWrap: "normal"
82 }, style)
83 }, props));
84});
85VisuallyHidden.displayName = "VisuallyHidden";
86// Annotate the CommonJS export names for ESM import in node:
870 && (module.exports = {
88 VisuallyHidden
89});
90//# sourceMappingURL=reach-visually-hidden.cjs.dev.js.map
\No newline at end of file