@react-aria/button
Advanced tools
Comparing version
var $lIlxZ$reactariautils = require("@react-aria/utils"); | ||
var $lIlxZ$reactariafocus = require("@react-aria/focus"); | ||
var $lIlxZ$reactariainteractions = require("@react-aria/interactions"); | ||
@@ -23,3 +22,2 @@ | ||
function $988353faa005faf8$export$ea18c227d4417cc3(props, ref) { | ||
@@ -36,3 +34,2 @@ let { elementType: elementType = 'button', isDisabled: isDisabled, onPress: onPress, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressUp: onPressUp, onPressChange: onPressChange, preventFocusOnPress: preventFocusOnPress, allowFocusWhenDisabled: // @ts-ignore - undocumented | ||
role: 'button', | ||
tabIndex: isDisabled ? undefined : 0, | ||
href: elementType === 'a' && !isDisabled ? href : undefined, | ||
@@ -55,3 +52,3 @@ target: elementType === 'a' ? target : undefined, | ||
}); | ||
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,2 +65,3 @@ let buttonProps = (0, $lIlxZ$reactariautils.mergeProps)(focusableProps, pressProps, (0, $lIlxZ$reactariautils.filterDOMProps)(props, { | ||
'aria-pressed': props['aria-pressed'], | ||
'aria-current': props['aria-current'], | ||
onClick: (e)=>{ | ||
@@ -70,0 +68,0 @@ if (deprecatedOnClick) { |
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,3 +16,2 @@ /* | ||
function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) { | ||
@@ -30,3 +28,2 @@ let { elementType: elementType = 'button', isDisabled: isDisabled, onPress: onPress, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressUp: onPressUp, onPressChange: onPressChange, preventFocusOnPress: preventFocusOnPress, allowFocusWhenDisabled: // @ts-ignore - undocumented | ||
role: 'button', | ||
tabIndex: isDisabled ? undefined : 0, | ||
href: elementType === 'a' && !isDisabled ? href : undefined, | ||
@@ -61,2 +58,3 @@ target: elementType === 'a' ? target : undefined, | ||
'aria-pressed': props['aria-pressed'], | ||
'aria-current': props['aria-current'], | ||
onClick: (e)=>{ | ||
@@ -63,0 +61,0 @@ if (deprecatedOnClick) { |
{ | ||
"name": "@react-aria/button", | ||
"version": "3.0.0-nightly-993de98ad-241210", | ||
"version": "3.0.0-nightly-9b3385ac6-250228", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,18 +25,17 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-aria/focus": "^3.0.0-nightly-993de98ad-241210", | ||
"@react-aria/interactions": "^3.0.0-nightly-993de98ad-241210", | ||
"@react-aria/toolbar": "3.0.0-nightly-993de98ad-241210", | ||
"@react-aria/utils": "^3.0.0-nightly-993de98ad-241210", | ||
"@react-stately/toggle": "^3.0.0-nightly-993de98ad-241210", | ||
"@react-types/button": "^3.0.0-nightly-993de98ad-241210", | ||
"@react-types/shared": "^3.0.0-nightly-993de98ad-241210", | ||
"@react-aria/interactions": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-aria/toolbar": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-aria/utils": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-stately/toggle": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-types/button": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-types/shared": "3.0.0-nightly-9b3385ac6-250228", | ||
"@swc/helpers": "^0.5.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" | ||
"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.11.0" | ||
} | ||
} |
@@ -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'; | ||
@@ -78,3 +77,2 @@ export interface AriaButtonOptions<E extends ElementType> extends Omit<AriaButtonProps<E>, 'children'> {} | ||
role: 'button', | ||
tabIndex: isDisabled ? undefined : 0, | ||
href: elementType === 'a' && !isDisabled ? href : undefined, | ||
@@ -113,2 +111,3 @@ target: elementType === 'a' ? target : undefined, | ||
'aria-pressed': props['aria-pressed'], | ||
'aria-current': props['aria-current'], | ||
onClick: (e) => { | ||
@@ -115,0 +114,0 @@ if (deprecatedOnClick) { |
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
83594
-0.26%840
-0.47%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated