@react-aria/tabs
Advanced tools
Comparing version 3.0.0-nightly.774 to 3.0.0-nightly.778
@@ -17,3 +17,4 @@ var { | ||
mergeProps, | ||
useId | ||
useId, | ||
useLabels | ||
} = require("@react-aria/utils"); | ||
@@ -150,3 +151,2 @@ | ||
isDisabled, | ||
'aria-label': ariaLabel, | ||
orientation = 'horizontal', | ||
@@ -173,9 +173,4 @@ keyboardActivation = 'automatic' | ||
disallowEmptySelection: true | ||
}); // Ensure a tab is always selected | ||
}); // Compute base id for all tabs | ||
if (manager.isEmpty) { | ||
manager.replaceSelection(delegate.getFirstKey()); | ||
} // Compute base id for all tabs | ||
let tabsId = useId(); | ||
@@ -190,7 +185,9 @@ $d3534b2e5f49231696504$var$tabsIds.set(state, tabsId); | ||
let tabIndex = isFocusWithin ? -1 : 0; | ||
let tabListLabelProps = useLabels(_babelRuntimeHelpersExtends({}, props, { | ||
id: tabsId | ||
})); | ||
return { | ||
tabListProps: _babelRuntimeHelpersExtends({}, mergeProps(focusWithinProps, collectionProps), { | ||
tabListProps: _babelRuntimeHelpersExtends({}, mergeProps(focusWithinProps, collectionProps, tabListLabelProps), { | ||
role: 'tablist', | ||
'aria-disabled': isDisabled, | ||
'aria-label': ariaLabel, | ||
tabIndex: isDisabled ? null : tabIndex | ||
@@ -197,0 +194,0 @@ }), |
import { useSelectableCollection, useSelectableItem } from "@react-aria/selection"; | ||
import { useLocale } from "@react-aria/i18n"; | ||
import { useFocusWithin, usePress } from "@react-aria/interactions"; | ||
import { mergeProps, useId } from "@react-aria/utils"; | ||
import { mergeProps, useId, useLabels } from "@react-aria/utils"; | ||
import { useMemo, useState } from "react"; | ||
@@ -125,3 +125,2 @@ import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends"; | ||
isDisabled, | ||
'aria-label': ariaLabel, | ||
orientation = 'horizontal', | ||
@@ -148,9 +147,4 @@ keyboardActivation = 'automatic' | ||
disallowEmptySelection: true | ||
}); // Ensure a tab is always selected | ||
}); // Compute base id for all tabs | ||
if (manager.isEmpty) { | ||
manager.replaceSelection(delegate.getFirstKey()); | ||
} // Compute base id for all tabs | ||
let tabsId = useId(); | ||
@@ -165,7 +159,9 @@ $a98339edf5b490c874cb7f3b44b70$var$tabsIds.set(state, tabsId); | ||
let tabIndex = isFocusWithin ? -1 : 0; | ||
let tabListLabelProps = useLabels(_babelRuntimeHelpersEsmExtends({}, props, { | ||
id: tabsId | ||
})); | ||
return { | ||
tabListProps: _babelRuntimeHelpersEsmExtends({}, mergeProps(focusWithinProps, collectionProps), { | ||
tabListProps: _babelRuntimeHelpersEsmExtends({}, mergeProps(focusWithinProps, collectionProps, tabListLabelProps), { | ||
role: 'tablist', | ||
'aria-disabled': isDisabled, | ||
'aria-label': ariaLabel, | ||
tabIndex: isDisabled ? null : tabIndex | ||
@@ -172,0 +168,0 @@ }), |
{ | ||
"name": "@react-aria/tabs", | ||
"version": "3.0.0-nightly.774+f8a02707", | ||
"version": "3.0.0-nightly.778+32a59e19", | ||
"description": "Spectrum UI components in React", | ||
@@ -21,9 +21,9 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@react-aria/i18n": "3.0.0-nightly.774+f8a02707", | ||
"@react-aria/interactions": "3.0.0-nightly.774+f8a02707", | ||
"@react-aria/selection": "3.0.0-nightly.774+f8a02707", | ||
"@react-aria/utils": "3.0.0-nightly.774+f8a02707", | ||
"@react-stately/list": "3.2.2-nightly.2452+f8a02707", | ||
"@react-types/shared": "3.0.0-nightly.774+f8a02707", | ||
"@react-types/tabs": "3.0.0-nightly.2452+f8a02707" | ||
"@react-aria/i18n": "3.0.0-nightly.778+32a59e19", | ||
"@react-aria/interactions": "3.0.0-nightly.778+32a59e19", | ||
"@react-aria/selection": "3.0.0-nightly.778+32a59e19", | ||
"@react-aria/utils": "3.0.0-nightly.778+32a59e19", | ||
"@react-stately/list": "3.2.2-nightly.2456+32a59e19", | ||
"@react-types/shared": "3.0.0-nightly.778+32a59e19", | ||
"@react-types/tabs": "3.0.0-nightly.2456+32a59e19" | ||
}, | ||
@@ -36,3 +36,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "f8a02707da1932fe5d0a12acc7a8c1d646fa133c" | ||
"gitHead": "32a59e198acd249536c92347767eedfcd3470590" | ||
} |
@@ -13,3 +13,3 @@ /* | ||
import {HTMLAttributes, Key, RefObject, useMemo, useState} from 'react'; | ||
import {mergeProps, useId} from '@react-aria/utils'; | ||
import {mergeProps, useId, useLabels} from '@react-aria/utils'; | ||
import {SingleSelectListState} from '@react-stately/list'; | ||
@@ -34,3 +34,2 @@ import {TabAriaProps, TabsAriaProps} from '@react-types/tabs'; | ||
isDisabled, | ||
'aria-label': ariaLabel, | ||
orientation = 'horizontal', | ||
@@ -60,7 +59,2 @@ keyboardActivation = 'automatic' | ||
// Ensure a tab is always selected | ||
if (manager.isEmpty) { | ||
manager.replaceSelection(delegate.getFirstKey()); | ||
} | ||
// Compute base id for all tabs | ||
@@ -75,9 +69,9 @@ let tabsId = useId(); | ||
let tabIndex = isFocusWithin ? -1 : 0; | ||
let tabListLabelProps = useLabels({...props, id: tabsId}); | ||
return { | ||
tabListProps: { | ||
...mergeProps(focusWithinProps, collectionProps), | ||
...mergeProps(focusWithinProps, collectionProps, tabListLabelProps), | ||
role: 'tablist', | ||
'aria-disabled': isDisabled, | ||
'aria-label': ariaLabel, | ||
tabIndex: isDisabled ? null : tabIndex | ||
@@ -84,0 +78,0 @@ }, |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
61492
650