@react-aria/tag
Advanced tools
Comparing version 3.0.0-nightly-c904e066c-240917 to 3.0.0-nightly-cc08a8dbc-250208
@@ -46,4 +46,6 @@ var $09704b0efefe5140$exports = require("./useTagGroup.main.js"); | ||
let { descriptionProps: _, ...stateWithoutDescription } = states; | ||
let isDisabled = state.disabledKeys.has(item.key) || item.props.isDisabled; | ||
let onKeyDown = (e)=>{ | ||
if (e.key === 'Delete' || e.key === 'Backspace') { | ||
if (isDisabled) return; | ||
e.preventDefault(); | ||
@@ -60,4 +62,6 @@ if (state.selectionManager.isSelected(item.key)) onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set(state.selectionManager.selectedKeys)); | ||
let descProps = (0, $8p8DL$reactariautils.useDescription)(description); | ||
let isFocused = item.key === state.selectionManager.focusedKey; | ||
// @ts-ignore - data attributes are ok but TS doesn't know about them. | ||
let isItemFocused = item.key === state.selectionManager.focusedKey; | ||
let isFocused = state.selectionManager.focusedKey != null; | ||
let tabIndex = -1; | ||
if (!isDisabled && (isItemFocused || !isFocused)) tabIndex = 0; | ||
let domProps = (0, $8p8DL$reactariautils.filterDOMProps)(item.props); | ||
@@ -69,3 +73,3 @@ let linkProps = (0, $8p8DL$reactariautils.useSyntheticLinkProps)(item.props); | ||
'aria-labelledby': `${buttonId} ${rowProps.id}`, | ||
isDisabled: state.disabledKeys.has(item.key) || item.props.isDisabled, | ||
isDisabled: isDisabled, | ||
id: buttonId, | ||
@@ -78,3 +82,3 @@ onPress: ()=>onRemove ? onRemove(new Set([ | ||
rowProps: (0, $8p8DL$reactariautils.mergeProps)(rowProps, domProps, linkProps, { | ||
tabIndex: isFocused || state.selectionManager.focusedKey == null ? 0 : -1, | ||
tabIndex: tabIndex, | ||
onKeyDown: onRemove ? onKeyDown : undefined, | ||
@@ -81,0 +85,0 @@ 'aria-describedby': descProps['aria-describedby'] |
@@ -40,4 +40,6 @@ import {hookData as $d7323bca8d074eeb$export$653eddfc964b0f8a} from "./useTagGroup.module.js"; | ||
let { descriptionProps: _, ...stateWithoutDescription } = states; | ||
let isDisabled = state.disabledKeys.has(item.key) || item.props.isDisabled; | ||
let onKeyDown = (e)=>{ | ||
if (e.key === 'Delete' || e.key === 'Backspace') { | ||
if (isDisabled) return; | ||
e.preventDefault(); | ||
@@ -54,4 +56,6 @@ if (state.selectionManager.isSelected(item.key)) onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set(state.selectionManager.selectedKeys)); | ||
let descProps = (0, $ioKwR$useDescription)(description); | ||
let isFocused = item.key === state.selectionManager.focusedKey; | ||
// @ts-ignore - data attributes are ok but TS doesn't know about them. | ||
let isItemFocused = item.key === state.selectionManager.focusedKey; | ||
let isFocused = state.selectionManager.focusedKey != null; | ||
let tabIndex = -1; | ||
if (!isDisabled && (isItemFocused || !isFocused)) tabIndex = 0; | ||
let domProps = (0, $ioKwR$filterDOMProps)(item.props); | ||
@@ -63,3 +67,3 @@ let linkProps = (0, $ioKwR$useSyntheticLinkProps)(item.props); | ||
'aria-labelledby': `${buttonId} ${rowProps.id}`, | ||
isDisabled: state.disabledKeys.has(item.key) || item.props.isDisabled, | ||
isDisabled: isDisabled, | ||
id: buttonId, | ||
@@ -72,3 +76,3 @@ onPress: ()=>onRemove ? onRemove(new Set([ | ||
rowProps: (0, $ioKwR$mergeProps)(rowProps, domProps, linkProps, { | ||
tabIndex: isFocused || state.selectionManager.focusedKey == null ? 0 : -1, | ||
tabIndex: tabIndex, | ||
onKeyDown: onRemove ? onKeyDown : undefined, | ||
@@ -75,0 +79,0 @@ 'aria-describedby': descProps['aria-describedby'] |
{ | ||
"name": "@react-aria/tag", | ||
"version": "3.0.0-nightly-c904e066c-240917", | ||
"version": "3.0.0-nightly-cc08a8dbc-250208", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,21 +25,20 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-aria/gridlist": "^3.0.0-nightly-c904e066c-240917", | ||
"@react-aria/i18n": "^3.0.0-nightly-c904e066c-240917", | ||
"@react-aria/interactions": "^3.0.0-nightly-c904e066c-240917", | ||
"@react-aria/label": "^3.0.0-nightly-c904e066c-240917", | ||
"@react-aria/selection": "^3.0.0-nightly-c904e066c-240917", | ||
"@react-aria/utils": "^3.0.0-nightly-c904e066c-240917", | ||
"@react-stately/list": "^3.0.0-nightly-c904e066c-240917", | ||
"@react-types/button": "^3.0.0-nightly-c904e066c-240917", | ||
"@react-types/shared": "^3.0.0-nightly-c904e066c-240917", | ||
"@react-aria/gridlist": "3.0.0-nightly-cc08a8dbc-250208", | ||
"@react-aria/i18n": "3.0.0-nightly-cc08a8dbc-250208", | ||
"@react-aria/interactions": "3.0.0-nightly-cc08a8dbc-250208", | ||
"@react-aria/label": "3.0.0-nightly-cc08a8dbc-250208", | ||
"@react-aria/selection": "3.0.0-nightly-cc08a8dbc-250208", | ||
"@react-aria/utils": "3.0.0-nightly-cc08a8dbc-250208", | ||
"@react-stately/list": "3.0.0-nightly-cc08a8dbc-250208", | ||
"@react-types/button": "3.0.0-nightly-cc08a8dbc-250208", | ||
"@react-types/shared": "3.0.0-nightly-cc08a8dbc-250208", | ||
"@swc/helpers": "^0.5.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0", | ||
"react-dom": "^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.4.5" | ||
} | ||
} |
@@ -64,4 +64,9 @@ /* | ||
let isDisabled = state.disabledKeys.has(item.key) || item.props.isDisabled; | ||
let onKeyDown = (e: KeyboardEvent) => { | ||
if (e.key === 'Delete' || e.key === 'Backspace') { | ||
if (isDisabled) { | ||
return; | ||
} | ||
e.preventDefault(); | ||
@@ -83,4 +88,9 @@ if (state.selectionManager.isSelected(item.key)) { | ||
let isFocused = item.key === state.selectionManager.focusedKey; | ||
// @ts-ignore - data attributes are ok but TS doesn't know about them. | ||
let isItemFocused = item.key === state.selectionManager.focusedKey; | ||
let isFocused = state.selectionManager.focusedKey != null; | ||
let tabIndex = -1; | ||
if (!isDisabled && (isItemFocused || !isFocused)) { | ||
tabIndex = 0; | ||
} | ||
let domProps = filterDOMProps(item.props); | ||
@@ -92,3 +102,3 @@ let linkProps = useSyntheticLinkProps(item.props); | ||
'aria-labelledby': `${buttonId} ${rowProps.id}`, | ||
isDisabled: state.disabledKeys.has(item.key) || item.props.isDisabled, | ||
isDisabled, | ||
id: buttonId, | ||
@@ -99,3 +109,3 @@ onPress: () => onRemove ? onRemove(new Set([item.key])) : null, | ||
rowProps: mergeProps(rowProps, domProps, linkProps, { | ||
tabIndex: (isFocused || state.selectionManager.focusedKey == null) ? 0 : -1, | ||
tabIndex, | ||
onKeyDown: onRemove ? onKeyDown : undefined, | ||
@@ -102,0 +112,0 @@ 'aria-describedby': descProps['aria-describedby'] |
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
139591
1666
+ Added@internationalized/date@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@internationalized/message@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@internationalized/number@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@internationalized/string@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-aria/focus@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-aria/grid@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-aria/gridlist@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-aria/i18n@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-aria/interactions@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-aria/label@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-aria/live-announcer@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-aria/selection@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-aria/ssr@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-aria/utils@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-stately/collections@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-stately/flags@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-stately/grid@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-stately/list@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-stately/selection@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-stately/tree@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-stately/utils@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-types/button@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-types/checkbox@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-types/grid@3.0.0-nightly-cc08a8dbc-250208(transitive)
+ Added@react-types/shared@3.0.0-nightly-cc08a8dbc-250208(transitive)
- Removed@internationalized/date@3.7.0(transitive)
- Removed@internationalized/message@3.1.6(transitive)
- Removed@internationalized/number@3.6.0(transitive)
- Removed@internationalized/string@3.2.5(transitive)
- Removed@react-aria/focus@3.19.1(transitive)
- Removed@react-aria/grid@3.11.1(transitive)
- Removed@react-aria/gridlist@3.10.1(transitive)
- Removed@react-aria/i18n@3.12.5(transitive)
- Removed@react-aria/interactions@3.23.0(transitive)
- Removed@react-aria/label@3.7.14(transitive)
- Removed@react-aria/live-announcer@3.4.1(transitive)
- Removed@react-aria/selection@3.22.0(transitive)
- Removed@react-aria/ssr@3.9.7(transitive)
- Removed@react-aria/utils@3.27.0(transitive)
- Removed@react-stately/collections@3.12.1(transitive)
- Removed@react-stately/grid@3.10.1(transitive)
- Removed@react-stately/list@3.11.2(transitive)
- Removed@react-stately/selection@3.19.0(transitive)
- Removed@react-stately/tree@3.8.7(transitive)
- Removed@react-stately/utils@3.10.5(transitive)
- Removed@react-types/button@3.10.2(transitive)
- Removed@react-types/checkbox@3.9.1(transitive)
- Removed@react-types/grid@3.2.11(transitive)
- Removed@react-types/shared@3.27.0(transitive)
Updated@react-aria/interactions@3.0.0-nightly-cc08a8dbc-250208