@radix-ui/react-visually-hidden 0.0.0-20250116175529

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # `react-visually-hidden`
2
+
3
+ ## Installation
4
+
5
+ ```sh
6
+ $ yarn add @radix-ui/react-visually-hidden
7
+ # or
8
+ $ npm install @radix-ui/react-visually-hidden
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ View docs [here](https://radix-ui.com/primitives/docs/utilities/visually-hidden).
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { Primitive } from '@radix-ui/react-primitive';
3
+
4
+ type PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;
5
+ interface VisuallyHiddenProps extends PrimitiveSpanProps {
6
+ }
7
+ declare const VisuallyHidden: React.ForwardRefExoticComponent<VisuallyHiddenProps & React.RefAttributes<HTMLSpanElement>>;
8
+ declare const Root: React.ForwardRefExoticComponent<VisuallyHiddenProps & React.RefAttributes<HTMLSpanElement>>;
9
+
10
+ export { Root, VisuallyHidden, type VisuallyHiddenProps };
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { Primitive } from '@radix-ui/react-primitive';
3
+
4
+ type PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;
5
+ interface VisuallyHiddenProps extends PrimitiveSpanProps {
6
+ }
7
+ declare const VisuallyHidden: React.ForwardRefExoticComponent<VisuallyHiddenProps & React.RefAttributes<HTMLSpanElement>>;
8
+ declare const Root: React.ForwardRefExoticComponent<VisuallyHiddenProps & React.RefAttributes<HTMLSpanElement>>;
9
+
10
+ export { Root, VisuallyHidden, type VisuallyHiddenProps };
package/dist/index.js ADDED
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // packages/react/visually-hidden/src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ Root: () => Root,
34
+ VisuallyHidden: () => VisuallyHidden
35
+ });
36
+ module.exports = __toCommonJS(src_exports);
37
+
38
+ // packages/react/visually-hidden/src/VisuallyHidden.tsx
39
+ var React = __toESM(require("react"));
40
+ var import_react_primitive = require("@radix-ui/react-primitive");
41
+ var import_jsx_runtime = require("react/jsx-runtime");
42
+ var NAME = "VisuallyHidden";
43
+ var VisuallyHidden = React.forwardRef(
44
+ (props, forwardedRef) => {
45
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
46
+ import_react_primitive.Primitive.span,
47
+ {
48
+ ...props,
49
+ ref: forwardedRef,
50
+ style: {
51
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
52
+ position: "absolute",
53
+ border: 0,
54
+ width: 1,
55
+ height: 1,
56
+ padding: 0,
57
+ margin: -1,
58
+ overflow: "hidden",
59
+ clip: "rect(0, 0, 0, 0)",
60
+ whiteSpace: "nowrap",
61
+ wordWrap: "normal",
62
+ ...props.style
63
+ }
64
+ }
65
+ );
66
+ }
67
+ );
68
+ VisuallyHidden.displayName = NAME;
69
+ var Root = VisuallyHidden;
70
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts", "../src/VisuallyHidden.tsx"],
4
+ "sourcesContent": ["export {\n VisuallyHidden,\n //\n Root,\n} from './VisuallyHidden';\nexport type { VisuallyHiddenProps } from './VisuallyHidden';\n", "import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * VisuallyHidden\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'VisuallyHidden';\n\ntype VisuallyHiddenElement = React.ElementRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface VisuallyHiddenProps extends PrimitiveSpanProps {}\n\nconst VisuallyHidden = React.forwardRef<VisuallyHiddenElement, VisuallyHiddenProps>(\n (props, forwardedRef) => {\n return (\n <Primitive.span\n {...props}\n ref={forwardedRef}\n style={{\n // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style,\n }}\n />\n );\n }\n);\n\nVisuallyHidden.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = VisuallyHidden;\n\nexport {\n VisuallyHidden,\n //\n Root,\n};\nexport type { VisuallyHiddenProps };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,6BAA0B;AAepB;AATN,IAAM,OAAO;AAMb,IAAM,iBAAuB;AAAA,EAC3B,CAAC,OAAO,iBAAiB;AACvB,WACE;AAAA,MAAC,iCAAU;AAAA,MAAV;AAAA,QACE,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,OAAO;AAAA;AAAA,UAEL,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,UAAU;AAAA,UACV,MAAM;AAAA,UACN,YAAY;AAAA,UACZ,UAAU;AAAA,UACV,GAAG,MAAM;AAAA,QACX;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,eAAe,cAAc;AAI7B,IAAM,OAAO;",
6
+ "names": []
7
+ }
package/dist/index.mjs ADDED
@@ -0,0 +1,37 @@
1
+ // packages/react/visually-hidden/src/VisuallyHidden.tsx
2
+ import * as React from "react";
3
+ import { Primitive } from "@radix-ui/react-primitive";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var NAME = "VisuallyHidden";
6
+ var VisuallyHidden = React.forwardRef(
7
+ (props, forwardedRef) => {
8
+ return /* @__PURE__ */ jsx(
9
+ Primitive.span,
10
+ {
11
+ ...props,
12
+ ref: forwardedRef,
13
+ style: {
14
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
15
+ position: "absolute",
16
+ border: 0,
17
+ width: 1,
18
+ height: 1,
19
+ padding: 0,
20
+ margin: -1,
21
+ overflow: "hidden",
22
+ clip: "rect(0, 0, 0, 0)",
23
+ whiteSpace: "nowrap",
24
+ wordWrap: "normal",
25
+ ...props.style
26
+ }
27
+ }
28
+ );
29
+ }
30
+ );
31
+ VisuallyHidden.displayName = NAME;
32
+ var Root = VisuallyHidden;
33
+ export {
34
+ Root,
35
+ VisuallyHidden
36
+ };
37
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/VisuallyHidden.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * VisuallyHidden\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'VisuallyHidden';\n\ntype VisuallyHiddenElement = React.ElementRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface VisuallyHiddenProps extends PrimitiveSpanProps {}\n\nconst VisuallyHidden = React.forwardRef<VisuallyHiddenElement, VisuallyHiddenProps>(\n (props, forwardedRef) => {\n return (\n <Primitive.span\n {...props}\n ref={forwardedRef}\n style={{\n // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style,\n }}\n />\n );\n }\n);\n\nVisuallyHidden.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = VisuallyHidden;\n\nexport {\n VisuallyHidden,\n //\n Root,\n};\nexport type { VisuallyHiddenProps };\n"],
5
+ "mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,iBAAiB;AAepB;AATN,IAAM,OAAO;AAMb,IAAM,iBAAuB;AAAA,EAC3B,CAAC,OAAO,iBAAiB;AACvB,WACE;AAAA,MAAC,UAAU;AAAA,MAAV;AAAA,QACE,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,OAAO;AAAA;AAAA,UAEL,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,UAAU;AAAA,UACV,MAAM;AAAA,UACN,YAAY;AAAA,UACZ,UAAU;AAAA,UACV,GAAG,MAAM;AAAA,QACX;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,eAAe,cAAc;AAI7B,IAAM,OAAO;",
6
+ "names": []
7
+ }
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@radix-ui/react-visually-hidden",
3
+ "version": "0.0.0-20250116175529",
4
+ "license": "MIT",
5
+ "exports": {
6
+ ".": {
7
+ "import": {
8
+ "types": "./dist/index.d.mts",
9
+ "default": "./dist/index.mjs"
10
+ },
11
+ "require": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ }
15
+ }
16
+ },
17
+ "source": "./src/index.ts",
18
+ "main": "./dist/index.js",
19
+ "module": "./dist/index.mjs",
20
+ "types": "./dist/index.d.ts",
21
+ "files": [
22
+ "dist",
23
+ "README.md"
24
+ ],
25
+ "sideEffects": false,
26
+ "scripts": {
27
+ "clean": "rm -rf dist"
28
+ },
29
+ "dependencies": {
30
+ "@radix-ui/react-primitive": "workspace:*"
31
+ },
32
+ "peerDependencies": {
33
+ "@types/react": "*",
34
+ "@types/react-dom": "*",
35
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
36
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
37
+ },
38
+ "peerDependenciesMeta": {
39
+ "@types/react": {
40
+ "optional": true
41
+ },
42
+ "@types/react-dom": {
43
+ "optional": true
44
+ }
45
+ },
46
+ "homepage": "https://radix-ui.com/primitives",
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/radix-ui/primitives.git"
50
+ },
51
+ "bugs": {
52
+ "url": "https://github.com/radix-ui/primitives/issues"
53
+ }
54
+ }