@tamagui/visually-hidden 2.7.6 → 3.0.0-beta.637.1
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/dist/cjs/VisuallyHidden.cjs +76 -48
- package/dist/cjs/VisuallyHidden.native.cjs +90 -0
- package/dist/cjs/VisuallyHidden.native.js +76 -47
- package/dist/cjs/VisuallyHidden.native.js.map +1 -1
- package/dist/cjs/index.cjs +10 -11
- package/dist/cjs/index.native.cjs +21 -0
- package/dist/cjs/index.native.js +10 -10
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/VisuallyHidden.mjs +64 -31
- package/dist/esm/VisuallyHidden.mjs.map +1 -1
- package/dist/esm/VisuallyHidden.native.js +64 -31
- package/dist/esm/VisuallyHidden.native.js.map +1 -1
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.mjs +1 -2
- package/dist/esm/index.native.js +1 -2
- package/package.json +4 -3
- package/src/VisuallyHidden.tsx +63 -12
- package/types/VisuallyHidden.d.ts.map +2 -2
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
|
@@ -1,60 +1,88 @@
|
|
|
1
|
+
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
6
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
for (var name in all) __defProp(target, name, {
|
|
8
|
+
get: all[name],
|
|
9
|
+
enumerable: true
|
|
10
|
+
});
|
|
10
11
|
};
|
|
11
12
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
19
20
|
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: true
|
|
22
|
-
}), mod);
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
22
|
var VisuallyHidden_exports = {};
|
|
24
|
-
__export(VisuallyHidden_exports, {
|
|
25
|
-
VisuallyHidden: () => VisuallyHidden
|
|
26
|
-
});
|
|
23
|
+
__export(VisuallyHidden_exports, { VisuallyHidden: () => VisuallyHidden });
|
|
27
24
|
module.exports = __toCommonJS(VisuallyHidden_exports);
|
|
25
|
+
var import_constants = require("@tamagui/constants");
|
|
28
26
|
var import_web = require("@tamagui/web");
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
const VisuallyHiddenFrame = (0, import_web.styled)(import_web.Text, {
|
|
29
|
+
displayName: "VisuallyHidden",
|
|
30
|
+
position: "absolute",
|
|
31
|
+
width: 1,
|
|
32
|
+
height: 1,
|
|
33
|
+
margin: -1,
|
|
34
|
+
padding: 0,
|
|
35
|
+
borderWidth: 0,
|
|
36
|
+
zIndex: -1e4,
|
|
37
|
+
overflow: "hidden",
|
|
38
|
+
pointerEvents: "none",
|
|
39
|
+
...import_constants.isWeb && {
|
|
40
|
+
clip: "rect(0, 0, 0, 0)",
|
|
41
|
+
clipPath: "inset(50%)",
|
|
42
|
+
whiteSpace: "nowrap",
|
|
43
|
+
wordWrap: "normal"
|
|
44
|
+
},
|
|
45
|
+
variants: {
|
|
46
|
+
preserveDimensions: { true: {
|
|
47
|
+
position: "relative",
|
|
48
|
+
width: "auto",
|
|
49
|
+
height: "auto"
|
|
50
|
+
} },
|
|
51
|
+
visible: { true: {
|
|
52
|
+
position: "relative",
|
|
53
|
+
width: "auto",
|
|
54
|
+
height: "auto",
|
|
55
|
+
margin: 0,
|
|
56
|
+
padding: 0,
|
|
57
|
+
zIndex: 1,
|
|
58
|
+
overflow: "visible",
|
|
59
|
+
opacity: 1,
|
|
60
|
+
pointerEvents: "auto",
|
|
61
|
+
...import_constants.isWeb && {
|
|
62
|
+
clip: "auto",
|
|
63
|
+
clipPath: "none",
|
|
64
|
+
whiteSpace: "normal"
|
|
65
|
+
}
|
|
66
|
+
} }
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const VisuallyHidden = (0, import_web.createStyledHOC)(VisuallyHiddenFrame, function VisuallyHidden2(props, forwardedRef) {
|
|
70
|
+
const { visible, ...rest } = props;
|
|
71
|
+
if (visible) {
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VisuallyHiddenFrame, {
|
|
73
|
+
ref: forwardedRef,
|
|
74
|
+
visible: true,
|
|
75
|
+
...rest
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
const a11yProps = import_constants.isWeb ? { "aria-hidden": false } : {
|
|
79
|
+
accessible: true,
|
|
80
|
+
...import_constants.isAndroid && { importantForAccessibility: "yes" }
|
|
81
|
+
};
|
|
82
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VisuallyHiddenFrame, {
|
|
83
|
+
ref: forwardedRef,
|
|
84
|
+
...a11yProps,
|
|
85
|
+
...rest
|
|
86
|
+
});
|
|
59
87
|
});
|
|
60
|
-
VisuallyHidden["isVisuallyHidden"] = true;
|
|
88
|
+
VisuallyHidden["isVisuallyHidden"] = true;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var VisuallyHidden_exports = {};
|
|
25
|
+
__export(VisuallyHidden_exports, { VisuallyHidden: () => VisuallyHidden });
|
|
26
|
+
module.exports = __toCommonJS(VisuallyHidden_exports);
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
var import_constants = require("@tamagui/constants");
|
|
29
|
+
var import_web = require("@tamagui/web");
|
|
30
|
+
var VisuallyHiddenFrame = (0, import_web.styled)(import_web.Text, {
|
|
31
|
+
displayName: "VisuallyHidden",
|
|
32
|
+
position: "absolute",
|
|
33
|
+
width: 1,
|
|
34
|
+
height: 1,
|
|
35
|
+
margin: -1,
|
|
36
|
+
padding: 0,
|
|
37
|
+
borderWidth: 0,
|
|
38
|
+
zIndex: -1e4,
|
|
39
|
+
overflow: "hidden",
|
|
40
|
+
pointerEvents: "none",
|
|
41
|
+
...import_constants.isWeb && {
|
|
42
|
+
clip: "rect(0, 0, 0, 0)",
|
|
43
|
+
clipPath: "inset(50%)",
|
|
44
|
+
whiteSpace: "nowrap",
|
|
45
|
+
wordWrap: "normal"
|
|
46
|
+
},
|
|
47
|
+
variants: {
|
|
48
|
+
preserveDimensions: { true: {
|
|
49
|
+
position: "relative",
|
|
50
|
+
width: "auto",
|
|
51
|
+
height: "auto"
|
|
52
|
+
} },
|
|
53
|
+
visible: { true: {
|
|
54
|
+
position: "relative",
|
|
55
|
+
width: "auto",
|
|
56
|
+
height: "auto",
|
|
57
|
+
margin: 0,
|
|
58
|
+
padding: 0,
|
|
59
|
+
zIndex: 1,
|
|
60
|
+
overflow: "visible",
|
|
61
|
+
opacity: 1,
|
|
62
|
+
pointerEvents: "auto",
|
|
63
|
+
...import_constants.isWeb && {
|
|
64
|
+
clip: "auto",
|
|
65
|
+
clipPath: "none",
|
|
66
|
+
whiteSpace: "normal"
|
|
67
|
+
}
|
|
68
|
+
} }
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
var VisuallyHidden = (0, import_web.createStyledHOC)(VisuallyHiddenFrame, function VisuallyHidden2(props, forwardedRef) {
|
|
72
|
+
var { visible, ...rest } = props;
|
|
73
|
+
if (visible) {
|
|
74
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VisuallyHiddenFrame, {
|
|
75
|
+
ref: forwardedRef,
|
|
76
|
+
visible: true,
|
|
77
|
+
...rest
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
var a11yProps = import_constants.isWeb ? { "aria-hidden": false } : {
|
|
81
|
+
accessible: true,
|
|
82
|
+
...import_constants.isAndroid && { importantForAccessibility: "yes" }
|
|
83
|
+
};
|
|
84
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VisuallyHiddenFrame, {
|
|
85
|
+
ref: forwardedRef,
|
|
86
|
+
...a11yProps,
|
|
87
|
+
...rest
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
VisuallyHidden["isVisuallyHidden"] = true;
|
|
@@ -1,63 +1,92 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
8
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
12
13
|
};
|
|
13
14
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
21
22
|
};
|
|
22
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
-
value: true
|
|
24
|
-
}), mod);
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
24
|
var VisuallyHidden_exports = {};
|
|
26
|
-
__export(VisuallyHidden_exports, {
|
|
27
|
-
VisuallyHidden: () => VisuallyHidden
|
|
28
|
-
});
|
|
25
|
+
__export(VisuallyHidden_exports, { VisuallyHidden: () => VisuallyHidden });
|
|
29
26
|
module.exports = __toCommonJS(VisuallyHidden_exports);
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
var import_constants = require("@tamagui/constants");
|
|
30
29
|
var import_web = require("@tamagui/web");
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
30
|
+
var VisuallyHiddenFrame = (0, import_web.styled)(import_web.Text, {
|
|
31
|
+
displayName: "VisuallyHidden",
|
|
32
|
+
position: "absolute",
|
|
33
|
+
width: 1,
|
|
34
|
+
height: 1,
|
|
35
|
+
margin: -1,
|
|
36
|
+
padding: 0,
|
|
37
|
+
borderWidth: 0,
|
|
38
|
+
zIndex: -1e4,
|
|
39
|
+
overflow: "hidden",
|
|
40
|
+
pointerEvents: "none",
|
|
41
|
+
...import_constants.isWeb && {
|
|
42
|
+
clip: "rect(0, 0, 0, 0)",
|
|
43
|
+
clipPath: "inset(50%)",
|
|
44
|
+
whiteSpace: "nowrap",
|
|
45
|
+
wordWrap: "normal"
|
|
46
|
+
},
|
|
47
|
+
variants: {
|
|
48
|
+
preserveDimensions: { true: {
|
|
49
|
+
position: "relative",
|
|
50
|
+
width: "auto",
|
|
51
|
+
height: "auto"
|
|
52
|
+
} },
|
|
53
|
+
visible: { true: {
|
|
54
|
+
position: "relative",
|
|
55
|
+
width: "auto",
|
|
56
|
+
height: "auto",
|
|
57
|
+
margin: 0,
|
|
58
|
+
padding: 0,
|
|
59
|
+
zIndex: 1,
|
|
60
|
+
overflow: "visible",
|
|
61
|
+
opacity: 1,
|
|
62
|
+
pointerEvents: "auto",
|
|
63
|
+
...import_constants.isWeb && {
|
|
64
|
+
clip: "auto",
|
|
65
|
+
clipPath: "none",
|
|
66
|
+
whiteSpace: "normal"
|
|
67
|
+
}
|
|
68
|
+
} }
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
var VisuallyHidden = (0, import_web.createStyledHOC)(VisuallyHiddenFrame, function VisuallyHidden2(props, forwardedRef) {
|
|
72
|
+
var { visible, ...rest } = props;
|
|
73
|
+
if (visible) {
|
|
74
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VisuallyHiddenFrame, {
|
|
75
|
+
ref: forwardedRef,
|
|
76
|
+
visible: true,
|
|
77
|
+
...rest
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
var a11yProps = import_constants.isWeb ? { "aria-hidden": false } : {
|
|
81
|
+
accessible: true,
|
|
82
|
+
...import_constants.isAndroid && { importantForAccessibility: "yes" }
|
|
83
|
+
};
|
|
84
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VisuallyHiddenFrame, {
|
|
85
|
+
ref: forwardedRef,
|
|
86
|
+
...a11yProps,
|
|
87
|
+
...rest
|
|
88
|
+
});
|
|
61
89
|
});
|
|
62
90
|
VisuallyHidden["isVisuallyHidden"] = true;
|
|
91
|
+
|
|
63
92
|
//# sourceMappingURL=VisuallyHidden.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"VisuallyHidden.native.js","names":[],"sources":["cjs/VisuallyHidden.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar VisuallyHidden_exports = {};\n__export(VisuallyHidden_exports, {\n VisuallyHidden: () => VisuallyHidden\n});\nmodule.exports = __toCommonJS(VisuallyHidden_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_web = require(\"@tamagui/web\");\nvar VisuallyHiddenFrame = (0, import_web.styled)(import_web.Text, {\n displayName: \"VisuallyHidden\",\n position: \"absolute\",\n width: 1,\n height: 1,\n margin: -1,\n padding: 0,\n borderWidth: 0,\n zIndex: -1e4,\n overflow: \"hidden\",\n pointerEvents: \"none\",\n ...import_constants.isWeb && {\n // sr-only style block; clipPath is the modern replacement for clip\n // and is what tailwind's sr-only uses.\n clip: \"rect(0, 0, 0, 0)\",\n clipPath: \"inset(50%)\",\n whiteSpace: \"nowrap\",\n wordWrap: \"normal\"\n },\n variants: {\n preserveDimensions: {\n true: {\n position: \"relative\",\n width: \"auto\",\n height: \"auto\"\n }\n },\n // Escape hatch to fully reveal the element (the old \"not-sr-only\").\n visible: {\n true: {\n position: \"relative\",\n width: \"auto\",\n height: \"auto\",\n margin: 0,\n padding: 0,\n zIndex: 1,\n overflow: \"visible\",\n opacity: 1,\n pointerEvents: \"auto\",\n ...import_constants.isWeb && {\n clip: \"auto\",\n clipPath: \"none\",\n whiteSpace: \"normal\"\n }\n }\n }\n }\n});\nvar VisuallyHidden = (0, import_web.createStyledHOC)(VisuallyHiddenFrame, function VisuallyHidden2(props, forwardedRef) {\n var { visible, ...rest } = props;\n if (visible) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VisuallyHiddenFrame, {\n ref: forwardedRef,\n visible: true,\n ...rest\n });\n }\n var a11yProps = import_constants.isWeb ? {\n \"aria-hidden\": false\n } : {\n accessible: true,\n ...import_constants.isAndroid && {\n importantForAccessibility: \"yes\"\n }\n };\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VisuallyHiddenFrame, {\n ref: forwardedRef,\n ...a11yProps,\n ...rest\n });\n});\nVisuallyHidden[\"isVisuallyHidden\"] = true;\n//# sourceMappingURL=VisuallyHidden.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,yBAAyB,CAAC;AAC9B,SAAS,wBAAwB,EAC/B,sBAAsB,eACxB,CAAC;AACD,OAAO,UAAU,aAAa,sBAAsB;AACpD,IAAI,qBAAqB,QAAQ,mBAAmB;AACpD,IAAI,mBAAmB,QAAQ,oBAAoB;AACnD,IAAI,aAAa,QAAQ,cAAc;AACvC,IAAI,uBAAuB,GAAG,WAAW,QAAQ,WAAW,MAAM;CAChE,aAAa;CACb,UAAU;CACV,OAAO;CACP,QAAQ;CACR,QAAQ,CAAC;CACT,SAAS;CACT,aAAa;CACb,QAAQ,CAAC;CACT,UAAU;CACV,eAAe;CACf,GAAG,iBAAiB,SAAS;EAG3B,MAAM;EACN,UAAU;EACV,YAAY;EACZ,UAAU;CACZ;CACA,UAAU;EACR,oBAAoB,EAClB,MAAM;GACJ,UAAU;GACV,OAAO;GACP,QAAQ;EACV,EACF;EAEA,SAAS,EACP,MAAM;GACJ,UAAU;GACV,OAAO;GACP,QAAQ;GACR,QAAQ;GACR,SAAS;GACT,QAAQ;GACR,UAAU;GACV,SAAS;GACT,eAAe;GACf,GAAG,iBAAiB,SAAS;IAC3B,MAAM;IACN,UAAU;IACV,YAAY;GACd;EACF,EACF;CACF;AACF,CAAC;AACD,IAAI,kBAAkB,GAAG,WAAW,iBAAiB,qBAAqB,SAAS,gBAAgB,OAAO,cAAc;CACtH,IAAI,EAAE,SAAS,GAAG,SAAS;CAC3B,IAAI,SAAS;EACX,OAAuB,iBAAC,GAAG,mBAAmB,KAAK,qBAAqB;GACtE,KAAK;GACL,SAAS;GACT,GAAG;EACL,CAAC;CACH;CACA,IAAI,YAAY,iBAAiB,QAAQ,EACvC,eAAe,MACjB,IAAI;EACF,YAAY;EACZ,GAAG,iBAAiB,aAAa,EAC/B,2BAA2B,MAC7B;CACF;CACA,OAAuB,iBAAC,GAAG,mBAAmB,KAAK,qBAAqB;EACtE,KAAK;EACL,GAAG;EACH,GAAG;CACL,CAAC;AACH,CAAC;AACD,eAAe,sBAAsB"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
+
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
6
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
9
|
+
get: () => from[key],
|
|
10
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
13
14
|
};
|
|
14
15
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
16
|
-
value: true
|
|
17
|
-
}), mod);
|
|
16
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
17
|
var index_exports = {};
|
|
19
18
|
module.exports = __toCommonJS(index_exports);
|
|
20
|
-
__reExport(index_exports, require("./VisuallyHidden.cjs"), module.exports);
|
|
19
|
+
__reExport(index_exports, require("./VisuallyHidden.cjs"), module.exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
11
|
+
get: () => from[key],
|
|
12
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var index_exports = {};
|
|
20
|
+
module.exports = __toCommonJS(index_exports);
|
|
21
|
+
__reExport(index_exports, require("./VisuallyHidden.native.js"), module.exports);
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
8
|
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
11
|
+
get: () => from[key],
|
|
12
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
15
16
|
};
|
|
16
17
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
18
|
-
value: true
|
|
19
|
-
}), mod);
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
19
|
var index_exports = {};
|
|
21
20
|
module.exports = __toCommonJS(index_exports);
|
|
22
21
|
__reExport(index_exports, require("./VisuallyHidden.native.js"), module.exports);
|
|
22
|
+
|
|
23
23
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./VisuallyHidden\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,4BAAkB,GAAG,OAAO,OAAO"}
|
|
@@ -1,35 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { isAndroid, isWeb } from "@tamagui/constants";
|
|
2
|
+
import { Text, createStyledHOC, styled } from "@tamagui/web";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
const VisuallyHiddenFrame = styled(Text, {
|
|
6
|
+
displayName: "VisuallyHidden",
|
|
7
|
+
position: "absolute",
|
|
8
|
+
width: 1,
|
|
9
|
+
height: 1,
|
|
10
|
+
margin: -1,
|
|
11
|
+
padding: 0,
|
|
12
|
+
borderWidth: 0,
|
|
13
|
+
zIndex: -1e4,
|
|
14
|
+
overflow: "hidden",
|
|
15
|
+
pointerEvents: "none",
|
|
16
|
+
...isWeb && {
|
|
17
|
+
clip: "rect(0, 0, 0, 0)",
|
|
18
|
+
clipPath: "inset(50%)",
|
|
19
|
+
whiteSpace: "nowrap",
|
|
20
|
+
wordWrap: "normal"
|
|
21
|
+
},
|
|
22
|
+
variants: {
|
|
23
|
+
preserveDimensions: { true: {
|
|
24
|
+
position: "relative",
|
|
25
|
+
width: "auto",
|
|
26
|
+
height: "auto"
|
|
27
|
+
} },
|
|
28
|
+
visible: { true: {
|
|
29
|
+
position: "relative",
|
|
30
|
+
width: "auto",
|
|
31
|
+
height: "auto",
|
|
32
|
+
margin: 0,
|
|
33
|
+
padding: 0,
|
|
34
|
+
zIndex: 1,
|
|
35
|
+
overflow: "visible",
|
|
36
|
+
opacity: 1,
|
|
37
|
+
pointerEvents: "auto",
|
|
38
|
+
...isWeb && {
|
|
39
|
+
clip: "auto",
|
|
40
|
+
clipPath: "none",
|
|
41
|
+
whiteSpace: "normal"
|
|
42
|
+
}
|
|
43
|
+
} }
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const VisuallyHidden = createStyledHOC(VisuallyHiddenFrame, function VisuallyHidden2(props, forwardedRef) {
|
|
47
|
+
const { visible, ...rest } = props;
|
|
48
|
+
if (visible) {
|
|
49
|
+
return /* @__PURE__ */ jsx(VisuallyHiddenFrame, {
|
|
50
|
+
ref: forwardedRef,
|
|
51
|
+
visible: true,
|
|
52
|
+
...rest
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const a11yProps = isWeb ? { "aria-hidden": false } : {
|
|
56
|
+
accessible: true,
|
|
57
|
+
...isAndroid && { importantForAccessibility: "yes" }
|
|
58
|
+
};
|
|
59
|
+
return /* @__PURE__ */ jsx(VisuallyHiddenFrame, {
|
|
60
|
+
ref: forwardedRef,
|
|
61
|
+
...a11yProps,
|
|
62
|
+
...rest
|
|
63
|
+
});
|
|
32
64
|
});
|
|
33
65
|
VisuallyHidden["isVisuallyHidden"] = true;
|
|
66
|
+
|
|
34
67
|
export { VisuallyHidden };
|
|
35
68
|
//# sourceMappingURL=VisuallyHidden.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"file":"VisuallyHidden.js","names":[],"sources":["esm/VisuallyHidden.js"],"sourcesContent":["import { isAndroid, isWeb } from \"@tamagui/constants\";\nimport {\n createStyledHOC,\n Text,\n styled\n} from \"@tamagui/web\";\nimport { jsx } from \"react/jsx-runtime\";\nconst VisuallyHiddenFrame = styled(Text, {\n displayName: \"VisuallyHidden\",\n position: \"absolute\",\n width: 1,\n height: 1,\n margin: -1,\n padding: 0,\n borderWidth: 0,\n zIndex: -1e4,\n overflow: \"hidden\",\n pointerEvents: \"none\",\n ...isWeb && {\n // sr-only style block; clipPath is the modern replacement for clip\n // and is what tailwind's sr-only uses.\n clip: \"rect(0, 0, 0, 0)\",\n clipPath: \"inset(50%)\",\n whiteSpace: \"nowrap\",\n wordWrap: \"normal\"\n },\n variants: {\n preserveDimensions: {\n true: {\n position: \"relative\",\n width: \"auto\",\n height: \"auto\"\n }\n },\n // Escape hatch to fully reveal the element (the old \"not-sr-only\").\n visible: {\n true: {\n position: \"relative\",\n width: \"auto\",\n height: \"auto\",\n margin: 0,\n padding: 0,\n zIndex: 1,\n overflow: \"visible\",\n opacity: 1,\n pointerEvents: \"auto\",\n ...isWeb && {\n clip: \"auto\",\n clipPath: \"none\",\n whiteSpace: \"normal\"\n }\n }\n }\n }\n});\nconst VisuallyHidden = createStyledHOC(VisuallyHiddenFrame, function VisuallyHidden2(props, forwardedRef) {\n const { visible, ...rest } = props;\n if (visible) {\n return /* @__PURE__ */ jsx(VisuallyHiddenFrame, { ref: forwardedRef, visible: true, ...rest });\n }\n const a11yProps = isWeb ? { \"aria-hidden\": false } : {\n accessible: true,\n ...isAndroid && { importantForAccessibility: \"yes\" }\n };\n return /* @__PURE__ */ jsx(VisuallyHiddenFrame, { ref: forwardedRef, ...a11yProps, ...rest });\n});\nVisuallyHidden[\"isVisuallyHidden\"] = true;\nexport {\n VisuallyHidden\n};\n//# sourceMappingURL=VisuallyHidden.js.map\n"],"mappings":";;;;;AAOA,MAAM,sBAAsB,OAAO,MAAM;CACvC,aAAa;CACb,UAAU;CACV,OAAO;CACP,QAAQ;CACR,QAAQ,CAAC;CACT,SAAS;CACT,aAAa;CACb,QAAQ,CAAC;CACT,UAAU;CACV,eAAe;CACf,GAAG,SAAS;EAGV,MAAM;EACN,UAAU;EACV,YAAY;EACZ,UAAU;CACZ;CACA,UAAU;EACR,oBAAoB,EAClB,MAAM;GACJ,UAAU;GACV,OAAO;GACP,QAAQ;EACV,EACF;EAEA,SAAS,EACP,MAAM;GACJ,UAAU;GACV,OAAO;GACP,QAAQ;GACR,QAAQ;GACR,SAAS;GACT,QAAQ;GACR,UAAU;GACV,SAAS;GACT,eAAe;GACf,GAAG,SAAS;IACV,MAAM;IACN,UAAU;IACV,YAAY;GACd;EACF,EACF;CACF;AACF,CAAC;AACD,MAAM,iBAAiB,gBAAgB,qBAAqB,SAAS,gBAAgB,OAAO,cAAc;CACxG,MAAM,EAAE,SAAS,GAAG,SAAS;CAC7B,IAAI,SAAS;EACX,OAAuB,oBAAI,qBAAqB;GAAE,KAAK;GAAc,SAAS;GAAM,GAAG;EAAK,CAAC;CAC/F;CACA,MAAM,YAAY,QAAQ,EAAE,eAAe,MAAM,IAAI;EACnD,YAAY;EACZ,GAAG,aAAa,EAAE,2BAA2B,MAAM;CACrD;CACA,OAAuB,oBAAI,qBAAqB;EAAE,KAAK;EAAc,GAAG;EAAW,GAAG;CAAK,CAAC;AAC9F,CAAC;AACD,eAAe,sBAAsB"}
|
|
@@ -1,35 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isAndroid, isWeb } from "@tamagui/constants";
|
|
3
|
+
import { Text, createStyledHOC, styled } from "@tamagui/web";
|
|
4
|
+
|
|
5
|
+
var VisuallyHiddenFrame = styled(Text, {
|
|
6
|
+
displayName: "VisuallyHidden",
|
|
7
|
+
position: "absolute",
|
|
8
|
+
width: 1,
|
|
9
|
+
height: 1,
|
|
10
|
+
margin: -1,
|
|
11
|
+
padding: 0,
|
|
12
|
+
borderWidth: 0,
|
|
13
|
+
zIndex: -1e4,
|
|
14
|
+
overflow: "hidden",
|
|
15
|
+
pointerEvents: "none",
|
|
16
|
+
...isWeb && {
|
|
17
|
+
clip: "rect(0, 0, 0, 0)",
|
|
18
|
+
clipPath: "inset(50%)",
|
|
19
|
+
whiteSpace: "nowrap",
|
|
20
|
+
wordWrap: "normal"
|
|
21
|
+
},
|
|
22
|
+
variants: {
|
|
23
|
+
preserveDimensions: { true: {
|
|
24
|
+
position: "relative",
|
|
25
|
+
width: "auto",
|
|
26
|
+
height: "auto"
|
|
27
|
+
} },
|
|
28
|
+
visible: { true: {
|
|
29
|
+
position: "relative",
|
|
30
|
+
width: "auto",
|
|
31
|
+
height: "auto",
|
|
32
|
+
margin: 0,
|
|
33
|
+
padding: 0,
|
|
34
|
+
zIndex: 1,
|
|
35
|
+
overflow: "visible",
|
|
36
|
+
opacity: 1,
|
|
37
|
+
pointerEvents: "auto",
|
|
38
|
+
...isWeb && {
|
|
39
|
+
clip: "auto",
|
|
40
|
+
clipPath: "none",
|
|
41
|
+
whiteSpace: "normal"
|
|
42
|
+
}
|
|
43
|
+
} }
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
var VisuallyHidden = createStyledHOC(VisuallyHiddenFrame, function VisuallyHidden2(props, forwardedRef) {
|
|
47
|
+
var { visible, ...rest } = props;
|
|
48
|
+
if (visible) {
|
|
49
|
+
return /* @__PURE__ */ jsx(VisuallyHiddenFrame, {
|
|
50
|
+
ref: forwardedRef,
|
|
51
|
+
visible: true,
|
|
52
|
+
...rest
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
var a11yProps = isWeb ? { "aria-hidden": false } : {
|
|
56
|
+
accessible: true,
|
|
57
|
+
...isAndroid && { importantForAccessibility: "yes" }
|
|
58
|
+
};
|
|
59
|
+
return /* @__PURE__ */ jsx(VisuallyHiddenFrame, {
|
|
60
|
+
ref: forwardedRef,
|
|
61
|
+
...a11yProps,
|
|
62
|
+
...rest
|
|
63
|
+
});
|
|
32
64
|
});
|
|
33
65
|
VisuallyHidden["isVisuallyHidden"] = true;
|
|
66
|
+
|
|
34
67
|
export { VisuallyHidden };
|
|
35
68
|
//# sourceMappingURL=VisuallyHidden.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"VisuallyHidden.native.js","names":[],"sources":["esm/VisuallyHidden.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { isAndroid, isWeb } from \"@tamagui/constants\";\nimport { createStyledHOC, Text, styled } from \"@tamagui/web\";\nvar VisuallyHiddenFrame = styled(Text, {\n displayName: \"VisuallyHidden\",\n position: \"absolute\",\n width: 1,\n height: 1,\n margin: -1,\n padding: 0,\n borderWidth: 0,\n zIndex: -1e4,\n overflow: \"hidden\",\n pointerEvents: \"none\",\n ...isWeb && {\n // sr-only style block; clipPath is the modern replacement for clip\n // and is what tailwind's sr-only uses.\n clip: \"rect(0, 0, 0, 0)\",\n clipPath: \"inset(50%)\",\n whiteSpace: \"nowrap\",\n wordWrap: \"normal\"\n },\n variants: {\n preserveDimensions: {\n true: {\n position: \"relative\",\n width: \"auto\",\n height: \"auto\"\n }\n },\n // Escape hatch to fully reveal the element (the old \"not-sr-only\").\n visible: {\n true: {\n position: \"relative\",\n width: \"auto\",\n height: \"auto\",\n margin: 0,\n padding: 0,\n zIndex: 1,\n overflow: \"visible\",\n opacity: 1,\n pointerEvents: \"auto\",\n ...isWeb && {\n clip: \"auto\",\n clipPath: \"none\",\n whiteSpace: \"normal\"\n }\n }\n }\n }\n});\nvar VisuallyHidden = createStyledHOC(VisuallyHiddenFrame, function VisuallyHidden2(props, forwardedRef) {\n var { visible, ...rest } = props;\n if (visible) {\n return /* @__PURE__ */ _jsx(VisuallyHiddenFrame, {\n ref: forwardedRef,\n visible: true,\n ...rest\n });\n }\n var a11yProps = isWeb ? {\n \"aria-hidden\": false\n } : {\n accessible: true,\n ...isAndroid && {\n importantForAccessibility: \"yes\"\n }\n };\n return /* @__PURE__ */ _jsx(VisuallyHiddenFrame, {\n ref: forwardedRef,\n ...a11yProps,\n ...rest\n });\n});\nVisuallyHidden[\"isVisuallyHidden\"] = true;\nexport {\n VisuallyHidden\n};\n//# sourceMappingURL=VisuallyHidden.js.map\n"],"mappings":";;;;;AAGA,IAAI,sBAAsB,OAAO,MAAM;CACrC,aAAa;CACb,UAAU;CACV,OAAO;CACP,QAAQ;CACR,QAAQ,CAAC;CACT,SAAS;CACT,aAAa;CACb,QAAQ,CAAC;CACT,UAAU;CACV,eAAe;CACf,GAAG,SAAS;EAGV,MAAM;EACN,UAAU;EACV,YAAY;EACZ,UAAU;CACZ;CACA,UAAU;EACR,oBAAoB,EAClB,MAAM;GACJ,UAAU;GACV,OAAO;GACP,QAAQ;EACV,EACF;EAEA,SAAS,EACP,MAAM;GACJ,UAAU;GACV,OAAO;GACP,QAAQ;GACR,QAAQ;GACR,SAAS;GACT,QAAQ;GACR,UAAU;GACV,SAAS;GACT,eAAe;GACf,GAAG,SAAS;IACV,MAAM;IACN,UAAU;IACV,YAAY;GACd;EACF,EACF;CACF;AACF,CAAC;AACD,IAAI,iBAAiB,gBAAgB,qBAAqB,SAAS,gBAAgB,OAAO,cAAc;CACtG,IAAI,EAAE,SAAS,GAAG,SAAS;CAC3B,IAAI,SAAS;EACX,OAAuB,oBAAK,qBAAqB;GAC/C,KAAK;GACL,SAAS;GACT,GAAG;EACL,CAAC;CACH;CACA,IAAI,YAAY,QAAQ,EACtB,eAAe,MACjB,IAAI;EACF,YAAY;EACZ,GAAG,aAAa,EACd,2BAA2B,MAC7B;CACF;CACA,OAAuB,oBAAK,qBAAqB;EAC/C,KAAK;EACL,GAAG;EACH,GAAG;CACL,CAAC;AACH,CAAC;AACD,eAAe,sBAAsB"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export * from "./VisuallyHidden.mjs"
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from "./VisuallyHidden.mjs"
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export * from "./VisuallyHidden.mjs"
|
|
2
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
export * from "./VisuallyHidden.mjs"
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export * from "./VisuallyHidden.native.js"
|
|
2
|
-
//# sourceMappingURL=index.native.js.map
|
|
1
|
+
export * from "./VisuallyHidden.native.js"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/visually-hidden",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.637.1",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -34,10 +34,11 @@
|
|
|
34
34
|
"clean:build": "tamagui-build clean:build"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@tamagui/
|
|
37
|
+
"@tamagui/constants": "3.0.0-beta.637.1",
|
|
38
|
+
"@tamagui/web": "3.0.0-beta.637.1"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
|
-
"@tamagui/build": "
|
|
41
|
+
"@tamagui/build": "3.0.0-beta.637.1",
|
|
41
42
|
"react": ">=19"
|
|
42
43
|
},
|
|
43
44
|
"peerDependencies": {
|
package/src/VisuallyHidden.tsx
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { isAndroid, isWeb } from '@tamagui/constants'
|
|
1
2
|
import {
|
|
3
|
+
createStyledHOC,
|
|
2
4
|
type TamaDefer,
|
|
3
5
|
type TamaguiComponent,
|
|
4
6
|
type TamaguiTextElement,
|
|
@@ -8,25 +10,36 @@ import {
|
|
|
8
10
|
styled,
|
|
9
11
|
} from '@tamagui/web'
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
// Standard "sr-only" visually-hidden style block:
|
|
14
|
+
// - position: absolute + 1x1 clipped box so it consumes no layout
|
|
15
|
+
// - overflow: hidden + clip so the content isn't painted
|
|
16
|
+
// - margin: -1 + border: 0 to neutralize the 1x1 box visually
|
|
17
|
+
// - whiteSpace: nowrap so wrapped text doesn't fight the 1x1 width
|
|
18
|
+
//
|
|
19
|
+
// We intentionally do NOT use display: none, visibility: hidden, or opacity: 0,
|
|
20
|
+
// because each of those also hides the content from assistive tech on web.
|
|
21
|
+
const VisuallyHiddenFrame = styled(Text, {
|
|
22
|
+
displayName: 'VisuallyHidden',
|
|
23
|
+
|
|
21
24
|
position: 'absolute',
|
|
22
25
|
width: 1,
|
|
23
26
|
height: 1,
|
|
24
27
|
margin: -1,
|
|
28
|
+
padding: 0,
|
|
29
|
+
borderWidth: 0,
|
|
25
30
|
zIndex: -10000,
|
|
26
31
|
overflow: 'hidden',
|
|
27
|
-
opacity: 0.00000001,
|
|
28
32
|
pointerEvents: 'none',
|
|
29
33
|
|
|
34
|
+
...(isWeb && {
|
|
35
|
+
// sr-only style block; clipPath is the modern replacement for clip
|
|
36
|
+
// and is what tailwind's sr-only uses.
|
|
37
|
+
clip: 'rect(0, 0, 0, 0)' as any,
|
|
38
|
+
clipPath: 'inset(50%)' as any,
|
|
39
|
+
whiteSpace: 'nowrap' as any,
|
|
40
|
+
wordWrap: 'normal' as any,
|
|
41
|
+
}),
|
|
42
|
+
|
|
30
43
|
variants: {
|
|
31
44
|
preserveDimensions: {
|
|
32
45
|
true: {
|
|
@@ -36,20 +49,58 @@ export const VisuallyHidden: TamaguiComponent<
|
|
|
36
49
|
},
|
|
37
50
|
},
|
|
38
51
|
|
|
52
|
+
// Escape hatch to fully reveal the element (the old "not-sr-only").
|
|
39
53
|
visible: {
|
|
40
54
|
true: {
|
|
41
55
|
position: 'relative',
|
|
42
56
|
width: 'auto',
|
|
43
57
|
height: 'auto',
|
|
44
58
|
margin: 0,
|
|
59
|
+
padding: 0,
|
|
45
60
|
zIndex: 1,
|
|
46
61
|
overflow: 'visible',
|
|
47
62
|
opacity: 1,
|
|
48
63
|
pointerEvents: 'auto',
|
|
64
|
+
...(isWeb && {
|
|
65
|
+
clip: 'auto' as any,
|
|
66
|
+
clipPath: 'none' as any,
|
|
67
|
+
whiteSpace: 'normal' as any,
|
|
68
|
+
}),
|
|
49
69
|
},
|
|
50
70
|
},
|
|
51
71
|
} as const,
|
|
52
72
|
})
|
|
53
73
|
|
|
74
|
+
export const VisuallyHidden: TamaguiComponent<
|
|
75
|
+
TamaDefer,
|
|
76
|
+
TamaguiTextElement,
|
|
77
|
+
TextNonStyleProps,
|
|
78
|
+
TextStylePropsBase,
|
|
79
|
+
{
|
|
80
|
+
visible?: boolean | undefined
|
|
81
|
+
preserveDimensions?: boolean | undefined
|
|
82
|
+
}
|
|
83
|
+
> = createStyledHOC(VisuallyHiddenFrame, function VisuallyHidden(props, forwardedRef) {
|
|
84
|
+
const { visible, ...rest } = props as any
|
|
85
|
+
|
|
86
|
+
// When `visible` is true the user opted out of hiding entirely — pass through.
|
|
87
|
+
if (visible) {
|
|
88
|
+
return <VisuallyHiddenFrame ref={forwardedRef} visible {...rest} />
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// a11y semantics: visually hidden but still announced.
|
|
92
|
+
// - web: aria-hidden=false so the SR reads the content
|
|
93
|
+
// - native: accessible=true to ensure the SR focuses the node
|
|
94
|
+
// - android: importantForAccessibility="yes" to override any ancestor "no-hide-descendants"
|
|
95
|
+
const a11yProps = isWeb
|
|
96
|
+
? ({ 'aria-hidden': false } as any)
|
|
97
|
+
: ({
|
|
98
|
+
accessible: true,
|
|
99
|
+
...(isAndroid && { importantForAccessibility: 'yes' as const }),
|
|
100
|
+
} as any)
|
|
101
|
+
|
|
102
|
+
return <VisuallyHiddenFrame ref={forwardedRef} {...a11yProps} {...rest} />
|
|
103
|
+
}) as any
|
|
104
|
+
|
|
54
105
|
// @tamgui/core checks for this in spacing
|
|
55
|
-
VisuallyHidden['isVisuallyHidden'] = true
|
|
106
|
+
;(VisuallyHidden as any)['isVisuallyHidden'] = true
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "
|
|
2
|
+
"mappings": "AACA,cAEO,gBACA,uBACA,yBAEA,wBACA,0BAEA;AA+DP,OAAO,cAAM,gBAAgB,iBAC3B,WACA,oBACA,mBACA,oBACA;CACE;CACA",
|
|
3
3
|
"names": [],
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/VisuallyHidden.tsx"
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
8
|
"sourcesContent": [
|
|
9
|
-
"import {\n type TamaDefer,\n type TamaguiComponent,\n type TamaguiTextElement,\n Text,\n type TextNonStyleProps,\n type TextStylePropsBase,\n styled,\n} from '@tamagui/web'\n\
|
|
9
|
+
"import { isAndroid, isWeb } from '@tamagui/constants'\nimport {\n createStyledHOC,\n type TamaDefer,\n type TamaguiComponent,\n type TamaguiTextElement,\n Text,\n type TextNonStyleProps,\n type TextStylePropsBase,\n styled,\n} from '@tamagui/web'\n\n// Standard \"sr-only\" visually-hidden style block:\n// - position: absolute + 1x1 clipped box so it consumes no layout\n// - overflow: hidden + clip so the content isn't painted\n// - margin: -1 + border: 0 to neutralize the 1x1 box visually\n// - whiteSpace: nowrap so wrapped text doesn't fight the 1x1 width\n//\n// We intentionally do NOT use display: none, visibility: hidden, or opacity: 0,\n// because each of those also hides the content from assistive tech on web.\nconst VisuallyHiddenFrame = styled(Text, {\n displayName: 'VisuallyHidden',\n\n position: 'absolute',\n width: 1,\n height: 1,\n margin: -1,\n padding: 0,\n borderWidth: 0,\n zIndex: -10000,\n overflow: 'hidden',\n pointerEvents: 'none',\n\n ...(isWeb && {\n // sr-only style block; clipPath is the modern replacement for clip\n // and is what tailwind's sr-only uses.\n clip: 'rect(0, 0, 0, 0)' as any,\n clipPath: 'inset(50%)' as any,\n whiteSpace: 'nowrap' as any,\n wordWrap: 'normal' as any,\n }),\n\n variants: {\n preserveDimensions: {\n true: {\n position: 'relative',\n width: 'auto',\n height: 'auto',\n },\n },\n\n // Escape hatch to fully reveal the element (the old \"not-sr-only\").\n visible: {\n true: {\n position: 'relative',\n width: 'auto',\n height: 'auto',\n margin: 0,\n padding: 0,\n zIndex: 1,\n overflow: 'visible',\n opacity: 1,\n pointerEvents: 'auto',\n ...(isWeb && {\n clip: 'auto' as any,\n clipPath: 'none' as any,\n whiteSpace: 'normal' as any,\n }),\n },\n },\n } as const,\n})\n\nexport const VisuallyHidden: TamaguiComponent<\n TamaDefer,\n TamaguiTextElement,\n TextNonStyleProps,\n TextStylePropsBase,\n {\n visible?: boolean | undefined\n preserveDimensions?: boolean | undefined\n }\n> = createStyledHOC(VisuallyHiddenFrame, function VisuallyHidden(props, forwardedRef) {\n const { visible, ...rest } = props as any\n\n // When `visible` is true the user opted out of hiding entirely — pass through.\n if (visible) {\n return <VisuallyHiddenFrame ref={forwardedRef} visible {...rest} />\n }\n\n // a11y semantics: visually hidden but still announced.\n // - web: aria-hidden=false so the SR reads the content\n // - native: accessible=true to ensure the SR focuses the node\n // - android: importantForAccessibility=\"yes\" to override any ancestor \"no-hide-descendants\"\n const a11yProps = isWeb\n ? ({ 'aria-hidden': false } as any)\n : ({\n accessible: true,\n ...(isAndroid && { importantForAccessibility: 'yes' as const }),\n } as any)\n\n return <VisuallyHiddenFrame ref={forwardedRef} {...a11yProps} {...rest} />\n}) as any\n\n// @tamgui/core checks for this in spacing\n;(VisuallyHidden as any)['isVisuallyHidden'] = true\n"
|
|
10
10
|
]
|
|
11
11
|
}
|
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|
package/dist/esm/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|