Socket
Book a DemoInstallSign in
Socket

@react-aria/button

Package Overview
Dependencies
Maintainers
2
Versions
1119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-aria/button - npm Package Compare versions

Comparing version

to
3.0.0-nightly-0d96e0d0f-250916

27

dist/useButton.main.js
var $lIlxZ$reactariautils = require("@react-aria/utils");
var $lIlxZ$reactariafocus = require("@react-aria/focus");
var $lIlxZ$reactariainteractions = require("@react-aria/interactions");

@@ -23,15 +22,20 @@

function $988353faa005faf8$export$ea18c227d4417cc3(props, ref) {
let { elementType: elementType = 'button', isDisabled: isDisabled, onPress: onPress, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressUp: onPressUp, onPressChange: onPressChange, preventFocusOnPress: preventFocusOnPress, allowFocusWhenDisabled: // @ts-ignore - undocumented
allowFocusWhenDisabled, // @ts-ignore
onClick: deprecatedOnClick, href: href, target: target, rel: rel, type: type = 'button' } = props;
allowFocusWhenDisabled, onClick: onClick, href: href, target: target, rel: rel, type: type = 'button' } = props;
let additionalProps;
if (elementType === 'button') additionalProps = {
type: type,
disabled: isDisabled
disabled: isDisabled,
form: props.form,
formAction: props.formAction,
formEncType: props.formEncType,
formMethod: props.formMethod,
formNoValidate: props.formNoValidate,
formTarget: props.formTarget,
name: props.name,
value: props.value
};
else additionalProps = {
role: 'button',
tabIndex: isDisabled ? undefined : 0,
href: elementType === 'a' && !isDisabled ? href : undefined,

@@ -50,2 +54,3 @@ target: elementType === 'a' ? target : undefined,

onPressUp: onPressUp,
onClick: onClick,
isDisabled: isDisabled,

@@ -55,3 +60,3 @@ preventFocusOnPress: preventFocusOnPress,

});
let { focusableProps: focusableProps } = (0, $lIlxZ$reactariafocus.useFocusable)(props, ref);
let { focusableProps: focusableProps } = (0, $lIlxZ$reactariainteractions.useFocusable)(props, ref);
if (allowFocusWhenDisabled) focusableProps.tabIndex = isDisabled ? -1 : focusableProps.tabIndex;

@@ -68,8 +73,4 @@ let buttonProps = (0, $lIlxZ$reactariautils.mergeProps)(focusableProps, pressProps, (0, $lIlxZ$reactariautils.filterDOMProps)(props, {

'aria-pressed': props['aria-pressed'],
onClick: (e)=>{
if (deprecatedOnClick) {
deprecatedOnClick(e);
console.warn('onClick is deprecated, please use onPress');
}
}
'aria-current': props['aria-current'],
'aria-disabled': props['aria-disabled']
})

@@ -76,0 +77,0 @@ };

import {mergeProps as $bwqiF$mergeProps, filterDOMProps as $bwqiF$filterDOMProps} from "@react-aria/utils";
import {useFocusable as $bwqiF$useFocusable} from "@react-aria/focus";
import {usePress as $bwqiF$usePress} from "@react-aria/interactions";
import {usePress as $bwqiF$usePress, useFocusable as $bwqiF$useFocusable} from "@react-aria/interactions";

@@ -17,15 +16,20 @@ /*

function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
let { elementType: elementType = 'button', isDisabled: isDisabled, onPress: onPress, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressUp: onPressUp, onPressChange: onPressChange, preventFocusOnPress: preventFocusOnPress, allowFocusWhenDisabled: // @ts-ignore - undocumented
allowFocusWhenDisabled, // @ts-ignore
onClick: deprecatedOnClick, href: href, target: target, rel: rel, type: type = 'button' } = props;
allowFocusWhenDisabled, onClick: onClick, href: href, target: target, rel: rel, type: type = 'button' } = props;
let additionalProps;
if (elementType === 'button') additionalProps = {
type: type,
disabled: isDisabled
disabled: isDisabled,
form: props.form,
formAction: props.formAction,
formEncType: props.formEncType,
formMethod: props.formMethod,
formNoValidate: props.formNoValidate,
formTarget: props.formTarget,
name: props.name,
value: props.value
};
else additionalProps = {
role: 'button',
tabIndex: isDisabled ? undefined : 0,
href: elementType === 'a' && !isDisabled ? href : undefined,

@@ -44,2 +48,3 @@ target: elementType === 'a' ? target : undefined,

onPressUp: onPressUp,
onClick: onClick,
isDisabled: isDisabled,

@@ -61,8 +66,4 @@ preventFocusOnPress: preventFocusOnPress,

'aria-pressed': props['aria-pressed'],
onClick: (e)=>{
if (deprecatedOnClick) {
deprecatedOnClick(e);
console.warn('onClick is deprecated, please use onPress');
}
}
'aria-current': props['aria-current'],
'aria-disabled': props['aria-disabled']
})

@@ -69,0 +70,0 @@ };

@@ -37,2 +37,3 @@ var $c49208f7d2aac50b$exports = require("./useToggleButton.main.js");

isSelected: state.selectedKeys.has(props.id),
defaultSelected: false,
setSelected (isSelected) {

@@ -39,0 +40,0 @@ state.setSelected(props.id, isSelected);

@@ -30,2 +30,3 @@ import {useToggleButton as $55f54f7887471b58$export$51e84d46ca0bc451} from "./useToggleButton.module.js";

isSelected: state.selectedKeys.has(props.id),
defaultSelected: false,
setSelected (isSelected) {

@@ -32,0 +33,0 @@ state.setSelected(props.id, isSelected);

{
"name": "@react-aria/button",
"version": "3.0.0-nightly-09ccc53e7-241107",
"version": "3.0.0-nightly-0d96e0d0f-250916",
"description": "Spectrum UI components in React",

@@ -9,3 +9,7 @@ "license": "Apache-2.0",

"exports": {
"types": "./dist/types.d.ts",
"source": "./src/index.ts",
"types": [
"./dist/types.d.ts",
"./src/index.ts"
],
"import": "./dist/import.mjs",

@@ -26,18 +30,17 @@ "require": "./dist/main.js"

"dependencies": {
"@react-aria/focus": "^3.0.0-nightly-09ccc53e7-241107",
"@react-aria/interactions": "^3.0.0-nightly-09ccc53e7-241107",
"@react-aria/toolbar": "3.0.0-nightly-09ccc53e7-241107",
"@react-aria/utils": "^3.0.0-nightly-09ccc53e7-241107",
"@react-stately/toggle": "^3.0.0-nightly-09ccc53e7-241107",
"@react-types/button": "^3.0.0-nightly-09ccc53e7-241107",
"@react-types/shared": "^3.0.0-nightly-09ccc53e7-241107",
"@react-aria/interactions": "3.0.0-nightly-0d96e0d0f-250916",
"@react-aria/toolbar": "3.0.0-nightly-0d96e0d0f-250916",
"@react-aria/utils": "3.0.0-nightly-0d96e0d0f-250916",
"@react-stately/toggle": "3.0.0-nightly-0d96e0d0f-250916",
"@react-types/button": "3.0.0-nightly-0d96e0d0f-250916",
"@react-types/shared": "3.0.0-nightly-0d96e0d0f-250916",
"@swc/helpers": "^0.5.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
},
"publishConfig": {
"access": "public"
},
"stableVersion": "3.10.1"
}
}

@@ -24,4 +24,3 @@ /*

import {filterDOMProps, mergeProps} from '@react-aria/utils';
import {useFocusable} from '@react-aria/focus';
import {usePress} from '@react-aria/interactions';
import {useFocusable, usePress} from '@react-aria/interactions';

@@ -62,4 +61,3 @@ export interface AriaButtonOptions<E extends ElementType> extends Omit<AriaButtonProps<E>, 'children'> {}

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

@@ -74,3 +72,11 @@ target,

type,
disabled: isDisabled
disabled: isDisabled,
form: props.form,
formAction: props.formAction,
formEncType: props.formEncType,
formMethod: props.formMethod,
formNoValidate: props.formNoValidate,
formTarget: props.formTarget,
name: props.name,
value: props.value
};

@@ -80,3 +86,2 @@ } else {

role: 'button',
tabIndex: isDisabled ? undefined : 0,
href: elementType === 'a' && !isDisabled ? href : undefined,

@@ -97,2 +102,3 @@ target: elementType === 'a' ? target : undefined,

onPressUp,
onClick,
isDisabled,

@@ -116,10 +122,6 @@ preventFocusOnPress,

'aria-pressed': props['aria-pressed'],
onClick: (e) => {
if (deprecatedOnClick) {
deprecatedOnClick(e);
console.warn('onClick is deprecated, please use onPress');
}
}
'aria-current': props['aria-current'],
'aria-disabled': props['aria-disabled']
})
};
}

@@ -71,2 +71,3 @@ /*

isSelected: state.selectedKeys.has(props.id),
defaultSelected: false,
setSelected(isSelected) {

@@ -73,0 +74,0 @@ state.setSelected(props.id, isSelected);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet