@react-aria/listbox 3.14.0 → 3.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -105,7 +105,7 @@ function $c164f9f79f4cef2d$export$497855f14858aa34(props, state, ref) {
105
105
  id: descriptionId
106
106
  },
107
107
  isFocused: isFocused,
108
- isFocusVisible: isFocused && (0, $bOFHO$reactariainteractions.isFocusVisible)(),
108
+ isFocusVisible: isFocused && state.selectionManager.isFocused && (0, $bOFHO$reactariainteractions.isFocusVisible)(),
109
109
  isSelected: isSelected,
110
110
  isDisabled: isDisabled,
111
111
  isPressed: isPressed,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA6EM,SAAS,0CAAa,KAAsB,EAAE,KAAmB,EAAE,GAAuC;QAkDvF,aAA8B;IAjDtD,IAAI,OACF,GAAG,EACJ,GAAG;IAEJ,IAAI,OAAO,CAAA,GAAA,kCAAO,EAAE,GAAG,CAAC;QAEP;IAAjB,IAAI,aAAa,CAAA,oBAAA,MAAM,UAAU,cAAhB,+BAAA,oBAAoB,MAAM,gBAAgB,CAAC,UAAU,CAAC;QACtD;IAAjB,IAAI,aAAa,CAAA,oBAAA,MAAM,UAAU,cAAhB,+BAAA,oBAAoB,MAAM,gBAAgB,CAAC,UAAU,CAAC;QAC3C;IAA5B,IAAI,wBAAwB,CAAA,+BAAA,MAAM,qBAAqB,cAA3B,0CAAA,+BAA+B,iBAAA,2BAAA,KAAM,qBAAqB;QAC7D;IAAzB,IAAI,qBAAqB,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,iBAAA,2BAAA,KAAM,kBAAkB;QACjD;IAA5B,IAAI,wBAAwB,CAAA,+BAAA,MAAM,qBAAqB,cAA3B,0CAAA,+BAA+B,iBAAA,2BAAA,KAAM,qBAAqB;QAClE;IAApB,IAAI,gBAAgB,CAAA,uBAAA,MAAM,aAAa,cAAnB,kCAA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I,EAAE,iBAAA,4BAAA,eAAA,KAAM,KAAK,cAAX,mCAAA,aAAa,QAAQ,EAAE,YAAY;QACvF,YAAY,EAAE,iBAAA,2BAAA,KAAM,YAAY;YAChC;IACF;IAEA,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;QAC1B,YAAY,cAAc,CAAC;QAC3B;YACE,IAAI,CAAC,CAAA,GAAA,2CAAa,KAAK;gBACrB,MAAM,gBAAgB,CAAC,UAAU,CAAC;gBAClC,MAAM,gBAAgB,CAAC,aAAa,CAAC;YACvC;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,iBAAA,2BAAA,KAAM,KAAK;IACzC,OAAO,SAAS,EAAE;IAClB,IAAI,YAAY,CAAA,GAAA,kCAAW,EAAE,iBAAA,2BAAA,KAAM,KAAK;IAExC,OAAO;QACL,aAAa;YACX,GAAG,WAAW;YACd,GAAG,CAAA,GAAA,gCAAS,EAAE,UAAU,WAAW,YAAY,UAAU;gBACzD;QACF;QACA,YAAY;YACV,IAAI;QACN;QACA,kBAAkB;YAChB,IAAI;QACN;mBACA;QACA,gBAAgB,aAAa,CAAA,GAAA,2CAAa;oBAC1C;oBACA;mBACA;yBACA;mBACA;IACF;AACF","sources":["packages/@react-aria/listbox/src/useOption.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {chain, filterDOMProps, isMac, isWebKit, mergeProps, useLinkProps, useSlotId} from '@react-aria/utils';\nimport {DOMAttributes, FocusableElement, Key, RefObject} from '@react-types/shared';\nimport {getItemCount} from '@react-stately/collections';\nimport {getItemId, listData} from './utils';\nimport {isFocusVisible, useHover} from '@react-aria/interactions';\nimport {ListState} from '@react-stately/list';\nimport {SelectableItemStates, useSelectableItem} from '@react-aria/selection';\n\nexport interface OptionAria extends SelectableItemStates {\n /** Props for the option element. */\n optionProps: DOMAttributes,\n\n /** Props for the main text element inside the option. */\n labelProps: DOMAttributes,\n\n /** Props for the description text element inside the option, if any. */\n descriptionProps: DOMAttributes,\n\n /** Whether the option is currently focused. */\n isFocused: boolean,\n\n /** Whether the option is keyboard focused. */\n isFocusVisible: boolean\n}\n\nexport interface AriaOptionProps {\n /**\n * Whether the option is disabled.\n * @deprecated\n */\n isDisabled?: boolean,\n\n /**\n * Whether the option is selected.\n * @deprecated\n */\n isSelected?: boolean,\n\n /** A screen reader only label for the option. */\n 'aria-label'?: string,\n\n /** The unique key for the option. */\n key: Key,\n\n /**\n * Whether selection should occur on press up instead of press down.\n * @deprecated\n */\n shouldSelectOnPressUp?: boolean,\n\n /**\n * Whether the option should be focused when the user hovers over it.\n * @deprecated\n */\n shouldFocusOnHover?: boolean,\n\n /**\n * Whether the option is contained in a virtual scrolling listbox.\n * @deprecated\n */\n isVirtualized?: boolean,\n\n /**\n * Whether the option should use virtual focus instead of being focused directly.\n * @deprecated\n */\n shouldUseVirtualFocus?: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for an option in a listbox.\n * See `useListBox` for more details about listboxes.\n * @param props - Props for the option.\n * @param state - State for the listbox, as returned by `useListState`.\n */\nexport function useOption<T>(props: AriaOptionProps, state: ListState<T>, ref: RefObject<FocusableElement | null>): OptionAria {\n let {\n key\n } = props;\n\n let data = listData.get(state);\n\n let isDisabled = props.isDisabled ?? state.selectionManager.isDisabled(key);\n let isSelected = props.isSelected ?? state.selectionManager.isSelected(key);\n let shouldSelectOnPressUp = props.shouldSelectOnPressUp ?? data?.shouldSelectOnPressUp;\n let shouldFocusOnHover = props.shouldFocusOnHover ?? data?.shouldFocusOnHover;\n let shouldUseVirtualFocus = props.shouldUseVirtualFocus ?? data?.shouldUseVirtualFocus;\n let isVirtualized = props.isVirtualized ?? data?.isVirtualized;\n\n let labelId = useSlotId();\n let descriptionId = useSlotId();\n\n let optionProps = {\n role: 'option',\n 'aria-disabled': isDisabled || undefined,\n 'aria-selected': state.selectionManager.selectionMode !== 'none' ? isSelected : undefined\n };\n\n // Safari with VoiceOver on macOS misreads options with aria-labelledby or aria-label as simply \"text\".\n // We should not map slots to the label and description on Safari and instead just have VoiceOver read the textContent.\n // https://bugs.webkit.org/show_bug.cgi?id=209279\n if (!(isMac() && isWebKit())) {\n optionProps['aria-label'] = props['aria-label'];\n optionProps['aria-labelledby'] = labelId;\n optionProps['aria-describedby'] = descriptionId;\n }\n\n let item = state.collection.getItem(key);\n if (isVirtualized) {\n let index = Number(item?.index);\n optionProps['aria-posinset'] = Number.isNaN(index) ? undefined : index + 1;\n optionProps['aria-setsize'] = getItemCount(state.collection);\n }\n\n let onAction = data?.onAction ? () => data?.onAction?.(key) : undefined;\n let id = getItemId(state, key);\n let {itemProps, isPressed, isFocused, hasAction, allowsSelection} = useSelectableItem({\n selectionManager: state.selectionManager,\n key,\n ref,\n shouldSelectOnPressUp,\n allowsDifferentPressOrigin: shouldSelectOnPressUp && shouldFocusOnHover,\n isVirtualized,\n shouldUseVirtualFocus,\n isDisabled,\n onAction: onAction || item?.props?.onAction ? chain(item?.props?.onAction, onAction) : undefined,\n linkBehavior: data?.linkBehavior,\n id\n });\n\n let {hoverProps} = useHover({\n isDisabled: isDisabled || !shouldFocusOnHover,\n onHoverStart() {\n if (!isFocusVisible()) {\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(key);\n }\n }\n });\n\n let domProps = filterDOMProps(item?.props);\n delete domProps.id;\n let linkProps = useLinkProps(item?.props);\n\n return {\n optionProps: {\n ...optionProps,\n ...mergeProps(domProps, itemProps, hoverProps, linkProps),\n id\n },\n labelProps: {\n id: labelId\n },\n descriptionProps: {\n id: descriptionId\n },\n isFocused,\n isFocusVisible: isFocused && isFocusVisible(),\n isSelected,\n isDisabled,\n isPressed,\n allowsSelection,\n hasAction\n };\n}\n"],"names":[],"version":3,"file":"useOption.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA6EM,SAAS,0CAAa,KAAsB,EAAE,KAAmB,EAAE,GAAuC;QAkDvF,aAA8B;IAjDtD,IAAI,OACF,GAAG,EACJ,GAAG;IAEJ,IAAI,OAAO,CAAA,GAAA,kCAAO,EAAE,GAAG,CAAC;QAEP;IAAjB,IAAI,aAAa,CAAA,oBAAA,MAAM,UAAU,cAAhB,+BAAA,oBAAoB,MAAM,gBAAgB,CAAC,UAAU,CAAC;QACtD;IAAjB,IAAI,aAAa,CAAA,oBAAA,MAAM,UAAU,cAAhB,+BAAA,oBAAoB,MAAM,gBAAgB,CAAC,UAAU,CAAC;QAC3C;IAA5B,IAAI,wBAAwB,CAAA,+BAAA,MAAM,qBAAqB,cAA3B,0CAAA,+BAA+B,iBAAA,2BAAA,KAAM,qBAAqB;QAC7D;IAAzB,IAAI,qBAAqB,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,iBAAA,2BAAA,KAAM,kBAAkB;QACjD;IAA5B,IAAI,wBAAwB,CAAA,+BAAA,MAAM,qBAAqB,cAA3B,0CAAA,+BAA+B,iBAAA,2BAAA,KAAM,qBAAqB;QAClE;IAApB,IAAI,gBAAgB,CAAA,uBAAA,MAAM,aAAa,cAAnB,kCAAA,uBAAuB,iBAAA,2BAAA,KAAM,aAAa;IAE9D,IAAI,UAAU,CAAA,GAAA,+BAAQ;IACtB,IAAI,gBAAgB,CAAA,GAAA,+BAAQ;IAE5B,IAAI,cAAc;QAChB,MAAM;QACN,iBAAiB,cAAc;QAC/B,iBAAiB,MAAM,gBAAgB,CAAC,aAAa,KAAK,SAAS,aAAa;IAClF;IAEA,uGAAuG;IACvG,uHAAuH;IACvH,iDAAiD;IACjD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,gBAAgB,CAAC,UAAU,CAAC;gBAClC,MAAM,gBAAgB,CAAC,aAAa,CAAC;YACvC;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,iBAAA,2BAAA,KAAM,KAAK;IACzC,OAAO,SAAS,EAAE;IAClB,IAAI,YAAY,CAAA,GAAA,kCAAW,EAAE,iBAAA,2BAAA,KAAM,KAAK;IAExC,OAAO;QACL,aAAa;YACX,GAAG,WAAW;YACd,GAAG,CAAA,GAAA,gCAAS,EAAE,UAAU,WAAW,YAAY,UAAU;gBACzD;QACF;QACA,YAAY;YACV,IAAI;QACN;QACA,kBAAkB;YAChB,IAAI;QACN;mBACA;QACA,gBAAgB,aAAa,MAAM,gBAAgB,CAAC,SAAS,IAAI,CAAA,GAAA,2CAAa;oBAC9E;oBACA;mBACA;yBACA;mBACA;IACF;AACF","sources":["packages/@react-aria/listbox/src/useOption.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {chain, filterDOMProps, isMac, isWebKit, mergeProps, useLinkProps, useSlotId} from '@react-aria/utils';\nimport {DOMAttributes, FocusableElement, Key, RefObject} from '@react-types/shared';\nimport {getItemCount} from '@react-stately/collections';\nimport {getItemId, listData} from './utils';\nimport {isFocusVisible, useHover} from '@react-aria/interactions';\nimport {ListState} from '@react-stately/list';\nimport {SelectableItemStates, useSelectableItem} from '@react-aria/selection';\n\nexport interface OptionAria extends SelectableItemStates {\n /** Props for the option element. */\n optionProps: DOMAttributes,\n\n /** Props for the main text element inside the option. */\n labelProps: DOMAttributes,\n\n /** Props for the description text element inside the option, if any. */\n descriptionProps: DOMAttributes,\n\n /** Whether the option is currently focused. */\n isFocused: boolean,\n\n /** Whether the option is keyboard focused. */\n isFocusVisible: boolean\n}\n\nexport interface AriaOptionProps {\n /**\n * Whether the option is disabled.\n * @deprecated\n */\n isDisabled?: boolean,\n\n /**\n * Whether the option is selected.\n * @deprecated\n */\n isSelected?: boolean,\n\n /** A screen reader only label for the option. */\n 'aria-label'?: string,\n\n /** The unique key for the option. */\n key: Key,\n\n /**\n * Whether selection should occur on press up instead of press down.\n * @deprecated\n */\n shouldSelectOnPressUp?: boolean,\n\n /**\n * Whether the option should be focused when the user hovers over it.\n * @deprecated\n */\n shouldFocusOnHover?: boolean,\n\n /**\n * Whether the option is contained in a virtual scrolling listbox.\n * @deprecated\n */\n isVirtualized?: boolean,\n\n /**\n * Whether the option should use virtual focus instead of being focused directly.\n * @deprecated\n */\n shouldUseVirtualFocus?: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for an option in a listbox.\n * See `useListBox` for more details about listboxes.\n * @param props - Props for the option.\n * @param state - State for the listbox, as returned by `useListState`.\n */\nexport function useOption<T>(props: AriaOptionProps, state: ListState<T>, ref: RefObject<FocusableElement | null>): OptionAria {\n let {\n key\n } = props;\n\n let data = listData.get(state);\n\n let isDisabled = props.isDisabled ?? state.selectionManager.isDisabled(key);\n let isSelected = props.isSelected ?? state.selectionManager.isSelected(key);\n let shouldSelectOnPressUp = props.shouldSelectOnPressUp ?? data?.shouldSelectOnPressUp;\n let shouldFocusOnHover = props.shouldFocusOnHover ?? data?.shouldFocusOnHover;\n let shouldUseVirtualFocus = props.shouldUseVirtualFocus ?? data?.shouldUseVirtualFocus;\n let isVirtualized = props.isVirtualized ?? data?.isVirtualized;\n\n let labelId = useSlotId();\n let descriptionId = useSlotId();\n\n let optionProps = {\n role: 'option',\n 'aria-disabled': isDisabled || undefined,\n 'aria-selected': state.selectionManager.selectionMode !== 'none' ? isSelected : undefined\n };\n\n // Safari with VoiceOver on macOS misreads options with aria-labelledby or aria-label as simply \"text\".\n // We should not map slots to the label and description on Safari and instead just have VoiceOver read the textContent.\n // https://bugs.webkit.org/show_bug.cgi?id=209279\n if (!(isMac() && isWebKit())) {\n optionProps['aria-label'] = props['aria-label'];\n optionProps['aria-labelledby'] = labelId;\n optionProps['aria-describedby'] = descriptionId;\n }\n\n let item = state.collection.getItem(key);\n if (isVirtualized) {\n let index = Number(item?.index);\n optionProps['aria-posinset'] = Number.isNaN(index) ? undefined : index + 1;\n optionProps['aria-setsize'] = getItemCount(state.collection);\n }\n\n let onAction = data?.onAction ? () => data?.onAction?.(key) : undefined;\n let id = getItemId(state, key);\n let {itemProps, isPressed, isFocused, hasAction, allowsSelection} = useSelectableItem({\n selectionManager: state.selectionManager,\n key,\n ref,\n shouldSelectOnPressUp,\n allowsDifferentPressOrigin: shouldSelectOnPressUp && shouldFocusOnHover,\n isVirtualized,\n shouldUseVirtualFocus,\n isDisabled,\n onAction: onAction || item?.props?.onAction ? chain(item?.props?.onAction, onAction) : undefined,\n linkBehavior: data?.linkBehavior,\n id\n });\n\n let {hoverProps} = useHover({\n isDisabled: isDisabled || !shouldFocusOnHover,\n onHoverStart() {\n if (!isFocusVisible()) {\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(key);\n }\n }\n });\n\n let domProps = filterDOMProps(item?.props);\n delete domProps.id;\n let linkProps = useLinkProps(item?.props);\n\n return {\n optionProps: {\n ...optionProps,\n ...mergeProps(domProps, itemProps, hoverProps, linkProps),\n id\n },\n labelProps: {\n id: labelId\n },\n descriptionProps: {\n id: descriptionId\n },\n isFocused,\n isFocusVisible: isFocused && state.selectionManager.isFocused && isFocusVisible(),\n isSelected,\n isDisabled,\n isPressed,\n allowsSelection,\n hasAction\n };\n}\n"],"names":[],"version":3,"file":"useOption.main.js.map"}
@@ -99,7 +99,7 @@ function $293f70390ea03370$export$497855f14858aa34(props, state, ref) {
99
99
  id: descriptionId
100
100
  },
101
101
  isFocused: isFocused,
102
- isFocusVisible: isFocused && (0, $fcwmx$isFocusVisible)(),
102
+ isFocusVisible: isFocused && state.selectionManager.isFocused && (0, $fcwmx$isFocusVisible)(),
103
103
  isSelected: isSelected,
104
104
  isDisabled: isDisabled,
105
105
  isPressed: isPressed,
@@ -99,7 +99,7 @@ function $293f70390ea03370$export$497855f14858aa34(props, state, ref) {
99
99
  id: descriptionId
100
100
  },
101
101
  isFocused: isFocused,
102
- isFocusVisible: isFocused && (0, $fcwmx$isFocusVisible)(),
102
+ isFocusVisible: isFocused && state.selectionManager.isFocused && (0, $fcwmx$isFocusVisible)(),
103
103
  isSelected: isSelected,
104
104
  isDisabled: isDisabled,
105
105
  isPressed: isPressed,
@@ -1 +1 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA6EM,SAAS,0CAAa,KAAsB,EAAE,KAAmB,EAAE,GAAuC;QAkDvF,aAA8B;IAjDtD,IAAI,OACF,GAAG,EACJ,GAAG;IAEJ,IAAI,OAAO,CAAA,GAAA,yCAAO,EAAE,GAAG,CAAC;QAEP;IAAjB,IAAI,aAAa,CAAA,oBAAA,MAAM,UAAU,cAAhB,+BAAA,oBAAoB,MAAM,gBAAgB,CAAC,UAAU,CAAC;QACtD;IAAjB,IAAI,aAAa,CAAA,oBAAA,MAAM,UAAU,cAAhB,+BAAA,oBAAoB,MAAM,gBAAgB,CAAC,UAAU,CAAC;QAC3C;IAA5B,IAAI,wBAAwB,CAAA,+BAAA,MAAM,qBAAqB,cAA3B,0CAAA,+BAA+B,iBAAA,2BAAA,KAAM,qBAAqB;QAC7D;IAAzB,IAAI,qBAAqB,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,iBAAA,2BAAA,KAAM,kBAAkB;QACjD;IAA5B,IAAI,wBAAwB,CAAA,+BAAA,MAAM,qBAAqB,cAA3B,0CAAA,+BAA+B,iBAAA,2BAAA,KAAM,qBAAqB;QAClE;IAApB,IAAI,gBAAgB,CAAA,uBAAA,MAA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,CAAA,GAAA,YAAI,EAAE,iBAAA,4BAAA,eAAA,KAAM,KAAK,cAAX,mCAAA,aAAa,QAAQ,EAAE,YAAY;QACvF,YAAY,EAAE,iBAAA,2BAAA,KAAM,YAAY;YAChC;IACF;IAEA,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;QAC1B,YAAY,cAAc,CAAC;QAC3B;YACE,IAAI,CAAC,CAAA,GAAA,qBAAa,KAAK;gBACrB,MAAM,gBAAgB,CAAC,UAAU,CAAC;gBAClC,MAAM,gBAAgB,CAAC,aAAa,CAAC;YACvC;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,iBAAA,2BAAA,KAAM,KAAK;IACzC,OAAO,SAAS,EAAE;IAClB,IAAI,YAAY,CAAA,GAAA,mBAAW,EAAE,iBAAA,2BAAA,KAAM,KAAK;IAExC,OAAO;QACL,aAAa;YACX,GAAG,WAAW;YACd,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,WAAW,YAAY,UAAU;gBACzD;QACF;QACA,YAAY;YACV,IAAI;QACN;QACA,kBAAkB;YAChB,IAAI;QACN;mBACA;QACA,gBAAgB,aAAa,CAAA,GAAA,qBAAa;oBAC1C;oBACA;mBACA;yBACA;mBACA;IACF;AACF","sources":["packages/@react-aria/listbox/src/useOption.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {chain, filterDOMProps, isMac, isWebKit, mergeProps, useLinkProps, useSlotId} from '@react-aria/utils';\nimport {DOMAttributes, FocusableElement, Key, RefObject} from '@react-types/shared';\nimport {getItemCount} from '@react-stately/collections';\nimport {getItemId, listData} from './utils';\nimport {isFocusVisible, useHover} from '@react-aria/interactions';\nimport {ListState} from '@react-stately/list';\nimport {SelectableItemStates, useSelectableItem} from '@react-aria/selection';\n\nexport interface OptionAria extends SelectableItemStates {\n /** Props for the option element. */\n optionProps: DOMAttributes,\n\n /** Props for the main text element inside the option. */\n labelProps: DOMAttributes,\n\n /** Props for the description text element inside the option, if any. */\n descriptionProps: DOMAttributes,\n\n /** Whether the option is currently focused. */\n isFocused: boolean,\n\n /** Whether the option is keyboard focused. */\n isFocusVisible: boolean\n}\n\nexport interface AriaOptionProps {\n /**\n * Whether the option is disabled.\n * @deprecated\n */\n isDisabled?: boolean,\n\n /**\n * Whether the option is selected.\n * @deprecated\n */\n isSelected?: boolean,\n\n /** A screen reader only label for the option. */\n 'aria-label'?: string,\n\n /** The unique key for the option. */\n key: Key,\n\n /**\n * Whether selection should occur on press up instead of press down.\n * @deprecated\n */\n shouldSelectOnPressUp?: boolean,\n\n /**\n * Whether the option should be focused when the user hovers over it.\n * @deprecated\n */\n shouldFocusOnHover?: boolean,\n\n /**\n * Whether the option is contained in a virtual scrolling listbox.\n * @deprecated\n */\n isVirtualized?: boolean,\n\n /**\n * Whether the option should use virtual focus instead of being focused directly.\n * @deprecated\n */\n shouldUseVirtualFocus?: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for an option in a listbox.\n * See `useListBox` for more details about listboxes.\n * @param props - Props for the option.\n * @param state - State for the listbox, as returned by `useListState`.\n */\nexport function useOption<T>(props: AriaOptionProps, state: ListState<T>, ref: RefObject<FocusableElement | null>): OptionAria {\n let {\n key\n } = props;\n\n let data = listData.get(state);\n\n let isDisabled = props.isDisabled ?? state.selectionManager.isDisabled(key);\n let isSelected = props.isSelected ?? state.selectionManager.isSelected(key);\n let shouldSelectOnPressUp = props.shouldSelectOnPressUp ?? data?.shouldSelectOnPressUp;\n let shouldFocusOnHover = props.shouldFocusOnHover ?? data?.shouldFocusOnHover;\n let shouldUseVirtualFocus = props.shouldUseVirtualFocus ?? data?.shouldUseVirtualFocus;\n let isVirtualized = props.isVirtualized ?? data?.isVirtualized;\n\n let labelId = useSlotId();\n let descriptionId = useSlotId();\n\n let optionProps = {\n role: 'option',\n 'aria-disabled': isDisabled || undefined,\n 'aria-selected': state.selectionManager.selectionMode !== 'none' ? isSelected : undefined\n };\n\n // Safari with VoiceOver on macOS misreads options with aria-labelledby or aria-label as simply \"text\".\n // We should not map slots to the label and description on Safari and instead just have VoiceOver read the textContent.\n // https://bugs.webkit.org/show_bug.cgi?id=209279\n if (!(isMac() && isWebKit())) {\n optionProps['aria-label'] = props['aria-label'];\n optionProps['aria-labelledby'] = labelId;\n optionProps['aria-describedby'] = descriptionId;\n }\n\n let item = state.collection.getItem(key);\n if (isVirtualized) {\n let index = Number(item?.index);\n optionProps['aria-posinset'] = Number.isNaN(index) ? undefined : index + 1;\n optionProps['aria-setsize'] = getItemCount(state.collection);\n }\n\n let onAction = data?.onAction ? () => data?.onAction?.(key) : undefined;\n let id = getItemId(state, key);\n let {itemProps, isPressed, isFocused, hasAction, allowsSelection} = useSelectableItem({\n selectionManager: state.selectionManager,\n key,\n ref,\n shouldSelectOnPressUp,\n allowsDifferentPressOrigin: shouldSelectOnPressUp && shouldFocusOnHover,\n isVirtualized,\n shouldUseVirtualFocus,\n isDisabled,\n onAction: onAction || item?.props?.onAction ? chain(item?.props?.onAction, onAction) : undefined,\n linkBehavior: data?.linkBehavior,\n id\n });\n\n let {hoverProps} = useHover({\n isDisabled: isDisabled || !shouldFocusOnHover,\n onHoverStart() {\n if (!isFocusVisible()) {\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(key);\n }\n }\n });\n\n let domProps = filterDOMProps(item?.props);\n delete domProps.id;\n let linkProps = useLinkProps(item?.props);\n\n return {\n optionProps: {\n ...optionProps,\n ...mergeProps(domProps, itemProps, hoverProps, linkProps),\n id\n },\n labelProps: {\n id: labelId\n },\n descriptionProps: {\n id: descriptionId\n },\n isFocused,\n isFocusVisible: isFocused && isFocusVisible(),\n isSelected,\n isDisabled,\n isPressed,\n allowsSelection,\n hasAction\n };\n}\n"],"names":[],"version":3,"file":"useOption.module.js.map"}
1
+ {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA6EM,SAAS,0CAAa,KAAsB,EAAE,KAAmB,EAAE,GAAuC;QAkDvF,aAA8B;IAjDtD,IAAI,OACF,GAAG,EACJ,GAAG;IAEJ,IAAI,OAAO,CAAA,GAAA,yCAAO,EAAE,GAAG,CAAC;QAEP;IAAjB,IAAI,aAAa,CAAA,oBAAA,MAAM,UAAU,cAAhB,+BAAA,oBAAoB,MAAM,gBAAgB,CAAC,UAAU,CAAC;QACtD;IAAjB,IAAI,aAAa,CAAA,oBAAA,MAAM,UAAU,cAAhB,+BAAA,oBAAoB,MAAM,gBAAgB,CAAC,UAAU,CAAC;QAC3C;IAA5B,IAAI,wBAAwB,CAAA,+BAAA,MAAM,qBAAqB,cAA3B,0CAAA,+BAA+B,iBAAA,2BAAA,KAAM,qBAAqB;QAC7D;IAAzB,IAAI,qBAAqB,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,iBAAA,2BAAA,KAAM,kBAAkB;QACjD;IAA5B,IAAI,wBAAwB,CAAA,+BAAA,MAAM,qBAAqB,cAA3B,0CAAA,+BAA+B,iBAAA,2BAAA,KAAM,qBAAqB;QAClE;IAApB,IAAI,gBAAgB,CAAA,uBAAA,MAAM,aAAa,cAAnB,kCAAA,uBAAuB,iBAAA,2BAAA,KAAM,aAAa;IAE9D,IAAI,UAAU,CAAA,GAAA,gBAAQ;IACtB,IAAI,gBAAgB,CAAA,GAAA,gBAAQ;IAE5B,IAAI,cAAc;QAChB,MAAM;QACN,iBAAiB,cAAc;QAC/B,iBAAiB,MAAM,gBAAgB,CAAC,aAAa,KAAK,SAAS,aAAa;IAClF;IAEA,uGAAuG;IACvG,uHAAuH;IACvH,iDAA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AAM,gBAAgB,CAAC,UAAU,CAAC;gBAClC,MAAM,gBAAgB,CAAC,aAAa,CAAC;YACvC;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,iBAAA,2BAAA,KAAM,KAAK;IACzC,OAAO,SAAS,EAAE;IAClB,IAAI,YAAY,CAAA,GAAA,mBAAW,EAAE,iBAAA,2BAAA,KAAM,KAAK;IAExC,OAAO;QACL,aAAa;YACX,GAAG,WAAW;YACd,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,WAAW,YAAY,UAAU;gBACzD;QACF;QACA,YAAY;YACV,IAAI;QACN;QACA,kBAAkB;YAChB,IAAI;QACN;mBACA;QACA,gBAAgB,aAAa,MAAM,gBAAgB,CAAC,SAAS,IAAI,CAAA,GAAA,qBAAa;oBAC9E;oBACA;mBACA;yBACA;mBACA;IACF;AACF","sources":["packages/@react-aria/listbox/src/useOption.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {chain, filterDOMProps, isMac, isWebKit, mergeProps, useLinkProps, useSlotId} from '@react-aria/utils';\nimport {DOMAttributes, FocusableElement, Key, RefObject} from '@react-types/shared';\nimport {getItemCount} from '@react-stately/collections';\nimport {getItemId, listData} from './utils';\nimport {isFocusVisible, useHover} from '@react-aria/interactions';\nimport {ListState} from '@react-stately/list';\nimport {SelectableItemStates, useSelectableItem} from '@react-aria/selection';\n\nexport interface OptionAria extends SelectableItemStates {\n /** Props for the option element. */\n optionProps: DOMAttributes,\n\n /** Props for the main text element inside the option. */\n labelProps: DOMAttributes,\n\n /** Props for the description text element inside the option, if any. */\n descriptionProps: DOMAttributes,\n\n /** Whether the option is currently focused. */\n isFocused: boolean,\n\n /** Whether the option is keyboard focused. */\n isFocusVisible: boolean\n}\n\nexport interface AriaOptionProps {\n /**\n * Whether the option is disabled.\n * @deprecated\n */\n isDisabled?: boolean,\n\n /**\n * Whether the option is selected.\n * @deprecated\n */\n isSelected?: boolean,\n\n /** A screen reader only label for the option. */\n 'aria-label'?: string,\n\n /** The unique key for the option. */\n key: Key,\n\n /**\n * Whether selection should occur on press up instead of press down.\n * @deprecated\n */\n shouldSelectOnPressUp?: boolean,\n\n /**\n * Whether the option should be focused when the user hovers over it.\n * @deprecated\n */\n shouldFocusOnHover?: boolean,\n\n /**\n * Whether the option is contained in a virtual scrolling listbox.\n * @deprecated\n */\n isVirtualized?: boolean,\n\n /**\n * Whether the option should use virtual focus instead of being focused directly.\n * @deprecated\n */\n shouldUseVirtualFocus?: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for an option in a listbox.\n * See `useListBox` for more details about listboxes.\n * @param props - Props for the option.\n * @param state - State for the listbox, as returned by `useListState`.\n */\nexport function useOption<T>(props: AriaOptionProps, state: ListState<T>, ref: RefObject<FocusableElement | null>): OptionAria {\n let {\n key\n } = props;\n\n let data = listData.get(state);\n\n let isDisabled = props.isDisabled ?? state.selectionManager.isDisabled(key);\n let isSelected = props.isSelected ?? state.selectionManager.isSelected(key);\n let shouldSelectOnPressUp = props.shouldSelectOnPressUp ?? data?.shouldSelectOnPressUp;\n let shouldFocusOnHover = props.shouldFocusOnHover ?? data?.shouldFocusOnHover;\n let shouldUseVirtualFocus = props.shouldUseVirtualFocus ?? data?.shouldUseVirtualFocus;\n let isVirtualized = props.isVirtualized ?? data?.isVirtualized;\n\n let labelId = useSlotId();\n let descriptionId = useSlotId();\n\n let optionProps = {\n role: 'option',\n 'aria-disabled': isDisabled || undefined,\n 'aria-selected': state.selectionManager.selectionMode !== 'none' ? isSelected : undefined\n };\n\n // Safari with VoiceOver on macOS misreads options with aria-labelledby or aria-label as simply \"text\".\n // We should not map slots to the label and description on Safari and instead just have VoiceOver read the textContent.\n // https://bugs.webkit.org/show_bug.cgi?id=209279\n if (!(isMac() && isWebKit())) {\n optionProps['aria-label'] = props['aria-label'];\n optionProps['aria-labelledby'] = labelId;\n optionProps['aria-describedby'] = descriptionId;\n }\n\n let item = state.collection.getItem(key);\n if (isVirtualized) {\n let index = Number(item?.index);\n optionProps['aria-posinset'] = Number.isNaN(index) ? undefined : index + 1;\n optionProps['aria-setsize'] = getItemCount(state.collection);\n }\n\n let onAction = data?.onAction ? () => data?.onAction?.(key) : undefined;\n let id = getItemId(state, key);\n let {itemProps, isPressed, isFocused, hasAction, allowsSelection} = useSelectableItem({\n selectionManager: state.selectionManager,\n key,\n ref,\n shouldSelectOnPressUp,\n allowsDifferentPressOrigin: shouldSelectOnPressUp && shouldFocusOnHover,\n isVirtualized,\n shouldUseVirtualFocus,\n isDisabled,\n onAction: onAction || item?.props?.onAction ? chain(item?.props?.onAction, onAction) : undefined,\n linkBehavior: data?.linkBehavior,\n id\n });\n\n let {hoverProps} = useHover({\n isDisabled: isDisabled || !shouldFocusOnHover,\n onHoverStart() {\n if (!isFocusVisible()) {\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(key);\n }\n }\n });\n\n let domProps = filterDOMProps(item?.props);\n delete domProps.id;\n let linkProps = useLinkProps(item?.props);\n\n return {\n optionProps: {\n ...optionProps,\n ...mergeProps(domProps, itemProps, hoverProps, linkProps),\n id\n },\n labelProps: {\n id: labelId\n },\n descriptionProps: {\n id: descriptionId\n },\n isFocused,\n isFocusVisible: isFocused && state.selectionManager.isFocused && isFocusVisible(),\n isSelected,\n isDisabled,\n isPressed,\n allowsSelection,\n hasAction\n };\n}\n"],"names":[],"version":3,"file":"useOption.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/listbox",
3
- "version": "3.14.0",
3
+ "version": "3.14.1",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -22,14 +22,14 @@
22
22
  "url": "https://github.com/adobe/react-spectrum"
23
23
  },
24
24
  "dependencies": {
25
- "@react-aria/interactions": "^3.23.0",
26
- "@react-aria/label": "^3.7.14",
27
- "@react-aria/selection": "^3.22.0",
28
- "@react-aria/utils": "^3.27.0",
29
- "@react-stately/collections": "^3.12.1",
30
- "@react-stately/list": "^3.11.2",
31
- "@react-types/listbox": "^3.5.4",
32
- "@react-types/shared": "^3.27.0",
25
+ "@react-aria/interactions": "^3.24.0",
26
+ "@react-aria/label": "^3.7.15",
27
+ "@react-aria/selection": "^3.23.0",
28
+ "@react-aria/utils": "^3.28.0",
29
+ "@react-stately/collections": "^3.12.2",
30
+ "@react-stately/list": "^3.12.0",
31
+ "@react-types/listbox": "^3.5.5",
32
+ "@react-types/shared": "^3.28.0",
33
33
  "@swc/helpers": "^0.5.0"
34
34
  },
35
35
  "peerDependencies": {
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "09e7f44bebdc9d89122926b2b439a0a38a2814ea"
42
+ "gitHead": "4d3c72c94eea2d72eb3a0e7d56000c6ef7e39726"
43
43
  }
package/src/useOption.ts CHANGED
@@ -167,7 +167,7 @@ export function useOption<T>(props: AriaOptionProps, state: ListState<T>, ref: R
167
167
  id: descriptionId
168
168
  },
169
169
  isFocused,
170
- isFocusVisible: isFocused && isFocusVisible(),
170
+ isFocusVisible: isFocused && state.selectionManager.isFocused && isFocusVisible(),
171
171
  isSelected,
172
172
  isDisabled,
173
173
  isPressed,