@react-aria/link 3.3.6 → 3.4.0

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.
Files changed (2) hide show
  1. package/dist/import.mjs +69 -0
  2. package/package.json +12 -7
@@ -0,0 +1,69 @@
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";
4
+
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
+ */
26
+
27
+
28
+ function $298d61e98472621b$export$dcf14c9974fe2767(props, ref) {
29
+ let { elementType: elementType = "a" , onPress: onPress , onPressStart: onPressStart , onPressEnd: onPressEnd , // @ts-ignore
30
+ onClick: deprecatedOnClick , isDisabled: isDisabled , ...otherProps } = props;
31
+ let linkProps;
32
+ if (elementType !== "a") linkProps = {
33
+ role: "link",
34
+ tabIndex: !isDisabled ? 0 : undefined
35
+ };
36
+ let { focusableProps: focusableProps } = (0, $kKV4x$useFocusable)(props, ref);
37
+ let { pressProps: pressProps , isPressed: isPressed } = (0, $kKV4x$usePress)({
38
+ onPress: onPress,
39
+ onPressStart: onPressStart,
40
+ onPressEnd: onPressEnd,
41
+ isDisabled: isDisabled,
42
+ ref: ref
43
+ });
44
+ let domProps = (0, $kKV4x$filterDOMProps)(otherProps, {
45
+ labelable: true
46
+ });
47
+ let interactionHandlers = (0, $kKV4x$mergeProps)(focusableProps, pressProps);
48
+ return {
49
+ isPressed: isPressed,
50
+ linkProps: (0, $kKV4x$mergeProps)(domProps, {
51
+ ...interactionHandlers,
52
+ ...linkProps,
53
+ "aria-disabled": isDisabled || undefined,
54
+ onClick: (e)=>{
55
+ pressProps.onClick(e);
56
+ if (deprecatedOnClick) {
57
+ deprecatedOnClick(e);
58
+ console.warn("onClick is deprecated, please use onPress");
59
+ }
60
+ }
61
+ })
62
+ };
63
+ }
64
+
65
+
66
+
67
+
68
+ export {$298d61e98472621b$export$dcf14c9974fe2767 as useLink};
69
+ //# sourceMappingURL=module.js.map
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@react-aria/link",
3
- "version": "3.3.6",
3
+ "version": "3.4.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
+ "exports": {
9
+ "types": "./dist/types.d.ts",
10
+ "import": "./dist/import.mjs",
11
+ "require": "./dist/main.js"
12
+ },
8
13
  "types": "dist/types.d.ts",
9
14
  "source": "src/index.ts",
10
15
  "files": [
@@ -17,11 +22,11 @@
17
22
  "url": "https://github.com/adobe/react-spectrum"
18
23
  },
19
24
  "dependencies": {
20
- "@react-aria/focus": "^3.10.1",
21
- "@react-aria/interactions": "^3.13.1",
22
- "@react-aria/utils": "^3.14.2",
23
- "@react-types/link": "^3.3.6",
24
- "@react-types/shared": "^3.16.0",
25
+ "@react-aria/focus": "^3.11.0",
26
+ "@react-aria/interactions": "^3.14.0",
27
+ "@react-aria/utils": "^3.15.0",
28
+ "@react-types/link": "^3.4.0",
29
+ "@react-types/shared": "^3.17.0",
25
30
  "@swc/helpers": "^0.4.14"
26
31
  },
27
32
  "peerDependencies": {
@@ -30,5 +35,5 @@
30
35
  "publishConfig": {
31
36
  "access": "public"
32
37
  },
33
- "gitHead": "5480d76bd815e239366f92852c76b6831ad2a4fd"
38
+ "gitHead": "a0efee84aa178cb1a202951dfd6d8de02b292307"
34
39
  }