@react-aria/visually-hidden 3.6.0 → 3.6.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/main.js CHANGED
@@ -11,31 +11,50 @@ function $parcel$interopDefault(a) {
11
11
 
12
12
  $parcel$export(module.exports, "useVisuallyHidden", () => $b5c81b25cdf7a43c$export$a966af930f325cab);
13
13
  $parcel$export(module.exports, "VisuallyHidden", () => $b5c81b25cdf7a43c$export$439d29a4e110a164);
14
-
14
+ /*
15
+ * Copyright 2020 Adobe. All rights reserved.
16
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
17
+ * you may not use this file except in compliance with the License. You may obtain a copy
18
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
19
+ *
20
+ * Unless required by applicable law or agreed to in writing, software distributed under
21
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
22
+ * OF ANY KIND, either express or implied. See the License for the specific language
23
+ * governing permissions and limitations under the License.
24
+ */ /*
25
+ * Copyright 2020 Adobe. All rights reserved.
26
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
27
+ * you may not use this file except in compliance with the License. You may obtain a copy
28
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
29
+ *
30
+ * Unless required by applicable law or agreed to in writing, software distributed under
31
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
32
+ * OF ANY KIND, either express or implied. See the License for the specific language
33
+ * governing permissions and limitations under the License.
34
+ */
15
35
 
16
36
 
17
37
  const $b5c81b25cdf7a43c$var$styles = {
18
38
  border: 0,
19
- clip: 'rect(0 0 0 0)',
20
- clipPath: 'inset(50%)',
39
+ clip: "rect(0 0 0 0)",
40
+ clipPath: "inset(50%)",
21
41
  height: 1,
22
- margin: '0 -1px -1px 0',
23
- overflow: 'hidden',
42
+ margin: "0 -1px -1px 0",
43
+ overflow: "hidden",
24
44
  padding: 0,
25
- position: 'absolute',
45
+ position: "absolute",
26
46
  width: 1,
27
- whiteSpace: 'nowrap'
47
+ whiteSpace: "nowrap"
28
48
  };
29
- function $b5c81b25cdf7a43c$export$a966af930f325cab(props = {
30
- }) {
49
+ function $b5c81b25cdf7a43c$export$a966af930f325cab(props = {}) {
31
50
  let { style: style , isFocusable: isFocusable } = props;
32
- let [isFocused, setFocused] = $2Agrv$react.useState(false);
33
- let { focusWithinProps: focusWithinProps } = $2Agrv$reactariainteractions.useFocusWithin({
51
+ let [isFocused, setFocused] = (0, $2Agrv$react.useState)(false);
52
+ let { focusWithinProps: focusWithinProps } = (0, $2Agrv$reactariainteractions.useFocusWithin)({
34
53
  isDisabled: !isFocusable,
35
54
  onFocusWithinChange: (val)=>setFocused(val)
36
55
  });
37
56
  // If focused, don't hide the element.
38
- let combinedStyles = $2Agrv$react.useMemo(()=>{
57
+ let combinedStyles = (0, $2Agrv$react.useMemo)(()=>{
39
58
  if (isFocused) return style;
40
59
  else if (style) return {
41
60
  ...$b5c81b25cdf7a43c$var$styles,
@@ -55,9 +74,9 @@ function $b5c81b25cdf7a43c$export$a966af930f325cab(props = {
55
74
  }
56
75
  function $b5c81b25cdf7a43c$export$439d29a4e110a164(props) {
57
76
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
58
- let { children: children , elementType: Element = 'div' , isFocusable: isFocusable , style: style , ...otherProps } = props;
77
+ let { children: children , elementType: Element = "div" , isFocusable: isFocusable , style: style , ...otherProps } = props;
59
78
  let { visuallyHiddenProps: visuallyHiddenProps } = $b5c81b25cdf7a43c$export$a966af930f325cab(props);
60
- return(/*#__PURE__*/ ($parcel$interopDefault($2Agrv$react)).createElement(Element, $2Agrv$reactariautils.mergeProps(otherProps, visuallyHiddenProps), children));
79
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($2Agrv$react))).createElement(Element, (0, $2Agrv$reactariautils.mergeProps)(otherProps, visuallyHiddenProps), children);
61
80
  }
62
81
 
63
82
 
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AC+BA,KAAK,CAAC,4BAAM,GAAkB,CAAC;IAC7B,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAe;IACrB,QAAQ,EAAE,CAAY;IACtB,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAe;IACvB,QAAQ,EAAE,CAAQ;IAClB,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,CAAU;IACpB,KAAK,EAAE,CAAC;IACR,UAAU,EAAE,CAAQ;AACtB,CAAC;SAUe,yCAAiB,CAAC,KAA0B,GAAG,CAAC;AAAA,CAAC,EAAsB,CAAC;IACtF,GAAG,CAAC,CAAC,QACH,KAAK,gBACL,WAAW,EACb,CAAC,GAAG,KAAK;IAET,GAAG,EAAE,SAAS,EAAE,UAAU,IAAI,qBAAQ,CAAC,KAAK;IAC5C,GAAG,CAAC,CAAC,mBAAA,gBAAgB,EAAA,CAAC,GAAG,2CAAc,CAAC,CAAC;QACvC,UAAU,GAAG,WAAW;QACxB,mBAAmB,GAAG,GAAG,GAAK,UAAU,CAAC,GAAG;IAC9C,CAAC;IAED,EAAsC,AAAtC,oCAAsC;IACtC,GAAG,CAAC,cAAc,GAAG,oBAAO,KAAO,CAAC;QAClC,EAAE,EAAE,SAAS,EACX,MAAM,CAAC,KAAK;aACP,EAAE,EAAE,KAAK,EACd,MAAM,CAAC,CAAC;eAAG,4BAAM;eAAK,KAAK;QAAA,CAAC;aAE5B,MAAM,CAAC,4BAAM;IAEjB,EAAuD,AAAvD,qDAAuD;IACvD,CAAC,EAAE,CAAC;QAAA,SAAS;IAAA,CAAC;IAEd,MAAM,CAAC,CAAC;QACN,mBAAmB,EAAE,CAAC;eACjB,gBAAgB;YACnB,KAAK,EAAE,cAAc;QACvB,CAAC;IACH,CAAC;AACH,CAAC;SAMe,yCAAc,CAAC,KAA0B,EAAE,CAAC;IAC1D,EAA6D,AAA7D,2DAA6D;IAC7D,GAAG,CAAC,CAAC,WAAA,QAAQ,GAAE,WAAW,EAAE,OAAO,GAAG,CAAK,oBAAE,WAAW,UAAE,KAAK,MAAK,UAAU,CAAA,CAAC,GAAG,KAAK;IACvF,GAAG,CAAC,CAAC,sBAAA,mBAAmB,EAAA,CAAC,GAAG,yCAAiB,CAAC,KAAK;IAEnD,MAAM,oEACH,OAAO,EAAK,gCAAU,CAAC,UAAU,EAAE,mBAAmB,GACpD,QAAQ;AAGf,CAAC","sources":["packages/@react-aria/visually-hidden/src/index.ts","packages/@react-aria/visually-hidden/src/VisuallyHidden.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useVisuallyHidden, VisuallyHidden} from './VisuallyHidden';\nexport type {VisuallyHiddenAria, VisuallyHiddenProps} from './VisuallyHidden';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {CSSProperties, JSXElementConstructor, ReactNode, useMemo, useState} from 'react';\nimport {useFocusWithin} from '@react-aria/interactions';\n\nexport interface VisuallyHiddenProps extends DOMAttributes {\n /** The content to visually hide. */\n children?: ReactNode,\n\n /**\n * The element type for the container.\n * @default 'div'\n */\n elementType?: string | JSXElementConstructor<any>,\n\n /** Whether the element should become visible on focus, for example skip links. */\n isFocusable?: boolean\n}\n\nconst styles: CSSProperties = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(50%)',\n height: 1,\n margin: '0 -1px -1px 0',\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n width: 1,\n whiteSpace: 'nowrap'\n};\n\nexport interface VisuallyHiddenAria {\n visuallyHiddenProps: DOMAttributes\n}\n\n/**\n * Provides props for an element that hides its children visually\n * but keeps content visible to assistive technology.\n */\nexport function useVisuallyHidden(props: VisuallyHiddenProps = {}): VisuallyHiddenAria {\n let {\n style,\n isFocusable\n } = props;\n\n let [isFocused, setFocused] = useState(false);\n let {focusWithinProps} = useFocusWithin({\n isDisabled: !isFocusable,\n onFocusWithinChange: (val) => setFocused(val)\n });\n\n // If focused, don't hide the element.\n let combinedStyles = useMemo(() => {\n if (isFocused) {\n return style;\n } else if (style) {\n return {...styles, ...style};\n } else {\n return styles;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isFocused]);\n\n return {\n visuallyHiddenProps: {\n ...focusWithinProps,\n style: combinedStyles\n }\n };\n}\n\n/**\n * VisuallyHidden hides its children visually, while keeping content visible\n * to screen readers.\n */\nexport function VisuallyHidden(props: VisuallyHiddenProps) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {children, elementType: Element = 'div', isFocusable, style, ...otherProps} = props;\n let {visuallyHiddenProps} = useVisuallyHidden(props);\n\n return (\n <Element {...mergeProps(otherProps, visuallyHiddenProps)}>\n {children}\n </Element>\n );\n}\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;;;AAmBA,MAAM,+BAAwB;IAC5B,QAAQ;IACR,MAAM;IACN,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,SAAS;IACT,UAAU;IACV,OAAO;IACP,YAAY;AACd;AAUO,SAAS,0CAAkB,QAA6B,CAAC,CAAC,EAAsB;IACrF,IAAI,SACF,MAAK,eACL,YAAW,EACZ,GAAG;IAEJ,IAAI,CAAC,WAAW,WAAW,GAAG,CAAA,GAAA,qBAAO,EAAE,KAAK;IAC5C,IAAI,oBAAC,iBAAgB,EAAC,GAAG,CAAA,GAAA,2CAAc,AAAD,EAAE;QACtC,YAAY,CAAC;QACb,qBAAqB,CAAC,MAAQ,WAAW;IAC3C;IAEA,sCAAsC;IACtC,IAAI,iBAAiB,CAAA,GAAA,oBAAM,EAAE,IAAM;QACjC,IAAI,WACF,OAAO;aACF,IAAI,OACT,OAAO;YAAC,GAAG,4BAAM;YAAE,GAAG,KAAK;QAAA;aAE3B,OAAO;IAEX,uDAAuD;IACvD,GAAG;QAAC;KAAU;IAEd,OAAO;QACL,qBAAqB;YACnB,GAAG,gBAAgB;YACnB,OAAO;QACT;IACF;AACF;AAMO,SAAS,0CAAe,KAA0B,EAAE;IACzD,6DAA6D;IAC7D,IAAI,YAAC,SAAQ,EAAE,aAAa,UAAU,KAAK,CAAA,eAAE,YAAW,SAAE,MAAK,EAAE,GAAG,YAAW,GAAG;IAClF,IAAI,uBAAC,oBAAmB,EAAC,GAAG,0CAAkB;IAE9C,qBACE,0DAAC,SAAY,CAAA,GAAA,gCAAS,EAAE,YAAY,sBACjC;AAGP;;CDxFC,GACD","sources":["packages/@react-aria/visually-hidden/src/index.ts","packages/@react-aria/visually-hidden/src/VisuallyHidden.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useVisuallyHidden, VisuallyHidden} from './VisuallyHidden';\nexport type {VisuallyHiddenAria, VisuallyHiddenProps} from './VisuallyHidden';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {CSSProperties, JSXElementConstructor, ReactNode, useMemo, useState} from 'react';\nimport {useFocusWithin} from '@react-aria/interactions';\n\nexport interface VisuallyHiddenProps extends DOMAttributes {\n /** The content to visually hide. */\n children?: ReactNode,\n\n /**\n * The element type for the container.\n * @default 'div'\n */\n elementType?: string | JSXElementConstructor<any>,\n\n /** Whether the element should become visible on focus, for example skip links. */\n isFocusable?: boolean\n}\n\nconst styles: CSSProperties = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(50%)',\n height: 1,\n margin: '0 -1px -1px 0',\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n width: 1,\n whiteSpace: 'nowrap'\n};\n\nexport interface VisuallyHiddenAria {\n visuallyHiddenProps: DOMAttributes\n}\n\n/**\n * Provides props for an element that hides its children visually\n * but keeps content visible to assistive technology.\n */\nexport function useVisuallyHidden(props: VisuallyHiddenProps = {}): VisuallyHiddenAria {\n let {\n style,\n isFocusable\n } = props;\n\n let [isFocused, setFocused] = useState(false);\n let {focusWithinProps} = useFocusWithin({\n isDisabled: !isFocusable,\n onFocusWithinChange: (val) => setFocused(val)\n });\n\n // If focused, don't hide the element.\n let combinedStyles = useMemo(() => {\n if (isFocused) {\n return style;\n } else if (style) {\n return {...styles, ...style};\n } else {\n return styles;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isFocused]);\n\n return {\n visuallyHiddenProps: {\n ...focusWithinProps,\n style: combinedStyles\n }\n };\n}\n\n/**\n * VisuallyHidden hides its children visually, while keeping content visible\n * to screen readers.\n */\nexport function VisuallyHidden(props: VisuallyHiddenProps) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {children, elementType: Element = 'div', isFocusable, style, ...otherProps} = props;\n let {visuallyHiddenProps} = useVisuallyHidden(props);\n\n return (\n <Element {...mergeProps(otherProps, visuallyHiddenProps)}>\n {children}\n </Element>\n );\n}\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -2,31 +2,50 @@ import {mergeProps as $9BxnE$mergeProps} from "@react-aria/utils";
2
2
  import $9BxnE$react, {useState as $9BxnE$useState, useMemo as $9BxnE$useMemo} from "react";
3
3
  import {useFocusWithin as $9BxnE$useFocusWithin} from "@react-aria/interactions";
4
4
 
5
-
5
+ /*
6
+ * Copyright 2020 Adobe. All rights reserved.
7
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License. You may obtain a copy
9
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software distributed under
12
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
+ * OF ANY KIND, either express or implied. See the License for the specific language
14
+ * governing permissions and limitations under the License.
15
+ */ /*
16
+ * Copyright 2020 Adobe. All rights reserved.
17
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
18
+ * you may not use this file except in compliance with the License. You may obtain a copy
19
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
20
+ *
21
+ * Unless required by applicable law or agreed to in writing, software distributed under
22
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
23
+ * OF ANY KIND, either express or implied. See the License for the specific language
24
+ * governing permissions and limitations under the License.
25
+ */
6
26
 
7
27
 
8
28
  const $5c3e21d68f1c4674$var$styles = {
9
29
  border: 0,
10
- clip: 'rect(0 0 0 0)',
11
- clipPath: 'inset(50%)',
30
+ clip: "rect(0 0 0 0)",
31
+ clipPath: "inset(50%)",
12
32
  height: 1,
13
- margin: '0 -1px -1px 0',
14
- overflow: 'hidden',
33
+ margin: "0 -1px -1px 0",
34
+ overflow: "hidden",
15
35
  padding: 0,
16
- position: 'absolute',
36
+ position: "absolute",
17
37
  width: 1,
18
- whiteSpace: 'nowrap'
38
+ whiteSpace: "nowrap"
19
39
  };
20
- function $5c3e21d68f1c4674$export$a966af930f325cab(props = {
21
- }) {
40
+ function $5c3e21d68f1c4674$export$a966af930f325cab(props = {}) {
22
41
  let { style: style , isFocusable: isFocusable } = props;
23
- let [isFocused, setFocused] = $9BxnE$useState(false);
24
- let { focusWithinProps: focusWithinProps } = $9BxnE$useFocusWithin({
42
+ let [isFocused, setFocused] = (0, $9BxnE$useState)(false);
43
+ let { focusWithinProps: focusWithinProps } = (0, $9BxnE$useFocusWithin)({
25
44
  isDisabled: !isFocusable,
26
45
  onFocusWithinChange: (val)=>setFocused(val)
27
46
  });
28
47
  // If focused, don't hide the element.
29
- let combinedStyles = $9BxnE$useMemo(()=>{
48
+ let combinedStyles = (0, $9BxnE$useMemo)(()=>{
30
49
  if (isFocused) return style;
31
50
  else if (style) return {
32
51
  ...$5c3e21d68f1c4674$var$styles,
@@ -46,9 +65,9 @@ function $5c3e21d68f1c4674$export$a966af930f325cab(props = {
46
65
  }
47
66
  function $5c3e21d68f1c4674$export$439d29a4e110a164(props) {
48
67
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
49
- let { children: children , elementType: Element = 'div' , isFocusable: isFocusable , style: style , ...otherProps } = props;
68
+ let { children: children , elementType: Element = "div" , isFocusable: isFocusable , style: style , ...otherProps } = props;
50
69
  let { visuallyHiddenProps: visuallyHiddenProps } = $5c3e21d68f1c4674$export$a966af930f325cab(props);
51
- return(/*#__PURE__*/ $9BxnE$react.createElement(Element, $9BxnE$mergeProps(otherProps, visuallyHiddenProps), children));
70
+ return /*#__PURE__*/ (0, $9BxnE$react).createElement(Element, (0, $9BxnE$mergeProps)(otherProps, visuallyHiddenProps), children);
52
71
  }
53
72
 
54
73
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;;AC+BA,KAAK,CAAC,4BAAM,GAAkB,CAAC;IAC7B,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAe;IACrB,QAAQ,EAAE,CAAY;IACtB,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAe;IACvB,QAAQ,EAAE,CAAQ;IAClB,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,CAAU;IACpB,KAAK,EAAE,CAAC;IACR,UAAU,EAAE,CAAQ;AACtB,CAAC;SAUe,yCAAiB,CAAC,KAA0B,GAAG,CAAC;AAAA,CAAC,EAAsB,CAAC;IACtF,GAAG,CAAC,CAAC,QACH,KAAK,gBACL,WAAW,EACb,CAAC,GAAG,KAAK;IAET,GAAG,EAAE,SAAS,EAAE,UAAU,IAAI,eAAQ,CAAC,KAAK;IAC5C,GAAG,CAAC,CAAC,mBAAA,gBAAgB,EAAA,CAAC,GAAG,qBAAc,CAAC,CAAC;QACvC,UAAU,GAAG,WAAW;QACxB,mBAAmB,GAAG,GAAG,GAAK,UAAU,CAAC,GAAG;IAC9C,CAAC;IAED,EAAsC,AAAtC,oCAAsC;IACtC,GAAG,CAAC,cAAc,GAAG,cAAO,KAAO,CAAC;QAClC,EAAE,EAAE,SAAS,EACX,MAAM,CAAC,KAAK;aACP,EAAE,EAAE,KAAK,EACd,MAAM,CAAC,CAAC;eAAG,4BAAM;eAAK,KAAK;QAAA,CAAC;aAE5B,MAAM,CAAC,4BAAM;IAEjB,EAAuD,AAAvD,qDAAuD;IACvD,CAAC,EAAE,CAAC;QAAA,SAAS;IAAA,CAAC;IAEd,MAAM,CAAC,CAAC;QACN,mBAAmB,EAAE,CAAC;eACjB,gBAAgB;YACnB,KAAK,EAAE,cAAc;QACvB,CAAC;IACH,CAAC;AACH,CAAC;SAMe,yCAAc,CAAC,KAA0B,EAAE,CAAC;IAC1D,EAA6D,AAA7D,2DAA6D;IAC7D,GAAG,CAAC,CAAC,WAAA,QAAQ,GAAE,WAAW,EAAE,OAAO,GAAG,CAAK,oBAAE,WAAW,UAAE,KAAK,MAAK,UAAU,CAAA,CAAC,GAAG,KAAK;IACvF,GAAG,CAAC,CAAC,sBAAA,mBAAmB,EAAA,CAAC,GAAG,yCAAiB,CAAC,KAAK;IAEnD,MAAM,0CACH,OAAO,EAAK,iBAAU,CAAC,UAAU,EAAE,mBAAmB,GACpD,QAAQ;AAGf,CAAC","sources":["packages/@react-aria/visually-hidden/src/index.ts","packages/@react-aria/visually-hidden/src/VisuallyHidden.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useVisuallyHidden, VisuallyHidden} from './VisuallyHidden';\nexport type {VisuallyHiddenAria, VisuallyHiddenProps} from './VisuallyHidden';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {CSSProperties, JSXElementConstructor, ReactNode, useMemo, useState} from 'react';\nimport {useFocusWithin} from '@react-aria/interactions';\n\nexport interface VisuallyHiddenProps extends DOMAttributes {\n /** The content to visually hide. */\n children?: ReactNode,\n\n /**\n * The element type for the container.\n * @default 'div'\n */\n elementType?: string | JSXElementConstructor<any>,\n\n /** Whether the element should become visible on focus, for example skip links. */\n isFocusable?: boolean\n}\n\nconst styles: CSSProperties = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(50%)',\n height: 1,\n margin: '0 -1px -1px 0',\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n width: 1,\n whiteSpace: 'nowrap'\n};\n\nexport interface VisuallyHiddenAria {\n visuallyHiddenProps: DOMAttributes\n}\n\n/**\n * Provides props for an element that hides its children visually\n * but keeps content visible to assistive technology.\n */\nexport function useVisuallyHidden(props: VisuallyHiddenProps = {}): VisuallyHiddenAria {\n let {\n style,\n isFocusable\n } = props;\n\n let [isFocused, setFocused] = useState(false);\n let {focusWithinProps} = useFocusWithin({\n isDisabled: !isFocusable,\n onFocusWithinChange: (val) => setFocused(val)\n });\n\n // If focused, don't hide the element.\n let combinedStyles = useMemo(() => {\n if (isFocused) {\n return style;\n } else if (style) {\n return {...styles, ...style};\n } else {\n return styles;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isFocused]);\n\n return {\n visuallyHiddenProps: {\n ...focusWithinProps,\n style: combinedStyles\n }\n };\n}\n\n/**\n * VisuallyHidden hides its children visually, while keeping content visible\n * to screen readers.\n */\nexport function VisuallyHidden(props: VisuallyHiddenProps) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {children, elementType: Element = 'div', isFocusable, style, ...otherProps} = props;\n let {visuallyHiddenProps} = useVisuallyHidden(props);\n\n return (\n <Element {...mergeProps(otherProps, visuallyHiddenProps)}>\n {children}\n </Element>\n );\n}\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;;;AAmBA,MAAM,+BAAwB;IAC5B,QAAQ;IACR,MAAM;IACN,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,SAAS;IACT,UAAU;IACV,OAAO;IACP,YAAY;AACd;AAUO,SAAS,0CAAkB,QAA6B,CAAC,CAAC,EAAsB;IACrF,IAAI,SACF,MAAK,eACL,YAAW,EACZ,GAAG;IAEJ,IAAI,CAAC,WAAW,WAAW,GAAG,CAAA,GAAA,eAAO,EAAE,KAAK;IAC5C,IAAI,oBAAC,iBAAgB,EAAC,GAAG,CAAA,GAAA,qBAAc,AAAD,EAAE;QACtC,YAAY,CAAC;QACb,qBAAqB,CAAC,MAAQ,WAAW;IAC3C;IAEA,sCAAsC;IACtC,IAAI,iBAAiB,CAAA,GAAA,cAAM,EAAE,IAAM;QACjC,IAAI,WACF,OAAO;aACF,IAAI,OACT,OAAO;YAAC,GAAG,4BAAM;YAAE,GAAG,KAAK;QAAA;aAE3B,OAAO;IAEX,uDAAuD;IACvD,GAAG;QAAC;KAAU;IAEd,OAAO;QACL,qBAAqB;YACnB,GAAG,gBAAgB;YACnB,OAAO;QACT;IACF;AACF;AAMO,SAAS,0CAAe,KAA0B,EAAE;IACzD,6DAA6D;IAC7D,IAAI,YAAC,SAAQ,EAAE,aAAa,UAAU,KAAK,CAAA,eAAE,YAAW,SAAE,MAAK,EAAE,GAAG,YAAW,GAAG;IAClF,IAAI,uBAAC,oBAAmB,EAAC,GAAG,0CAAkB;IAE9C,qBACE,gCAAC,SAAY,CAAA,GAAA,iBAAS,EAAE,YAAY,sBACjC;AAGP;;CDxFC,GACD","sources":["packages/@react-aria/visually-hidden/src/index.ts","packages/@react-aria/visually-hidden/src/VisuallyHidden.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useVisuallyHidden, VisuallyHidden} from './VisuallyHidden';\nexport type {VisuallyHiddenAria, VisuallyHiddenProps} from './VisuallyHidden';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {CSSProperties, JSXElementConstructor, ReactNode, useMemo, useState} from 'react';\nimport {useFocusWithin} from '@react-aria/interactions';\n\nexport interface VisuallyHiddenProps extends DOMAttributes {\n /** The content to visually hide. */\n children?: ReactNode,\n\n /**\n * The element type for the container.\n * @default 'div'\n */\n elementType?: string | JSXElementConstructor<any>,\n\n /** Whether the element should become visible on focus, for example skip links. */\n isFocusable?: boolean\n}\n\nconst styles: CSSProperties = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(50%)',\n height: 1,\n margin: '0 -1px -1px 0',\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n width: 1,\n whiteSpace: 'nowrap'\n};\n\nexport interface VisuallyHiddenAria {\n visuallyHiddenProps: DOMAttributes\n}\n\n/**\n * Provides props for an element that hides its children visually\n * but keeps content visible to assistive technology.\n */\nexport function useVisuallyHidden(props: VisuallyHiddenProps = {}): VisuallyHiddenAria {\n let {\n style,\n isFocusable\n } = props;\n\n let [isFocused, setFocused] = useState(false);\n let {focusWithinProps} = useFocusWithin({\n isDisabled: !isFocusable,\n onFocusWithinChange: (val) => setFocused(val)\n });\n\n // If focused, don't hide the element.\n let combinedStyles = useMemo(() => {\n if (isFocused) {\n return style;\n } else if (style) {\n return {...styles, ...style};\n } else {\n return styles;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isFocused]);\n\n return {\n visuallyHiddenProps: {\n ...focusWithinProps,\n style: combinedStyles\n }\n };\n}\n\n/**\n * VisuallyHidden hides its children visually, while keeping content visible\n * to screen readers.\n */\nexport function VisuallyHidden(props: VisuallyHiddenProps) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {children, elementType: Element = 'div', isFocusable, style, ...otherProps} = props;\n let {visuallyHiddenProps} = useVisuallyHidden(props);\n\n return (\n <Element {...mergeProps(otherProps, visuallyHiddenProps)}>\n {children}\n </Element>\n );\n}\n"],"names":[],"version":3,"file":"module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/visually-hidden",
3
- "version": "3.6.0",
3
+ "version": "3.6.1",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -19,10 +19,10 @@
19
19
  "url": "https://github.com/adobe/react-spectrum"
20
20
  },
21
21
  "dependencies": {
22
- "@babel/runtime": "^7.6.2",
23
- "@react-aria/interactions": "^3.13.0",
24
- "@react-aria/utils": "^3.14.1",
22
+ "@react-aria/interactions": "^3.13.1",
23
+ "@react-aria/utils": "^3.14.2",
25
24
  "@react-types/shared": "^3.16.0",
25
+ "@swc/helpers": "^0.4.14",
26
26
  "clsx": "^1.1.1"
27
27
  },
28
28
  "peerDependencies": {
@@ -31,5 +31,5 @@
31
31
  "publishConfig": {
32
32
  "access": "public"
33
33
  },
34
- "gitHead": "2954307ddbefe149241685440c81f80ece6b2c83"
34
+ "gitHead": "5480d76bd815e239366f92852c76b6831ad2a4fd"
35
35
  }