@react-aria/link 3.2.0 → 3.2.3

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
@@ -1,83 +1,71 @@
1
- var {
2
- usePress
3
- } = require("@react-aria/interactions");
1
+ var $3NNeN$reactariautils = require("@react-aria/utils");
2
+ var $3NNeN$reactariafocus = require("@react-aria/focus");
3
+ var $3NNeN$reactariainteractions = require("@react-aria/interactions");
4
4
 
5
- var {
6
- useFocusable
7
- } = require("@react-aria/focus");
5
+ function $parcel$exportWildcard(dest, source) {
6
+ Object.keys(source).forEach(function(key) {
7
+ if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
8
+ return;
9
+ }
8
10
 
9
- var {
10
- filterDOMProps,
11
- mergeProps
12
- } = require("@react-aria/utils");
13
-
14
- var _babelRuntimeHelpersObjectWithoutPropertiesLoose = $parcel$interopDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
15
-
16
- var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
11
+ Object.defineProperty(dest, key, {
12
+ enumerable: true,
13
+ get: function get() {
14
+ return source[key];
15
+ }
16
+ });
17
+ });
17
18
 
18
- function $parcel$interopDefault(a) {
19
- return a && a.__esModule ? a.default : a;
19
+ return dest;
20
20
  }
21
+ function $parcel$export(e, n, v, s) {
22
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
23
+ }
24
+ var $fbe6b19572273b2f$exports = {};
25
+
26
+ $parcel$export($fbe6b19572273b2f$exports, "useLink", () => $fbe6b19572273b2f$export$dcf14c9974fe2767);
21
27
 
22
- /**
23
- * Provides the behavior and accessibility implementation for a link component.
24
- * A link allows a user to navigate to another page or resource within a web page
25
- * or application.
26
- */
27
- function useLink(props, ref) {
28
- let {
29
- elementType = 'a',
30
- onPress,
31
- onPressStart,
32
- onPressEnd,
33
- // @ts-ignore
34
- onClick: deprecatedOnClick,
35
- isDisabled
36
- } = props,
37
- otherProps = _babelRuntimeHelpersObjectWithoutPropertiesLoose(props, ["elementType", "onPress", "onPressStart", "onPressEnd", "onClick", "isDisabled"]);
38
28
 
39
- let linkProps;
40
29
 
41
- if (elementType !== 'a') {
42
- linkProps = {
43
- role: 'link',
44
- tabIndex: !isDisabled ? 0 : undefined
30
+ function $fbe6b19572273b2f$export$dcf14c9974fe2767(props, ref) {
31
+ let { elementType: elementType = 'a' , onPress: onPress , onPressStart: onPressStart , onPressEnd: onPressEnd , // @ts-ignore
32
+ onClick: deprecatedOnClick , isDisabled: isDisabled , ...otherProps } = props;
33
+ let linkProps;
34
+ if (elementType !== 'a') linkProps = {
35
+ role: 'link',
36
+ tabIndex: !isDisabled ? 0 : undefined
37
+ };
38
+ let { focusableProps: focusableProps } = $3NNeN$reactariafocus.useFocusable(props, ref);
39
+ let { pressProps: pressProps , isPressed: isPressed } = $3NNeN$reactariainteractions.usePress({
40
+ onPress: onPress,
41
+ onPressStart: onPressStart,
42
+ onPressEnd: onPressEnd,
43
+ isDisabled: isDisabled,
44
+ ref: ref
45
+ });
46
+ let domProps = $3NNeN$reactariautils.filterDOMProps(otherProps, {
47
+ labelable: true
48
+ });
49
+ let interactionHandlers = $3NNeN$reactariautils.mergeProps(focusableProps, pressProps);
50
+ return {
51
+ isPressed: isPressed,
52
+ linkProps: $3NNeN$reactariautils.mergeProps(domProps, {
53
+ ...interactionHandlers,
54
+ ...linkProps,
55
+ 'aria-disabled': isDisabled || undefined,
56
+ onClick: (e)=>{
57
+ pressProps.onClick(e);
58
+ if (deprecatedOnClick) {
59
+ deprecatedOnClick(e);
60
+ console.warn('onClick is deprecated, please use onPress');
61
+ }
62
+ }
63
+ })
45
64
  };
46
- }
65
+ }
47
66
 
48
- let {
49
- focusableProps
50
- } = useFocusable(props, ref);
51
- let {
52
- pressProps,
53
- isPressed
54
- } = usePress({
55
- onPress,
56
- onPressStart,
57
- onPressEnd,
58
- isDisabled,
59
- ref
60
- });
61
- let domProps = filterDOMProps(otherProps, {
62
- labelable: true
63
- });
64
- let interactionHandlers = mergeProps(focusableProps, pressProps);
65
- return {
66
- isPressed,
67
- // Used to indicate press state for visual
68
- linkProps: mergeProps(domProps, _babelRuntimeHelpersExtends({}, interactionHandlers, linkProps, {
69
- 'aria-disabled': isDisabled || undefined,
70
- onClick: e => {
71
- pressProps.onClick(e);
72
67
 
73
- if (deprecatedOnClick) {
74
- deprecatedOnClick(e);
75
- console.warn('onClick is deprecated, please use onPress');
76
- }
77
- }
78
- }))
79
- };
80
- }
68
+ $parcel$exportWildcard(module.exports, $fbe6b19572273b2f$exports);
69
+
81
70
 
82
- exports.useLink = useLink;
83
71
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;ACiCD;;;;;AAKO,SAASG,OAAT,CAAiBC,KAAjB,EAAyCC,GAAzC,EAAgF;AACrF,MAAI;AACFC,IAAAA,WAAW,GAAG,GADZ;AAEFC,IAAAA,OAFE;AAGFC,IAAAA,YAHE;AAIFC,IAAAA,UAJE;AAKF;AACAC,IAAAA,OAAO,EAAEC,iBANP;AAOFC,IAAAA;AAPE,MASAR,KATJ;AAAA,MAQKS,UARL,oDASIT,KATJ;;AAWA,MAAIU,SAAJ;;AACA,MAAIR,WAAW,KAAK,GAApB,EAAyB;AACvBQ,IAAAA,SAAS,GAAG;AACVC,MAAAA,IAAI,EAAE,MADI;AAEVC,MAAAA,QAAQ,EAAE,CAACJ,UAAD,GAAc,CAAd,GAAkBK;AAFlB,KAAZ;AAID;;AACD,MAAI;AAACC,IAAAA;AAAD,MAAmBC,YAAY,CAACf,KAAD,EAAQC,GAAR,CAAnC;AACA,MAAI;AAACe,IAAAA,UAAD;AAAaC,IAAAA;AAAb,MAA0BC,QAAQ,CAAC;AAACf,IAAAA,OAAD;AAAUC,IAAAA,YAAV;AAAwBC,IAAAA,UAAxB;AAAoCG,IAAAA,UAApC;AAAgDP,IAAAA;AAAhD,GAAD,CAAtC;AACA,MAAIkB,QAAQ,GAAGC,cAAc,CAACX,UAAD,EAAa;AAACY,IAAAA,SAAS,EAAE;AAAZ,GAAb,CAA7B;AACA,MAAIC,mBAAmB,GAAGC,UAAU,CAACT,cAAD,EAAiBE,UAAjB,CAApC;AAEA,SAAO;AACLC,IAAAA,SADK;AACM;AACXP,IAAAA,SAAS,EAAEa,UAAU,CAACJ,QAAD,kCAChBG,mBADgB,EAEhBZ,SAFgB;AAGnB,uBAAiBF,UAAU,IAAIK,SAHZ;AAInBP,MAAAA,OAAO,EAAGkB,CAAD,IAAO;AACdR,QAAAA,UAAU,CAACV,OAAX,CAAmBkB,CAAnB;;AACA,YAAIjB,iBAAJ,EAAuB;AACrBA,UAAAA,iBAAiB,CAACiB,CAAD,CAAjB;AACAC,UAAAA,OAAO,CAACC,IAAR,CAAa,2CAAb;AACD;AACF;AAVkB;AAFhB,GAAP;AAeD","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./packages/@react-aria/link/src/useLink.ts"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\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 {AriaLinkProps} from '@react-types/link';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {HTMLAttributes, RefObject} from 'react';\nimport {useFocusable} from '@react-aria/focus';\nimport {usePress} from '@react-aria/interactions';\n\nexport interface AriaLinkOptions extends AriaLinkProps {\n /** Whether the link is disabled. */\n isDisabled?: boolean,\n /**\n * The HTML element used to render the link, e.g. 'a', or 'span'.\n * @default 'a'\n */\n elementType?: string\n}\n\nexport interface LinkAria {\n /** Props for the link element. */\n linkProps: HTMLAttributes<HTMLElement>,\n /** Whether the link is currently pressed. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a link component.\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport function useLink(props: AriaLinkOptions, ref: RefObject<HTMLElement>): LinkAria {\n let {\n elementType = 'a',\n onPress,\n onPressStart,\n onPressEnd,\n // @ts-ignore\n onClick: deprecatedOnClick,\n isDisabled,\n ...otherProps\n } = props;\n\n let linkProps: HTMLAttributes<HTMLElement>;\n if (elementType !== 'a') {\n linkProps = {\n role: 'link',\n tabIndex: !isDisabled ? 0 : undefined\n };\n }\n let {focusableProps} = useFocusable(props, ref);\n let {pressProps, isPressed} = usePress({onPress, onPressStart, onPressEnd, isDisabled, ref});\n let domProps = filterDOMProps(otherProps, {labelable: true});\n let interactionHandlers = mergeProps(focusableProps, pressProps);\n\n return {\n isPressed, // Used to indicate press state for visual\n linkProps: mergeProps(domProps, {\n ...interactionHandlers,\n ...linkProps,\n 'aria-disabled': isDisabled || undefined,\n onClick: (e) => {\n pressProps.onClick(e);\n if (deprecatedOnClick) {\n deprecatedOnClick(e);\n console.warn('onClick is deprecated, please use onPress');\n }\n }\n })\n };\n}\n"],"names":["$parcel$interopDefault","a","__esModule","default","useLink","props","ref","elementType","onPress","onPressStart","onPressEnd","onClick","deprecatedOnClick","isDisabled","otherProps","linkProps","role","tabIndex","undefined","focusableProps","useFocusable","pressProps","isPressed","usePress","domProps","filterDOMProps","labelable","interactionHandlers","mergeProps","e","console","warn"],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;SCwCgB,yCAAO,CAAC,KAAsB,EAAE,GAA2B,EAAY,CAAC;IACtF,GAAG,CAAC,CAAC,cACH,WAAW,GAAG,CAAG,cACjB,OAAO,iBACP,YAAY,eACZ,UAAU,GACV,EAAa,AAAb,WAAa;IACb,OAAO,EAAE,iBAAiB,eAC1B,UAAU,MACP,UAAU,CACf,CAAC,GAAG,KAAK;IAET,GAAG,CAAC,SAAS;IACb,EAAE,EAAE,WAAW,KAAK,CAAG,IACrB,SAAS,GAAG,CAAC;QACX,IAAI,EAAE,CAAM;QACZ,QAAQ,GAAG,UAAU,GAAG,CAAC,GAAG,SAAS;IACvC,CAAC;IAEH,GAAG,CAAC,CAAC,iBAAA,cAAc,EAAA,CAAC,GAAG,kCAAY,CAAC,KAAK,EAAE,GAAG;IAC9C,GAAG,CAAC,CAAC,aAAA,UAAU,cAAE,SAAS,EAAA,CAAC,GAAG,qCAAQ,CAAC,CAAC;iBAAA,OAAO;sBAAE,YAAY;oBAAE,UAAU;oBAAE,UAAU;aAAE,GAAG;IAAA,CAAC;IAC3F,GAAG,CAAC,QAAQ,GAAG,oCAAc,CAAC,UAAU,EAAE,CAAC;QAAA,SAAS,EAAE,IAAI;IAAA,CAAC;IAC3D,GAAG,CAAC,mBAAmB,GAAG,gCAAU,CAAC,cAAc,EAAE,UAAU;IAE/D,MAAM,CAAC,CAAC;mBACN,SAAS;QACT,SAAS,EAAE,gCAAU,CAAC,QAAQ,EAAE,CAAC;eAC5B,mBAAmB;eACnB,SAAS;YACZ,CAAe,gBAAE,UAAU,IAAI,SAAS;YACxC,OAAO,GAAG,CAAC,GAAK,CAAC;gBACf,UAAU,CAAC,OAAO,CAAC,CAAC;gBACpB,EAAE,EAAE,iBAAiB,EAAE,CAAC;oBACtB,iBAAiB,CAAC,CAAC;oBACnB,OAAO,CAAC,IAAI,CAAC,CAA2C;gBAC1D,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC","sources":["packages/@react-aria/link/src/index.ts","packages/@react-aria/link/src/useLink.ts"],"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 */\n\nexport * from './useLink';\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 {AriaLinkProps} from '@react-types/link';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {HTMLAttributes, RefObject} from 'react';\nimport {useFocusable} from '@react-aria/focus';\nimport {usePress} from '@react-aria/interactions';\n\nexport interface AriaLinkOptions extends AriaLinkProps {\n /** Whether the link is disabled. */\n isDisabled?: boolean,\n /**\n * The HTML element used to render the link, e.g. 'a', or 'span'.\n * @default 'a'\n */\n elementType?: string\n}\n\nexport interface LinkAria {\n /** Props for the link element. */\n linkProps: HTMLAttributes<HTMLElement>,\n /** Whether the link is currently pressed. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a link component.\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport function useLink(props: AriaLinkOptions, ref: RefObject<HTMLElement>): LinkAria {\n let {\n elementType = 'a',\n onPress,\n onPressStart,\n onPressEnd,\n // @ts-ignore\n onClick: deprecatedOnClick,\n isDisabled,\n ...otherProps\n } = props;\n\n let linkProps: HTMLAttributes<HTMLElement>;\n if (elementType !== 'a') {\n linkProps = {\n role: 'link',\n tabIndex: !isDisabled ? 0 : undefined\n };\n }\n let {focusableProps} = useFocusable(props, ref);\n let {pressProps, isPressed} = usePress({onPress, onPressStart, onPressEnd, isDisabled, ref});\n let domProps = filterDOMProps(otherProps, {labelable: true});\n let interactionHandlers = mergeProps(focusableProps, pressProps);\n\n return {\n isPressed, // Used to indicate press state for visual\n linkProps: mergeProps(domProps, {\n ...interactionHandlers,\n ...linkProps,\n 'aria-disabled': isDisabled || undefined,\n onClick: (e) => {\n pressProps.onClick(e);\n if (deprecatedOnClick) {\n deprecatedOnClick(e);\n console.warn('onClick is deprecated, please use onPress');\n }\n }\n })\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,66 +1,55 @@
1
- import { usePress } from "@react-aria/interactions";
2
- import { useFocusable } from "@react-aria/focus";
3
- import { filterDOMProps, mergeProps } from "@react-aria/utils";
4
- import _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends";
1
+ import {filterDOMProps as $kKV4x$filterDOMProps, mergeProps as $kKV4x$mergeProps} from "@react-aria/utils";
2
+ import {useFocusable as $kKV4x$useFocusable} from "@react-aria/focus";
3
+ import {usePress as $kKV4x$usePress} from "@react-aria/interactions";
6
4
 
7
- /**
8
- * Provides the behavior and accessibility implementation for a link component.
9
- * A link allows a user to navigate to another page or resource within a web page
10
- * or application.
11
- */
12
- export function useLink(props, ref) {
13
- let {
14
- elementType = 'a',
15
- onPress,
16
- onPressStart,
17
- onPressEnd,
18
- // @ts-ignore
19
- onClick: deprecatedOnClick,
20
- isDisabled
21
- } = props,
22
- otherProps = _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose(props, ["elementType", "onPress", "onPressStart", "onPressEnd", "onClick", "isDisabled"]);
5
+ function $parcel$export(e, n, v, s) {
6
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
+ }
8
+ var $298d61e98472621b$exports = {};
23
9
 
24
- let linkProps;
10
+ $parcel$export($298d61e98472621b$exports, "useLink", () => $298d61e98472621b$export$dcf14c9974fe2767);
25
11
 
26
- if (elementType !== 'a') {
27
- linkProps = {
28
- role: 'link',
29
- tabIndex: !isDisabled ? 0 : undefined
30
- };
31
- }
32
12
 
33
- let {
34
- focusableProps
35
- } = useFocusable(props, ref);
36
- let {
37
- pressProps,
38
- isPressed
39
- } = usePress({
40
- onPress,
41
- onPressStart,
42
- onPressEnd,
43
- isDisabled,
44
- ref
45
- });
46
- let domProps = filterDOMProps(otherProps, {
47
- labelable: true
48
- });
49
- let interactionHandlers = mergeProps(focusableProps, pressProps);
50
- return {
51
- isPressed,
52
- // Used to indicate press state for visual
53
- linkProps: mergeProps(domProps, _babelRuntimeHelpersEsmExtends({}, interactionHandlers, linkProps, {
54
- 'aria-disabled': isDisabled || undefined,
55
- onClick: e => {
56
- pressProps.onClick(e);
57
13
 
58
- if (deprecatedOnClick) {
59
- deprecatedOnClick(e);
60
- console.warn('onClick is deprecated, please use onPress');
61
- }
62
- }
63
- }))
64
- };
14
+ function $298d61e98472621b$export$dcf14c9974fe2767(props, ref) {
15
+ let { elementType: elementType = 'a' , onPress: onPress , onPressStart: onPressStart , onPressEnd: onPressEnd , // @ts-ignore
16
+ onClick: deprecatedOnClick , isDisabled: isDisabled , ...otherProps } = props;
17
+ let linkProps;
18
+ if (elementType !== 'a') linkProps = {
19
+ role: 'link',
20
+ tabIndex: !isDisabled ? 0 : undefined
21
+ };
22
+ let { focusableProps: focusableProps } = $kKV4x$useFocusable(props, ref);
23
+ let { pressProps: pressProps , isPressed: isPressed } = $kKV4x$usePress({
24
+ onPress: onPress,
25
+ onPressStart: onPressStart,
26
+ onPressEnd: onPressEnd,
27
+ isDisabled: isDisabled,
28
+ ref: ref
29
+ });
30
+ let domProps = $kKV4x$filterDOMProps(otherProps, {
31
+ labelable: true
32
+ });
33
+ let interactionHandlers = $kKV4x$mergeProps(focusableProps, pressProps);
34
+ return {
35
+ isPressed: isPressed,
36
+ linkProps: $kKV4x$mergeProps(domProps, {
37
+ ...interactionHandlers,
38
+ ...linkProps,
39
+ 'aria-disabled': isDisabled || undefined,
40
+ onClick: (e)=>{
41
+ pressProps.onClick(e);
42
+ if (deprecatedOnClick) {
43
+ deprecatedOnClick(e);
44
+ console.warn('onClick is deprecated, please use onPress');
45
+ }
46
+ }
47
+ })
48
+ };
65
49
  }
50
+
51
+
52
+
53
+
54
+ export {$298d61e98472621b$export$dcf14c9974fe2767 as useLink};
66
55
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;AAmCA;;;;;OAKO,SAASA,OAAT,CAAiBC,KAAjB,EAAyCC,GAAzC,EAAgF;AACrF,MAAI;AACFC,IAAAA,WAAW,GAAG,GADZ;AAEFC,IAAAA,OAFE;AAGFC,IAAAA,YAHE;AAIFC,IAAAA,UAJE;AAKF;AACAC,IAAAA,OAAO,EAAEC,iBANP;AAOFC,IAAAA;AAPE,MASAR,KATJ;AAAA,MAQKS,UARL,uDASIT,KATJ;;AAWA,MAAIU,SAAJ;;AACA,MAAIR,WAAW,KAAK,GAApB,EAAyB;AACvBQ,IAAAA,SAAS,GAAG;AACVC,MAAAA,IAAI,EAAE,MADI;AAEVC,MAAAA,QAAQ,EAAE,CAACJ,UAAD,GAAc,CAAd,GAAkBK;AAFlB,KAAZ;AAID;;AACD,MAAI;AAACC,IAAAA;AAAD,MAAmBC,YAAY,CAACf,KAAD,EAAQC,GAAR,CAAnC;AACA,MAAI;AAACe,IAAAA,UAAD;AAAaC,IAAAA;AAAb,MAA0BC,QAAQ,CAAC;AAACf,IAAAA,OAAD;AAAUC,IAAAA,YAAV;AAAwBC,IAAAA,UAAxB;AAAoCG,IAAAA,UAApC;AAAgDP,IAAAA;AAAhD,GAAD,CAAtC;AACA,MAAIkB,QAAQ,GAAGC,cAAc,CAACX,UAAD,EAAa;AAACY,IAAAA,SAAS,EAAE;AAAZ,GAAb,CAA7B;AACA,MAAIC,mBAAmB,GAAGC,UAAU,CAACT,cAAD,EAAiBE,UAAjB,CAApC;AAEA,SAAO;AACLC,IAAAA,SADK;AACM;AACXP,IAAAA,SAAS,EAAEa,UAAU,CAACJ,QAAD,qCAChBG,mBADgB,EAEhBZ,SAFgB;AAGnB,uBAAiBF,UAAU,IAAIK,SAHZ;AAInBP,MAAAA,OAAO,EAAGkB,CAAD,IAAO;AACdR,QAAAA,UAAU,CAACV,OAAX,CAAmBkB,CAAnB;;AACA,YAAIjB,iBAAJ,EAAuB;AACrBA,UAAAA,iBAAiB,CAACiB,CAAD,CAAjB;AACAC,UAAAA,OAAO,CAACC,IAAR,CAAa,2CAAb;AACD;AACF;AAVkB;AAFhB,GAAP;AAeD","sources":["./packages/@react-aria/link/src/useLink.ts"],"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 */\n\nimport {AriaLinkProps} from '@react-types/link';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {HTMLAttributes, RefObject} from 'react';\nimport {useFocusable} from '@react-aria/focus';\nimport {usePress} from '@react-aria/interactions';\n\nexport interface AriaLinkOptions extends AriaLinkProps {\n /** Whether the link is disabled. */\n isDisabled?: boolean,\n /**\n * The HTML element used to render the link, e.g. 'a', or 'span'.\n * @default 'a'\n */\n elementType?: string\n}\n\nexport interface LinkAria {\n /** Props for the link element. */\n linkProps: HTMLAttributes<HTMLElement>,\n /** Whether the link is currently pressed. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a link component.\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport function useLink(props: AriaLinkOptions, ref: RefObject<HTMLElement>): LinkAria {\n let {\n elementType = 'a',\n onPress,\n onPressStart,\n onPressEnd,\n // @ts-ignore\n onClick: deprecatedOnClick,\n isDisabled,\n ...otherProps\n } = props;\n\n let linkProps: HTMLAttributes<HTMLElement>;\n if (elementType !== 'a') {\n linkProps = {\n role: 'link',\n tabIndex: !isDisabled ? 0 : undefined\n };\n }\n let {focusableProps} = useFocusable(props, ref);\n let {pressProps, isPressed} = usePress({onPress, onPressStart, onPressEnd, isDisabled, ref});\n let domProps = filterDOMProps(otherProps, {labelable: true});\n let interactionHandlers = mergeProps(focusableProps, pressProps);\n\n return {\n isPressed, // Used to indicate press state for visual\n linkProps: mergeProps(domProps, {\n ...interactionHandlers,\n ...linkProps,\n 'aria-disabled': isDisabled || undefined,\n onClick: (e) => {\n pressProps.onClick(e);\n if (deprecatedOnClick) {\n deprecatedOnClick(e);\n console.warn('onClick is deprecated, please use onPress');\n }\n }\n })\n };\n}\n"],"names":["useLink","props","ref","elementType","onPress","onPressStart","onPressEnd","onClick","deprecatedOnClick","isDisabled","otherProps","linkProps","role","tabIndex","undefined","focusableProps","useFocusable","pressProps","isPressed","usePress","domProps","filterDOMProps","labelable","interactionHandlers","mergeProps","e","console","warn"],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;SCwCgB,yCAAO,CAAC,KAAsB,EAAE,GAA2B,EAAY,CAAC;IACtF,GAAG,CAAC,CAAC,cACH,WAAW,GAAG,CAAG,cACjB,OAAO,iBACP,YAAY,eACZ,UAAU,GACV,EAAa,AAAb,WAAa;IACb,OAAO,EAAE,iBAAiB,eAC1B,UAAU,MACP,UAAU,CACf,CAAC,GAAG,KAAK;IAET,GAAG,CAAC,SAAS;IACb,EAAE,EAAE,WAAW,KAAK,CAAG,IACrB,SAAS,GAAG,CAAC;QACX,IAAI,EAAE,CAAM;QACZ,QAAQ,GAAG,UAAU,GAAG,CAAC,GAAG,SAAS;IACvC,CAAC;IAEH,GAAG,CAAC,CAAC,iBAAA,cAAc,EAAA,CAAC,GAAG,mBAAY,CAAC,KAAK,EAAE,GAAG;IAC9C,GAAG,CAAC,CAAC,aAAA,UAAU,cAAE,SAAS,EAAA,CAAC,GAAG,eAAQ,CAAC,CAAC;iBAAA,OAAO;sBAAE,YAAY;oBAAE,UAAU;oBAAE,UAAU;aAAE,GAAG;IAAA,CAAC;IAC3F,GAAG,CAAC,QAAQ,GAAG,qBAAc,CAAC,UAAU,EAAE,CAAC;QAAA,SAAS,EAAE,IAAI;IAAA,CAAC;IAC3D,GAAG,CAAC,mBAAmB,GAAG,iBAAU,CAAC,cAAc,EAAE,UAAU;IAE/D,MAAM,CAAC,CAAC;mBACN,SAAS;QACT,SAAS,EAAE,iBAAU,CAAC,QAAQ,EAAE,CAAC;eAC5B,mBAAmB;eACnB,SAAS;YACZ,CAAe,gBAAE,UAAU,IAAI,SAAS;YACxC,OAAO,GAAG,CAAC,GAAK,CAAC;gBACf,UAAU,CAAC,OAAO,CAAC,CAAC;gBACpB,EAAE,EAAE,iBAAiB,EAAE,CAAC;oBACtB,iBAAiB,CAAC,CAAC;oBACnB,OAAO,CAAC,IAAI,CAAC,CAA2C;gBAC1D,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC","sources":["packages/@react-aria/link/src/index.ts","packages/@react-aria/link/src/useLink.ts"],"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 */\n\nexport * from './useLink';\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 {AriaLinkProps} from '@react-types/link';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {HTMLAttributes, RefObject} from 'react';\nimport {useFocusable} from '@react-aria/focus';\nimport {usePress} from '@react-aria/interactions';\n\nexport interface AriaLinkOptions extends AriaLinkProps {\n /** Whether the link is disabled. */\n isDisabled?: boolean,\n /**\n * The HTML element used to render the link, e.g. 'a', or 'span'.\n * @default 'a'\n */\n elementType?: string\n}\n\nexport interface LinkAria {\n /** Props for the link element. */\n linkProps: HTMLAttributes<HTMLElement>,\n /** Whether the link is currently pressed. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a link component.\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport function useLink(props: AriaLinkOptions, ref: RefObject<HTMLElement>): LinkAria {\n let {\n elementType = 'a',\n onPress,\n onPressStart,\n onPressEnd,\n // @ts-ignore\n onClick: deprecatedOnClick,\n isDisabled,\n ...otherProps\n } = props;\n\n let linkProps: HTMLAttributes<HTMLElement>;\n if (elementType !== 'a') {\n linkProps = {\n role: 'link',\n tabIndex: !isDisabled ? 0 : undefined\n };\n }\n let {focusableProps} = useFocusable(props, ref);\n let {pressProps, isPressed} = usePress({onPress, onPressStart, onPressEnd, isDisabled, ref});\n let domProps = filterDOMProps(otherProps, {labelable: true});\n let interactionHandlers = mergeProps(focusableProps, pressProps);\n\n return {\n isPressed, // Used to indicate press state for visual\n linkProps: mergeProps(domProps, {\n ...interactionHandlers,\n ...linkProps,\n 'aria-disabled': isDisabled || undefined,\n onClick: (e) => {\n pressProps.onClick(e);\n if (deprecatedOnClick) {\n deprecatedOnClick(e);\n console.warn('onClick is deprecated, please use onPress');\n }\n }\n })\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -1 +1 @@
1
- {"mappings":"A;A;AAkBA,gCAAiC,SAAQ,aAAa;IACpD,oCAAoC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;A;A;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;IACE,kCAAkC;IAClC,SAAS,EAAE,eAAe,WAAW,CAAC,CAAC;IACvC,6CAA6C;IAC7C,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;A;A;A;GAIG;AACH,wBAAwB,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,UAAU,WAAW,CAAC,GAAG,QAAQ,CAuCrF","sources":["./packages/@react-aria/link/src/packages/@react-aria/link/src/useLink.ts","./packages/@react-aria/link/src/packages/@react-aria/link/src/index.ts"],"sourcesContent":[null,null],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;AAkBA,gCAAiC,SAAQ,aAAa;IACpD,oCAAoC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;IACE,kCAAkC;IAClC,SAAS,EAAE,eAAe,WAAW,CAAC,CAAC;IACvC,6CAA6C;IAC7C,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAwB,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,UAAU,WAAW,CAAC,GAAG,QAAQ,CAuCrF","sources":["packages/@react-aria/link/src/packages/@react-aria/link/src/useLink.ts","packages/@react-aria/link/src/packages/@react-aria/link/src/index.ts","packages/@react-aria/link/src/index.ts"],"sourcesContent":[null,null,"/*\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\nexport * from './useLink';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/link",
3
- "version": "3.2.0",
3
+ "version": "3.2.3",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -18,11 +18,11 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@babel/runtime": "^7.6.2",
21
- "@react-aria/focus": "^3.4.1",
22
- "@react-aria/interactions": "^3.7.0",
23
- "@react-aria/utils": "^3.10.0",
24
- "@react-types/link": "^3.2.0",
25
- "@react-types/shared": "^3.10.0"
21
+ "@react-aria/focus": "^3.5.3",
22
+ "@react-aria/interactions": "^3.8.2",
23
+ "@react-aria/utils": "^3.11.3",
24
+ "@react-types/link": "^3.2.3",
25
+ "@react-types/shared": "^3.11.2"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "^16.8.0 || ^17.0.0-rc.1"
@@ -30,5 +30,5 @@
30
30
  "publishConfig": {
31
31
  "access": "public"
32
32
  },
33
- "gitHead": "896eabe5521a0349a675c4773ed7629addd4b8c4"
33
+ "gitHead": "ed8d8d984c2f7f2c31e8b18795b97858a95e4729"
34
34
  }