@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,7 +22,5 @@ | ||
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; | ||
@@ -49,2 +46,3 @@ if (elementType === 'button') additionalProps = { | ||
onPressUp: onPressUp, | ||
onClick: onClick, | ||
isDisabled: isDisabled, | ||
@@ -54,3 +52,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; | ||
@@ -67,8 +65,3 @@ 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'] | ||
}) | ||
@@ -75,0 +68,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,7 +16,5 @@ /* | ||
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; | ||
@@ -43,2 +40,3 @@ if (elementType === 'button') additionalProps = { | ||
onPressUp: onPressUp, | ||
onClick: onClick, | ||
isDisabled: isDisabled, | ||
@@ -60,8 +58,3 @@ 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'] | ||
}) | ||
@@ -68,0 +61,0 @@ }; |
{ | ||
"name": "@react-aria/button", | ||
"version": "3.0.0-nightly-2a1c28b83-250122", | ||
"version": "3.0.0-nightly-2d8e30f4f-250415", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,9 +25,8 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-aria/focus": "3.0.0-nightly-2a1c28b83-250122", | ||
"@react-aria/interactions": "3.0.0-nightly-2a1c28b83-250122", | ||
"@react-aria/toolbar": "3.0.0-nightly-2a1c28b83-250122", | ||
"@react-aria/utils": "3.0.0-nightly-2a1c28b83-250122", | ||
"@react-stately/toggle": "3.0.0-nightly-2a1c28b83-250122", | ||
"@react-types/button": "3.0.0-nightly-2a1c28b83-250122", | ||
"@react-types/shared": "3.0.0-nightly-2a1c28b83-250122", | ||
"@react-aria/interactions": "3.0.0-nightly-2d8e30f4f-250415", | ||
"@react-aria/toolbar": "3.0.0-nightly-2d8e30f4f-250415", | ||
"@react-aria/utils": "3.0.0-nightly-2d8e30f4f-250415", | ||
"@react-stately/toggle": "3.0.0-nightly-2d8e30f4f-250415", | ||
"@react-types/button": "3.0.0-nightly-2d8e30f4f-250415", | ||
"@react-types/shared": "3.0.0-nightly-2d8e30f4f-250415", | ||
"@swc/helpers": "^0.5.0" | ||
@@ -34,0 +33,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'; | ||
@@ -62,4 +61,3 @@ export interface AriaButtonOptions<E extends ElementType> extends Omit<AriaButtonProps<E>, 'children'> {} | ||
allowFocusWhenDisabled, | ||
// @ts-ignore | ||
onClick: deprecatedOnClick, | ||
onClick, | ||
href, | ||
@@ -94,2 +92,3 @@ target, | ||
onPressUp, | ||
onClick, | ||
isDisabled, | ||
@@ -113,10 +112,5 @@ 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'] | ||
}) | ||
}; | ||
} |
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
9
-10%82120
-1.7%816
-2.86%+ 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
Updated