@react-aria/radio
Advanced tools
Comparing version
var $eeb149278aae5c67$exports = require("./utils.main.js"); | ||
var $gWC9A$reactariautils = require("@react-aria/utils"); | ||
var $gWC9A$reactariafocus = require("@react-aria/focus"); | ||
var $gWC9A$reactariainteractions = require("@react-aria/interactions"); | ||
var $gWC9A$reactariaform = require("@react-aria/form"); | ||
var $gWC9A$reactariainteractions = require("@react-aria/interactions"); | ||
@@ -27,3 +26,2 @@ | ||
function $e184702b1b7f1863$export$37b0961d2f4751e2(props, state, ref) { | ||
@@ -40,13 +38,11 @@ let { value: value, children: children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby } = props; | ||
}; | ||
// Handle press state for keyboard interactions and cases where labelProps is not used. | ||
let { pressProps: pressProps, isPressed: isPressed } = (0, $gWC9A$reactariainteractions.usePress)({ | ||
isDisabled: isDisabled | ||
}); | ||
// iOS does not toggle radios if you drag off and back onto the label, so handle it ourselves. | ||
// Handle press state on the label. | ||
let { pressProps: labelProps, isPressed: isLabelPressed } = (0, $gWC9A$reactariainteractions.usePress)({ | ||
isDisabled: isDisabled, | ||
onPress () { | ||
state.setSelectedValue(value); | ||
} | ||
isDisabled: isDisabled | ||
}); | ||
let { focusableProps: focusableProps } = (0, $gWC9A$reactariafocus.useFocusable)((0, $gWC9A$reactariautils.mergeProps)(props, { | ||
let { focusableProps: focusableProps } = (0, $gWC9A$reactariainteractions.useFocusable)((0, $gWC9A$reactariautils.mergeProps)(props, { | ||
onFocus: ()=>state.setLastFocusedValue(value) | ||
@@ -69,5 +65,3 @@ }), ref); | ||
return { | ||
labelProps: (0, $gWC9A$reactariautils.mergeProps)(labelProps, { | ||
onClick: (e)=>e.preventDefault() | ||
}), | ||
labelProps: labelProps, | ||
inputProps: (0, $gWC9A$reactariautils.mergeProps)(domProps, { | ||
@@ -74,0 +68,0 @@ ...interactions, |
import {radioGroupData as $884aeceb3d67f00f$export$37b65e5b5444d35c} from "./utils.module.js"; | ||
import {mergeProps as $5jJ3f$mergeProps, filterDOMProps as $5jJ3f$filterDOMProps, useFormReset as $5jJ3f$useFormReset} from "@react-aria/utils"; | ||
import {useFocusable as $5jJ3f$useFocusable} from "@react-aria/focus"; | ||
import {usePress as $5jJ3f$usePress, useFocusable as $5jJ3f$useFocusable} from "@react-aria/interactions"; | ||
import {useFormValidation as $5jJ3f$useFormValidation} from "@react-aria/form"; | ||
import {usePress as $5jJ3f$usePress} from "@react-aria/interactions"; | ||
@@ -21,3 +20,2 @@ /* | ||
function $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref) { | ||
@@ -34,11 +32,9 @@ let { value: value, children: children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby } = props; | ||
}; | ||
// Handle press state for keyboard interactions and cases where labelProps is not used. | ||
let { pressProps: pressProps, isPressed: isPressed } = (0, $5jJ3f$usePress)({ | ||
isDisabled: isDisabled | ||
}); | ||
// iOS does not toggle radios if you drag off and back onto the label, so handle it ourselves. | ||
// Handle press state on the label. | ||
let { pressProps: labelProps, isPressed: isLabelPressed } = (0, $5jJ3f$usePress)({ | ||
isDisabled: isDisabled, | ||
onPress () { | ||
state.setSelectedValue(value); | ||
} | ||
isDisabled: isDisabled | ||
}); | ||
@@ -63,5 +59,3 @@ let { focusableProps: focusableProps } = (0, $5jJ3f$useFocusable)((0, $5jJ3f$mergeProps)(props, { | ||
return { | ||
labelProps: (0, $5jJ3f$mergeProps)(labelProps, { | ||
onClick: (e)=>e.preventDefault() | ||
}), | ||
labelProps: labelProps, | ||
inputProps: (0, $5jJ3f$mergeProps)(domProps, { | ||
@@ -68,0 +62,0 @@ ...interactions, |
{ | ||
"name": "@react-aria/radio", | ||
"version": "3.0.0-nightly-50c7ada5d-241223", | ||
"version": "3.0.0-nightly-5334df7f1-250226", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,15 +25,16 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-aria/focus": "3.0.0-nightly-50c7ada5d-241223", | ||
"@react-aria/form": "3.0.0-nightly-50c7ada5d-241223", | ||
"@react-aria/i18n": "3.0.0-nightly-50c7ada5d-241223", | ||
"@react-aria/interactions": "3.0.0-nightly-50c7ada5d-241223", | ||
"@react-aria/label": "3.0.0-nightly-50c7ada5d-241223", | ||
"@react-aria/utils": "3.0.0-nightly-50c7ada5d-241223", | ||
"@react-stately/radio": "3.0.0-nightly-50c7ada5d-241223", | ||
"@react-types/radio": "3.0.0-nightly-50c7ada5d-241223", | ||
"@react-types/shared": "3.0.0-nightly-50c7ada5d-241223", | ||
"@react-aria/focus": "3.0.0-nightly-5334df7f1-250226", | ||
"@react-aria/form": "3.0.0-nightly-5334df7f1-250226", | ||
"@react-aria/i18n": "3.0.0-nightly-5334df7f1-250226", | ||
"@react-aria/interactions": "3.0.0-nightly-5334df7f1-250226", | ||
"@react-aria/label": "3.0.0-nightly-5334df7f1-250226", | ||
"@react-aria/utils": "3.0.0-nightly-5334df7f1-250226", | ||
"@react-stately/radio": "3.0.0-nightly-5334df7f1-250226", | ||
"@react-types/radio": "3.0.0-nightly-5334df7f1-250226", | ||
"@react-types/shared": "3.0.0-nightly-5334df7f1-250226", | ||
"@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" | ||
}, | ||
@@ -40,0 +41,0 @@ "publishConfig": { |
@@ -19,5 +19,4 @@ /* | ||
import {RefObject} from '@react-types/shared'; | ||
import {useFocusable} from '@react-aria/focus'; | ||
import {useFocusable, usePress} from '@react-aria/interactions'; | ||
import {useFormValidation} from '@react-aria/form'; | ||
import {usePress} from '@react-aria/interactions'; | ||
@@ -67,2 +66,3 @@ export interface RadioAria { | ||
// Handle press state for keyboard interactions and cases where labelProps is not used. | ||
let {pressProps, isPressed} = usePress({ | ||
@@ -72,8 +72,5 @@ isDisabled | ||
// iOS does not toggle radios if you drag off and back onto the label, so handle it ourselves. | ||
// Handle press state on the label. | ||
let {pressProps: labelProps, isPressed: isLabelPressed} = usePress({ | ||
isDisabled, | ||
onPress() { | ||
state.setSelectedValue(value); | ||
} | ||
isDisabled | ||
}); | ||
@@ -103,3 +100,3 @@ | ||
return { | ||
labelProps: mergeProps(labelProps, {onClick: e => e.preventDefault()}), | ||
labelProps, | ||
inputProps: mergeProps(domProps, { | ||
@@ -106,0 +103,0 @@ ...interactions, |
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
81755
-1.2%12
9.09%1014
-1.74%+ Added
+ 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