@tamagui/visually-hidden 2.7.7 → 3.0.0-beta.643.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.
@@ -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
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
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
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
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
- const VisuallyHidden = (0, import_web.styled)(import_web.Text, {
30
- position: "absolute",
31
- width: 1,
32
- height: 1,
33
- margin: -1,
34
- zIndex: -1e4,
35
- overflow: "hidden",
36
- opacity: 1e-8,
37
- pointerEvents: "none",
38
- variants: {
39
- preserveDimensions: {
40
- true: {
41
- position: "relative",
42
- width: "auto",
43
- height: "auto"
44
- }
45
- },
46
- visible: {
47
- true: {
48
- position: "relative",
49
- width: "auto",
50
- height: "auto",
51
- margin: 0,
52
- zIndex: 1,
53
- overflow: "visible",
54
- opacity: 1,
55
- pointerEvents: "auto"
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
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
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
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
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 VisuallyHidden = (0, import_web.styled)(import_web.Text, {
32
- position: "absolute",
33
- width: 1,
34
- height: 1,
35
- margin: -1,
36
- zIndex: -1e4,
37
- overflow: "hidden",
38
- opacity: 1e-8,
39
- pointerEvents: "none",
40
- variants: {
41
- preserveDimensions: {
42
- true: {
43
- position: "relative",
44
- width: "auto",
45
- height: "auto"
46
- }
47
- },
48
- visible: {
49
- true: {
50
- position: "relative",
51
- width: "auto",
52
- height: "auto",
53
- margin: 0,
54
- zIndex: 1,
55
- overflow: "visible",
56
- opacity: 1,
57
- pointerEvents: "auto"
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,"names":["__toCommonJS","mod","__copyProps","__defProp","value","VisuallyHidden_exports","__export","VisuallyHidden","module","exports","import_web","require","styled","Text","position","width","height","margin","zIndex","overflow","opacity","pointerEvents","variants","preserveDimensions","true","visible"],"sources":["../../src/VisuallyHidden.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,sBAAA;AAAAC,QAAA,CAAAD,sBAAA;EAAAE,cAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAQOT,YAAA,CAAAK,sBAAA;AAEA,IAAAK,UAAM,GAAAC,OAAA,eAST;AAAa,IACfJ,cAAU,OAAAG,UAAA,CAAAE,MAAA,EAAAF,UAAA,CAAAG,IAAA;EACVC,QAAO;EACPC,KAAA,GAAQ;EACRC,MAAA,EAAQ;EACRC,MAAA,EAAQ;EACRC,MAAA,MAAU;EACVC,QAAA,EAAS;EACTC,OAAA;EAEAC,aAAU;EAAAC,QACR;IAAoBC,kBACZ;MAAAC,IACJ;QACAV,QAAO;QACPC,KAAA,QAAQ;QACVC,MAAA;MACF;IAEA;IAASS,OACP,EAAM;MAAAD,IACJ;QACAV,QAAO;QACPC,KAAA,QAAQ;QACRC,MAAA,EAAQ;QACRC,MAAA,EAAQ;QACRC,MAAA;QACAC,QAAA,EAAS;QACTC,OAAA;QACFC,aAAA;MACF;IACF;EACD;AAGD","ignoreList":[]}
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"}
@@ -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
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
- get: () => from[key],
9
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
- });
11
- }
12
- return to;
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);
@@ -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
- if (from && typeof from === "object" || typeof from === "function") {
9
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
- get: () => from[key],
11
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
- });
13
- }
14
- return to;
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,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA","ignoreList":[]}
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 { Text, styled } from "@tamagui/web";
2
- const VisuallyHidden = styled(Text, {
3
- position: "absolute",
4
- width: 1,
5
- height: 1,
6
- margin: -1,
7
- zIndex: -1e4,
8
- overflow: "hidden",
9
- opacity: 1e-8,
10
- pointerEvents: "none",
11
- variants: {
12
- preserveDimensions: {
13
- true: {
14
- position: "relative",
15
- width: "auto",
16
- height: "auto"
17
- }
18
- },
19
- visible: {
20
- true: {
21
- position: "relative",
22
- width: "auto",
23
- height: "auto",
24
- margin: 0,
25
- zIndex: 1,
26
- overflow: "visible",
27
- opacity: 1,
28
- pointerEvents: "auto"
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":["Text","styled","VisuallyHidden","position","width","height","margin","zIndex","overflow","opacity","pointerEvents","variants","preserveDimensions","true","visible"],"sources":["../../src/VisuallyHidden.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAIEA,IAAA,EAGAC,MAAA,QACK;AAEA,MAAMC,cAAA,GASTD,MAAA,CAAOD,IAAA,EAAM;EACfG,QAAA,EAAU;EACVC,KAAA,EAAO;EACPC,MAAA,EAAQ;EACRC,MAAA,EAAQ;EACRC,MAAA,EAAQ;EACRC,QAAA,EAAU;EACVC,OAAA,EAAS;EACTC,aAAA,EAAe;EAEfC,QAAA,EAAU;IACRC,kBAAA,EAAoB;MAClBC,IAAA,EAAM;QACJV,QAAA,EAAU;QACVC,KAAA,EAAO;QACPC,MAAA,EAAQ;MACV;IACF;IAEAS,OAAA,EAAS;MACPD,IAAA,EAAM;QACJV,QAAA,EAAU;QACVC,KAAA,EAAO;QACPC,MAAA,EAAQ;QACRC,MAAA,EAAQ;QACRC,MAAA,EAAQ;QACRC,QAAA,EAAU;QACVC,OAAA,EAAS;QACTC,aAAA,EAAe;MACjB;IACF;EACF;AACF,CAAC;AAGDR,cAAA,CAAe,kBAAkB,IAAI","ignoreList":[]}
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 { Text, styled } from "@tamagui/web";
2
- var VisuallyHidden = styled(Text, {
3
- position: "absolute",
4
- width: 1,
5
- height: 1,
6
- margin: -1,
7
- zIndex: -1e4,
8
- overflow: "hidden",
9
- opacity: 1e-8,
10
- pointerEvents: "none",
11
- variants: {
12
- preserveDimensions: {
13
- true: {
14
- position: "relative",
15
- width: "auto",
16
- height: "auto"
17
- }
18
- },
19
- visible: {
20
- true: {
21
- position: "relative",
22
- width: "auto",
23
- height: "auto",
24
- margin: 0,
25
- zIndex: 1,
26
- overflow: "visible",
27
- opacity: 1,
28
- pointerEvents: "auto"
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,"names":["Text","styled","VisuallyHidden","position","width","height","margin","zIndex","overflow","opacity","pointerEvents","variants","preserveDimensions","true","visible"],"sources":["../../src/VisuallyHidden.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAAAA,IAAA,EAAAC,MAAA;AAAA,IAIEC,cAAA,GAAAD,MAAA,CAAAD,IAAA;EAGAG,QAAA;EAAAC,KACK;EAEAC,MAAM;EAUXC,MAAA,IAAU;EACVC,MAAA,EAAO;EACPC,QAAQ;EACRC,OAAA,EAAQ;EACRC,aAAQ;EACRC,QAAA,EAAU;IACVC,kBAAS;MACTC,IAAA;QAEAV,QAAU;QACRC,KAAA;QACEC,MAAM;MAAA;IACM;IACHS,OACP;MACFD,IAAA;QACFV,QAAA;QAEAC,KAAS;QACPC,MAAM;QACJC,MAAA;QACAC,MAAA,EAAO;QACPC,QAAQ;QACRC,OAAA,EAAQ;QACRC,aAAQ;MAAA;IACE;EACD;AACM;AACjBR,cACF;AAAA,SAEHA,cAAA","ignoreList":[]}
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"
@@ -1,2 +1 @@
1
- export * from "./VisuallyHidden.mjs";
2
- //# sourceMappingURL=index.mjs.map
1
+ export * from "./VisuallyHidden.mjs"
@@ -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": "2.7.7",
3
+ "version": "3.0.0-beta.643.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/web": "2.7.7"
37
+ "@tamagui/constants": "3.0.0-beta.643.1",
38
+ "@tamagui/web": "3.0.0-beta.643.1"
38
39
  },
39
40
  "devDependencies": {
40
- "@tamagui/build": "2.7.7",
41
+ "@tamagui/build": "3.0.0-beta.643.1",
41
42
  "react": ">=19"
42
43
  },
43
44
  "peerDependencies": {
@@ -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
- export const VisuallyHidden: TamaguiComponent<
12
- TamaDefer,
13
- TamaguiTextElement,
14
- TextNonStyleProps,
15
- TextStylePropsBase,
16
- {
17
- visible?: boolean | undefined
18
- preserveDimensions?: boolean | undefined
19
- }
20
- > = styled(Text, {
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": "AAAA,cACO,gBACA,uBACA,yBAEA,wBACA,0BAEA;AAEP,OAAO,cAAM,gBAAgB,iBAC3B,WACA,oBACA,mBACA,oBACA;CACE;CACA",
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\nexport const VisuallyHidden: TamaguiComponent<\n TamaDefer,\n TamaguiTextElement,\n TextNonStyleProps,\n TextStylePropsBase,\n {\n visible?: boolean | undefined\n preserveDimensions?: boolean | undefined\n }\n> = styled(Text, {\n position: 'absolute',\n width: 1,\n height: 1,\n margin: -1,\n zIndex: -10000,\n overflow: 'hidden',\n opacity: 0.00000001,\n pointerEvents: 'none',\n\n variants: {\n preserveDimensions: {\n true: {\n position: 'relative',\n width: 'auto',\n height: 'auto',\n },\n },\n\n visible: {\n true: {\n position: 'relative',\n width: 'auto',\n height: 'auto',\n margin: 0,\n zIndex: 1,\n overflow: 'visible',\n opacity: 1,\n pointerEvents: 'auto',\n },\n },\n } as const,\n})\n\n// @tamgui/core checks for this in spacing\nVisuallyHidden['isVisuallyHidden'] = true\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
  }
@@ -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":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}