🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@heroui/use-aria-button

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@heroui/use-aria-button - npm Package Compare versions

Comparing version

to
2.2.12

33

dist/index.js

@@ -26,3 +26,2 @@ "use strict";

module.exports = __toCommonJS(index_exports);
var import_shared_utils = require("@heroui/shared-utils");
var import_utils = require("@react-aria/utils");

@@ -43,4 +42,3 @@ var import_focus = require("@react-aria/focus");

allowFocusWhenDisabled,
// @ts-ignore
onClick: deprecatedOnClick,
onClick,
href,

@@ -50,4 +48,3 @@ target,

type = "button",
allowTextSelectionOnPress,
role
allowTextSelectionOnPress
} = props;

@@ -71,22 +68,8 @@ let additionalProps;

}
let isMobile = (0, import_utils.isIOS)() || (0, import_utils.isAndroid)();
if (deprecatedOnClick && typeof deprecatedOnClick === "function" && // bypass since onClick is passed from <Link as={Button} /> internally
role !== "link" && // bypass since onClick is passed from useDisclosure's `getButtonProps` internally
!(props.hasOwnProperty("aria-expanded") && props.hasOwnProperty("aria-controls"))) {
(0, import_shared_utils.warn)(
"onClick is deprecated, please use onPress instead. See: https://github.com/heroui-inc/heroui/issues/4292",
"useButton"
);
}
const handlePress = (e) => {
if (isMobile) {
deprecatedOnClick == null ? void 0 : deprecatedOnClick(e);
}
onPress == null ? void 0 : onPress(e);
};
let { pressProps, isPressed } = (0, import_interactions.usePress)({
onClick,
onPressStart,
onPressEnd,
onPressChange,
onPress: handlePress,
onPress,
isDisabled,

@@ -114,9 +97,3 @@ preventFocusOnPress,

"aria-pressed": props["aria-pressed"],
"aria-current": props["aria-current"],
onClick: (e) => {
if (type === "button" && isMobile) {
return;
}
deprecatedOnClick == null ? void 0 : deprecatedOnClick(e);
}
"aria-current": props["aria-current"]
})

@@ -123,0 +100,0 @@ };

14

package.json
{
"name": "@heroui/use-aria-button",
"version": "2.2.12-beta.2",
"version": "2.2.12",
"description": "Internal hook to handle button a11y and events, this is based on react-aria button hook but without the onClick warning",

@@ -31,8 +31,8 @@ "keywords": [

"dependencies": {
"@react-aria/focus": "3.20.1",
"@react-aria/interactions": "3.24.1",
"@react-aria/utils": "3.28.1",
"@react-types/button": "3.11.0",
"@react-types/shared": "3.28.0",
"@heroui/shared-utils": "2.1.9-beta.2"
"@react-aria/focus": "3.20.2",
"@react-aria/interactions": "3.25.0",
"@react-aria/utils": "3.28.2",
"@react-types/button": "3.12.0",
"@react-types/shared": "3.29.0",
"@heroui/shared-utils": "2.1.8"
},

@@ -39,0 +39,0 @@ "clean-package": "../../../clean-package.config.json",

Sorry, the diff of this file is not supported yet