@react-aria/link 3.7.0 → 3.7.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/useLink.main.js +6 -6
- package/dist/useLink.mjs +7 -7
- package/dist/useLink.module.js +6 -6
- package/package.json +7 -7
package/dist/useLink.main.js
CHANGED
|
@@ -22,11 +22,11 @@ $parcel$export(module.exports, "useLink", () => $fbe6b19572273b2f$export$dcf14c9
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
function $fbe6b19572273b2f$export$dcf14c9974fe2767(props, ref) {
|
|
25
|
-
let { elementType: elementType =
|
|
25
|
+
let { elementType: elementType = 'a', onPress: onPress, onPressStart: onPressStart, onPressEnd: onPressEnd, // @ts-ignore
|
|
26
26
|
onClick: deprecatedOnClick, isDisabled: isDisabled, ...otherProps } = props;
|
|
27
27
|
let linkProps = {};
|
|
28
|
-
if (elementType !==
|
|
29
|
-
role:
|
|
28
|
+
if (elementType !== 'a') linkProps = {
|
|
29
|
+
role: 'link',
|
|
30
30
|
tabIndex: !isDisabled ? 0 : undefined
|
|
31
31
|
};
|
|
32
32
|
let { focusableProps: focusableProps } = (0, $8TwZf$reactariafocus.useFocusable)(props, ref);
|
|
@@ -48,14 +48,14 @@ function $fbe6b19572273b2f$export$dcf14c9974fe2767(props, ref) {
|
|
|
48
48
|
linkProps: (0, $8TwZf$reactariautils.mergeProps)(domProps, routerLinkProps, {
|
|
49
49
|
...interactionHandlers,
|
|
50
50
|
...linkProps,
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
'aria-disabled': isDisabled || undefined,
|
|
52
|
+
'aria-current': props['aria-current'],
|
|
53
53
|
onClick: (e)=>{
|
|
54
54
|
var _pressProps_onClick;
|
|
55
55
|
(_pressProps_onClick = pressProps.onClick) === null || _pressProps_onClick === void 0 ? void 0 : _pressProps_onClick.call(pressProps, e);
|
|
56
56
|
if (deprecatedOnClick) {
|
|
57
57
|
deprecatedOnClick(e);
|
|
58
|
-
console.warn(
|
|
58
|
+
console.warn('onClick is deprecated, please use onPress');
|
|
59
59
|
}
|
|
60
60
|
// If a custom router is provided, prevent default and forward if this link should client navigate.
|
|
61
61
|
if (!router.isNative && e.currentTarget instanceof HTMLAnchorElement && e.currentTarget.href && // If props are applied to a router Link component, it may have already prevented default.
|
package/dist/useLink.mjs
CHANGED
|
@@ -16,11 +16,11 @@ import {usePress as $5Ot33$usePress} from "@react-aria/interactions";
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
function $298d61e98472621b$export$dcf14c9974fe2767(props, ref) {
|
|
19
|
-
let { elementType: elementType =
|
|
19
|
+
let { elementType: elementType = 'a', onPress: onPress, onPressStart: onPressStart, onPressEnd: onPressEnd, // @ts-ignore
|
|
20
20
|
onClick: deprecatedOnClick, isDisabled: isDisabled, ...otherProps } = props;
|
|
21
21
|
let linkProps = {};
|
|
22
|
-
if (elementType !==
|
|
23
|
-
role:
|
|
22
|
+
if (elementType !== 'a') linkProps = {
|
|
23
|
+
role: 'link',
|
|
24
24
|
tabIndex: !isDisabled ? 0 : undefined
|
|
25
25
|
};
|
|
26
26
|
let { focusableProps: focusableProps } = (0, $5Ot33$useFocusable)(props, ref);
|
|
@@ -42,14 +42,14 @@ function $298d61e98472621b$export$dcf14c9974fe2767(props, ref) {
|
|
|
42
42
|
linkProps: (0, $5Ot33$mergeProps)(domProps, routerLinkProps, {
|
|
43
43
|
...interactionHandlers,
|
|
44
44
|
...linkProps,
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
'aria-disabled': isDisabled || undefined,
|
|
46
|
+
'aria-current': props['aria-current'],
|
|
47
47
|
onClick: (e)=>{
|
|
48
48
|
var _pressProps_onClick;
|
|
49
49
|
(_pressProps_onClick = pressProps.onClick) === null || _pressProps_onClick === void 0 ? void 0 : _pressProps_onClick.call(pressProps, e);
|
|
50
50
|
if (deprecatedOnClick) {
|
|
51
51
|
deprecatedOnClick(e);
|
|
52
|
-
console.warn(
|
|
52
|
+
console.warn('onClick is deprecated, please use onPress');
|
|
53
53
|
}
|
|
54
54
|
// If a custom router is provided, prevent default and forward if this link should client navigate.
|
|
55
55
|
if (!router.isNative && e.currentTarget instanceof HTMLAnchorElement && e.currentTarget.href && // If props are applied to a router Link component, it may have already prevented default.
|
|
@@ -64,4 +64,4 @@ function $298d61e98472621b$export$dcf14c9974fe2767(props, ref) {
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
export {$298d61e98472621b$export$dcf14c9974fe2767 as useLink};
|
|
67
|
-
//# sourceMappingURL=useLink.
|
|
67
|
+
//# sourceMappingURL=useLink.module.js.map
|
package/dist/useLink.module.js
CHANGED
|
@@ -16,11 +16,11 @@ import {usePress as $5Ot33$usePress} from "@react-aria/interactions";
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
function $298d61e98472621b$export$dcf14c9974fe2767(props, ref) {
|
|
19
|
-
let { elementType: elementType =
|
|
19
|
+
let { elementType: elementType = 'a', onPress: onPress, onPressStart: onPressStart, onPressEnd: onPressEnd, // @ts-ignore
|
|
20
20
|
onClick: deprecatedOnClick, isDisabled: isDisabled, ...otherProps } = props;
|
|
21
21
|
let linkProps = {};
|
|
22
|
-
if (elementType !==
|
|
23
|
-
role:
|
|
22
|
+
if (elementType !== 'a') linkProps = {
|
|
23
|
+
role: 'link',
|
|
24
24
|
tabIndex: !isDisabled ? 0 : undefined
|
|
25
25
|
};
|
|
26
26
|
let { focusableProps: focusableProps } = (0, $5Ot33$useFocusable)(props, ref);
|
|
@@ -42,14 +42,14 @@ function $298d61e98472621b$export$dcf14c9974fe2767(props, ref) {
|
|
|
42
42
|
linkProps: (0, $5Ot33$mergeProps)(domProps, routerLinkProps, {
|
|
43
43
|
...interactionHandlers,
|
|
44
44
|
...linkProps,
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
'aria-disabled': isDisabled || undefined,
|
|
46
|
+
'aria-current': props['aria-current'],
|
|
47
47
|
onClick: (e)=>{
|
|
48
48
|
var _pressProps_onClick;
|
|
49
49
|
(_pressProps_onClick = pressProps.onClick) === null || _pressProps_onClick === void 0 ? void 0 : _pressProps_onClick.call(pressProps, e);
|
|
50
50
|
if (deprecatedOnClick) {
|
|
51
51
|
deprecatedOnClick(e);
|
|
52
|
-
console.warn(
|
|
52
|
+
console.warn('onClick is deprecated, please use onPress');
|
|
53
53
|
}
|
|
54
54
|
// If a custom router is provided, prevent default and forward if this link should client navigate.
|
|
55
55
|
if (!router.isNative && e.currentTarget instanceof HTMLAnchorElement && e.currentTarget.href && // If props are applied to a router Link component, it may have already prevented default.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/link",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.1",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-aria/focus": "^3.17.
|
|
26
|
-
"@react-aria/interactions": "^3.21.
|
|
27
|
-
"@react-aria/utils": "^3.24.
|
|
28
|
-
"@react-types/link": "^3.5.
|
|
29
|
-
"@react-types/shared": "^3.23.
|
|
25
|
+
"@react-aria/focus": "^3.17.1",
|
|
26
|
+
"@react-aria/interactions": "^3.21.3",
|
|
27
|
+
"@react-aria/utils": "^3.24.1",
|
|
28
|
+
"@react-types/link": "^3.5.5",
|
|
29
|
+
"@react-types/shared": "^3.23.1",
|
|
30
30
|
"@swc/helpers": "^0.5.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
|
|
39
39
|
}
|