@react-aria/listbox
Advanced tools
Comparing version 3.0.0-rc.0 to 3.0.0-rc.1
@@ -65,3 +65,3 @@ var { | ||
exports.useListBox = useListBox; | ||
const $f10fc7bba5e201cb95788604af75$var$isSafariMacOS = typeof window !== 'undefined' && window.navigator != null ? /^Mac/.test(window.navigator.platform) && /Safari/.test(window.navigator.userAgent) && !/Chrome/.test(window.navigator.userAgent) : false; | ||
/** | ||
@@ -73,2 +73,3 @@ * Provides the behavior and accessibility implementation for an option in a listbox. | ||
*/ | ||
function useOption(props, state, ref) { | ||
@@ -88,8 +89,13 @@ let { | ||
'aria-disabled': isDisabled, | ||
'aria-selected': isSelected, | ||
'aria-label': props['aria-label'], | ||
'aria-labelledby': labelId, | ||
'aria-describedby': descriptionId | ||
}; | ||
'aria-selected': isSelected | ||
}; // Safari with VoiceOver on macOS misreads options with aria-labelledby or aria-label as simply "text". | ||
// We should not map slots to the label and description on Safari and instead just have VoiceOver read the textContent. | ||
// https://bugs.webkit.org/show_bug.cgi?id=209279 | ||
if (!$f10fc7bba5e201cb95788604af75$var$isSafariMacOS) { | ||
optionProps['aria-label'] = props['aria-label']; | ||
optionProps['aria-labelledby'] = labelId; | ||
optionProps['aria-describedby'] = descriptionId; | ||
} | ||
if (isVirtualized) { | ||
@@ -128,3 +134,3 @@ optionProps['aria-posinset'] = state.collection.getItem(key).index + 1; | ||
return { | ||
optionProps: _babelRuntimeHelpersExtends({}, optionProps, {}, mergeProps(pressProps, hoverProps)), | ||
optionProps: _babelRuntimeHelpersExtends({}, optionProps, mergeProps(pressProps, hoverProps)), | ||
labelProps: { | ||
@@ -131,0 +137,0 @@ id: labelId |
@@ -41,3 +41,3 @@ import { isFocusVisible, useHover, usePress } from "@react-aria/interactions"; | ||
} | ||
const $d79719e4e3369b10c98de169e0d7fe$var$isSafariMacOS = typeof window !== 'undefined' && window.navigator != null ? /^Mac/.test(window.navigator.platform) && /Safari/.test(window.navigator.userAgent) && !/Chrome/.test(window.navigator.userAgent) : false; | ||
/** | ||
@@ -49,2 +49,3 @@ * Provides the behavior and accessibility implementation for an option in a listbox. | ||
*/ | ||
export function useOption(props, state, ref) { | ||
@@ -64,8 +65,13 @@ let { | ||
'aria-disabled': isDisabled, | ||
'aria-selected': isSelected, | ||
'aria-label': props['aria-label'], | ||
'aria-labelledby': labelId, | ||
'aria-describedby': descriptionId | ||
}; | ||
'aria-selected': isSelected | ||
}; // Safari with VoiceOver on macOS misreads options with aria-labelledby or aria-label as simply "text". | ||
// We should not map slots to the label and description on Safari and instead just have VoiceOver read the textContent. | ||
// https://bugs.webkit.org/show_bug.cgi?id=209279 | ||
if (!$d79719e4e3369b10c98de169e0d7fe$var$isSafariMacOS) { | ||
optionProps['aria-label'] = props['aria-label']; | ||
optionProps['aria-labelledby'] = labelId; | ||
optionProps['aria-describedby'] = descriptionId; | ||
} | ||
if (isVirtualized) { | ||
@@ -104,3 +110,3 @@ optionProps['aria-posinset'] = state.collection.getItem(key).index + 1; | ||
return { | ||
optionProps: _babelRuntimeHelpersEsmExtends({}, optionProps, {}, mergeProps(pressProps, hoverProps)), | ||
optionProps: _babelRuntimeHelpersEsmExtends({}, optionProps, mergeProps(pressProps, hoverProps)), | ||
labelProps: { | ||
@@ -107,0 +113,0 @@ id: labelId |
{ | ||
"name": "@react-aria/listbox", | ||
"version": "3.0.0-rc.0", | ||
"version": "3.0.0-rc.1", | ||
"description": "Spectrum UI components in React", | ||
@@ -11,3 +11,4 @@ "license": "Apache-2.0", | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"src" | ||
], | ||
@@ -21,9 +22,9 @@ "sideEffects": false, | ||
"@babel/runtime": "^7.6.2", | ||
"@react-aria/interactions": "3.0.0-rc.3", | ||
"@react-aria/label": "3.0.0-rc.3", | ||
"@react-aria/selection": "3.0.0-rc.0", | ||
"@react-aria/utils": "3.0.0-rc.3", | ||
"@react-stately/list": "3.0.0-rc.0", | ||
"@react-types/listbox": "3.0.0-rc.0", | ||
"@react-types/shared": "3.0.0-rc.3" | ||
"@react-aria/interactions": "3.0.0-rc.4", | ||
"@react-aria/label": "3.0.0-rc.4", | ||
"@react-aria/selection": "3.0.0-rc.1", | ||
"@react-aria/utils": "3.0.0-rc.4", | ||
"@react-stately/list": "3.0.0-rc.1", | ||
"@react-types/listbox": "3.0.0-rc.1", | ||
"@react-types/shared": "3.0.0-rc.4" | ||
}, | ||
@@ -36,3 +37,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "461d6321126ae9b4f1508aa912f7b36bf8a603f8" | ||
"gitHead": "ee5ad1544ed65366c0fadabc2c63d39573ba3ffd" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
63996
12
622
0
+ Added@react-aria/focus@3.0.0-rc.4(transitive)
+ Added@react-aria/i18n@3.0.0-rc.4(transitive)
+ Added@react-aria/interactions@3.0.0-rc.4(transitive)
+ Added@react-aria/label@3.0.0-rc.4(transitive)
+ Added@react-aria/selection@3.0.0-rc.1(transitive)
+ Added@react-aria/utils@3.0.0-rc.4(transitive)
+ Added@react-stately/collections@3.0.0-rc.1(transitive)
+ Added@react-stately/list@3.0.0-rc.1(transitive)
+ Added@react-stately/selection@3.0.0-rc.1(transitive)
+ Added@react-stately/utils@3.0.0-rc.4(transitive)
+ Added@react-types/label@3.0.0-rc.4(transitive)
+ Added@react-types/listbox@3.0.0-rc.1(transitive)
+ Added@react-types/shared@3.0.0-rc.4(transitive)
- Removed@react-aria/focus@3.0.0-rc.3(transitive)
- Removed@react-aria/i18n@3.0.0-rc.3(transitive)
- Removed@react-aria/interactions@3.0.0-rc.3(transitive)
- Removed@react-aria/label@3.0.0-rc.3(transitive)
- Removed@react-aria/selection@3.0.0-rc.0(transitive)
- Removed@react-aria/utils@3.0.0-rc.3(transitive)
- Removed@react-stately/collections@3.0.0-rc.0(transitive)
- Removed@react-stately/list@3.0.0-rc.0(transitive)
- Removed@react-stately/selection@3.0.0-rc.0(transitive)
- Removed@react-stately/utils@3.0.0-rc.3(transitive)
- Removed@react-types/label@3.0.0-rc.3(transitive)
- Removed@react-types/listbox@3.0.0-rc.0(transitive)
- Removed@react-types/menu@3.0.0-rc.0(transitive)
- Removed@react-types/overlays@3.0.0-rc.0(transitive)
- Removed@react-types/shared@3.0.0-rc.3(transitive)
Updated@react-aria/label@3.0.0-rc.4
Updated@react-aria/utils@3.0.0-rc.4