{"ast":null,"code":"import { isFocusVisible, useHover, usePress } from \"@react-aria/interactions\";\nimport { getItemCount } from \"@react-stately/collections\";\nimport { useSelectableList, useSelectableItem } from \"@react-aria/selection\";\nimport { useLabel } from \"@react-aria/label\";\nimport { filterDOMProps, mergeProps, useId, isMac, isWebKit, useSlotId } from \"@react-aria/utils\";\nimport _babelRuntimeHelpersEsmExtends from \"@babel/runtime/helpers/esm/extends\";\nexport var listIds = new WeakMap();\n\nfunction $d7356e622fdc32e5aea4e1e7cc2e6e6b$var$normalizeKey(key) {\n  if (typeof key === 'string') {\n    return key.replace(/\\s*/g, '');\n  }\n\n  return '' + key;\n}\n\nexport function getItemId(state, itemKey) {\n  var listId = listIds.get(state);\n\n  if (!listId) {\n    throw new Error('Unknown list');\n  }\n\n  return listId + \"-option-\" + $d7356e622fdc32e5aea4e1e7cc2e6e6b$var$normalizeKey(itemKey);\n}\nexport function useListBox(props, state, ref) {\n  var domProps = filterDOMProps(props, {\n    labelable: true\n  });\n\n  var _useSelectableList = useSelectableList(_babelRuntimeHelpersEsmExtends({}, props, {\n    ref: ref,\n    selectionManager: state.selectionManager,\n    collection: state.collection,\n    disabledKeys: state.disabledKeys\n  })),\n      listProps = _useSelectableList.listProps;\n\n  var id = useId(props.id);\n  listIds.set(state, id);\n\n  var _useLabel = useLabel(_babelRuntimeHelpersEsmExtends({}, props, {\n    id: id,\n    labelElementType: 'span'\n  })),\n      labelProps = _useLabel.labelProps,\n      fieldProps = _useLabel.fieldProps;\n\n  return {\n    labelProps: labelProps,\n    listBoxProps: mergeProps(domProps, state.selectionManager.selectionMode === 'multiple' ? {\n      'aria-multiselectable': 'true'\n    } : {}, _babelRuntimeHelpersEsmExtends({\n      role: 'listbox'\n    }, mergeProps(fieldProps, listProps)))\n  };\n}\nexport function useOption(props, state, ref) {\n  var isSelected = props.isSelected,\n      isDisabled = props.isDisabled,\n      key = props.key,\n      shouldSelectOnPressUp = props.shouldSelectOnPressUp,\n      shouldFocusOnHover = props.shouldFocusOnHover,\n      isVirtualized = props.isVirtualized,\n      shouldUseVirtualFocus = props.shouldUseVirtualFocus;\n  var labelId = useSlotId();\n  var descriptionId = useSlotId();\n  var optionProps = {\n    role: 'option',\n    'aria-disabled': isDisabled,\n    'aria-selected': isSelected\n  };\n\n  if (!(isMac() && isWebKit())) {\n    optionProps['aria-label'] = props['aria-label'];\n    optionProps['aria-labelledby'] = labelId;\n    optionProps['aria-describedby'] = descriptionId;\n  }\n\n  if (isVirtualized) {\n    optionProps['aria-posinset'] = state.collection.getItem(key).index + 1;\n    optionProps['aria-setsize'] = getItemCount(state.collection);\n  }\n\n  var _useSelectableItem = useSelectableItem({\n    selectionManager: state.selectionManager,\n    key: key,\n    ref: ref,\n    shouldSelectOnPressUp: shouldSelectOnPressUp,\n    isVirtualized: isVirtualized,\n    shouldUseVirtualFocus: shouldUseVirtualFocus\n  }),\n      itemProps = _useSelectableItem.itemProps;\n\n  var _usePress = usePress(_babelRuntimeHelpersEsmExtends({}, itemProps, {\n    isDisabled: isDisabled,\n    preventFocusOnPress: shouldUseVirtualFocus\n  })),\n      pressProps = _usePress.pressProps;\n\n  var _useHover = useHover({\n    isDisabled: isDisabled || !shouldFocusOnHover,\n    onHoverStart: function onHoverStart() {\n      if (!isFocusVisible()) {\n        state.selectionManager.setFocused(true);\n        state.selectionManager.setFocusedKey(key);\n      }\n    }\n  }),\n      hoverProps = _useHover.hoverProps;\n\n  return {\n    optionProps: _babelRuntimeHelpersEsmExtends({}, optionProps, mergeProps(pressProps, hoverProps), {\n      id: getItemId(state, key)\n    }),\n    labelProps: {\n      id: labelId\n    },\n    descriptionProps: {\n      id: descriptionId\n    }\n  };\n}\nexport function useListBoxSection(props) {\n  var heading = props.heading,\n      ariaLabel = props['aria-label'];\n  var headingId = useId();\n  return {\n    itemProps: {\n      role: 'presentation'\n    },\n    headingProps: heading ? {\n      id: headingId,\n      'aria-hidden': true\n    } : {},\n    groupProps: {\n      role: 'group',\n      'aria-label': ariaLabel,\n      'aria-labelledby': heading ? headingId : undefined\n    }\n  };\n}","map":{"version":3,"sources":["packages/@react-aria/listbox/src/utils.ts","packages/@react-aria/listbox/src/useListBox.ts","packages/@react-aria/listbox/src/useOption.ts","packages/@react-aria/listbox/src/useListBoxSection.ts"],"names":["listIds","key","listId","normalizeKey","domProps","filterDOMProps","labelable","listProps","useSelectableList","ref","selectionManager","state","collection","disabledKeys","id","useId","props","fieldProps","useLabel","labelElementType","labelProps","listBoxProps","mergeProps","role","shouldUseVirtualFocus","labelId","useSlotId","descriptionId","optionProps","isSelected","isMac","isWebKit","getItemCount","itemProps","useSelectableItem","shouldSelectOnPressUp","isVirtualized","pressProps","usePress","isDisabled","preventFocusOnPress","hoverProps","useHover","onHoverStart","isFocusVisible","descriptionProps","ariaLabel","headingId","headingProps","heading","groupProps","undefined"],"mappings":";;;;;;OAeO,IAAMA,OAAO,GAAG,IAAhB,OAAgB,EAAhB;;AAEP,SAAA,kDAAA,CAAA,GAAA,EAAwC;AACtC,MAAI,OAAA,GAAA,KAAJ,QAAA,EAA6B;AAC3B,WAAOC,GAAG,CAAHA,OAAAA,CAAAA,MAAAA,EAAP,EAAOA,CAAP;AACD;;AAED,SAAO,KAAP,GAAA;AACD;;OAEM,SAAA,SAAA,CAAA,KAAA,EAAA,OAAA,EAAiE;AACtE,MAAIC,MAAM,GAAGF,OAAO,CAAPA,GAAAA,CAAb,KAAaA,CAAb;;AAEA,MAAI,CAAJ,MAAA,EAAa;AACX,UAAM,IAAA,KAAA,CAAN,cAAM,CAAN;AACD;;AAED,SAAUE,MAAV,GAAA,UAAUA,GAAiBC,kDAAY,CAAvC,OAAuC,CAAvC;AACD;OCkBM,SAAA,UAAA,CAAA,KAAA,EAAA,KAAA,EAAA,GAAA,EAAoH;AACzH,MAAIC,QAAQ,GAAGC,cAAc,CAAA,KAAA,EAAQ;AAACC,IAAAA,SAAS,EAAE;AAAZ,GAAR,CAA7B;;AADyH,2BAEvGE,iBAAiB,CAAA,8BAAA,CAAA,EAA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BAAmB0B,OAAO,GAAA,SAAA,GAAeE;AAH/B;AAXP,GAAP;AAiBD","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 {Key} from 'react';\nimport {ListState} from '@react-stately/list';\n\nexport const listIds = new WeakMap<ListState<unknown>, string>();\n\nfunction normalizeKey(key: Key): string {\n  if (typeof key === 'string') {\n    return key.replace(/\\s*/g, '');\n  }\n\n  return '' + key;\n}\n\nexport function getItemId<T>(state: ListState<T>, itemKey: Key): string {\n  let listId = listIds.get(state);\n\n  if (!listId) {\n    throw new Error('Unknown list');\n  }\n\n  return `${listId}-option-${normalizeKey(itemKey)}`;\n}\n","/*\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 {AriaListBoxProps} from '@react-types/listbox';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {HTMLAttributes, ReactNode, RefObject} from 'react';\nimport {KeyboardDelegate} from '@react-types/shared';\nimport {listIds} from './utils';\nimport {ListState} from '@react-stately/list';\nimport {useId} from '@react-aria/utils';\nimport {useLabel} from '@react-aria/label';\nimport {useSelectableList} from '@react-aria/selection';\n\ninterface ListBoxAria {\n  /** Props for the listbox element. */\n  listBoxProps: HTMLAttributes<HTMLElement>,\n  /** Props for the listbox's visual label element (if any). */\n  labelProps: HTMLAttributes<HTMLElement>\n}\n\ninterface AriaListBoxOptions<T> extends Omit<AriaListBoxProps<T>, 'children'> {\n  /** Whether the listbox uses virtual scrolling. */\n  isVirtualized?: boolean,\n\n  /**\n   * An optional keyboard delegate implementation for type to select,\n   * to override the default.\n   */\n  keyboardDelegate?: KeyboardDelegate,\n\n  /**\n   * An optional visual label for the listbox.\n   */\n  label?: ReactNode\n}\n\n/**\n * Provides the behavior and accessibility implementation for a listbox component.\n * A listbox displays a list of options and allows a user to select one or more of them.\n * @param props - Props for the listbox.\n * @param state - State for the listbox, as returned by `useListState`.\n */\nexport function useListBox<T>(props: AriaListBoxOptions<T>, state: ListState<T>, ref: RefObject<HTMLElement>): ListBoxAria {\n  let domProps = filterDOMProps(props, {labelable: true});\n  let {listProps} = useSelectableList({\n    ...props,\n    ref,\n    selectionManager: state.selectionManager,\n    collection: state.collection,\n    disabledKeys: state.disabledKeys\n  });\n\n  let id = useId(props.id);\n  listIds.set(state, id);\n\n  let {labelProps, fieldProps} = useLabel({\n    ...props,\n    id,\n    // listbox is not an HTML input element so it\n    // shouldn't be labeled by a <label> element.\n    labelElementType: 'span'\n  });\n\n  return {\n    labelProps,\n    listBoxProps: mergeProps(domProps, state.selectionManager.selectionMode === 'multiple' ? {\n      'aria-multiselectable': 'true'\n    } : {}, {\n      role: 'listbox',\n      ...mergeProps(fieldProps, listProps)\n    })\n  };\n}\n","/*\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 {getItemCount} from '@react-stately/collections';\nimport {getItemId} from './utils';\nimport {HTMLAttributes, Key, RefObject} from 'react';\nimport {isFocusVisible, useHover, usePress} from '@react-aria/interactions';\nimport {isMac, isWebKit, mergeProps, useSlotId} from '@react-aria/utils';\nimport {ListState} from '@react-stately/list';\nimport {useSelectableItem} from '@react-aria/selection';\n\ninterface OptionAria {\n  /** Props for the option element. */\n  optionProps: HTMLAttributes<HTMLElement>,\n\n  /** Props for the main text element inside the option. */\n  labelProps: HTMLAttributes<HTMLElement>,\n\n  /** Props for the description text element inside the option, if any. */\n  descriptionProps: HTMLAttributes<HTMLElement>\n}\n\ninterface AriaOptionProps {\n  /** Whether the option is disabled. */\n  isDisabled?: boolean,\n\n  /** Whether the option is selected. */\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  /** Whether selection should occur on press up instead of press down. */\n  shouldSelectOnPressUp?: boolean,\n\n  /** Whether the option should be focused when the user hovers over it. */\n  shouldFocusOnHover?: boolean,\n\n  /** Whether the option is contained in a virtual scrolling listbox. */\n  isVirtualized?: boolean,\n\n  /** Whether the option should use virtual focus instead of being focused directly. */\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<HTMLElement>): OptionAria {\n  let {\n    isSelected,\n    isDisabled,\n    key,\n    shouldSelectOnPressUp,\n    shouldFocusOnHover,\n    isVirtualized,\n    shouldUseVirtualFocus\n  } = props;\n\n  let labelId = useSlotId();\n  let descriptionId = useSlotId();\n\n  let optionProps = {\n    role: 'option',\n    'aria-disabled': isDisabled,\n    'aria-selected': isSelected\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  if (isVirtualized) {\n    optionProps['aria-posinset'] = state.collection.getItem(key).index + 1;\n    optionProps['aria-setsize'] = getItemCount(state.collection);\n  }\n\n  let {itemProps} = useSelectableItem({\n    selectionManager: state.selectionManager,\n    key,\n    ref,\n    shouldSelectOnPressUp,\n    isVirtualized,\n    shouldUseVirtualFocus\n  });\n\n  let {pressProps} = usePress({...itemProps, isDisabled, preventFocusOnPress: shouldUseVirtualFocus});\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  return {\n    optionProps: {\n      ...optionProps,\n      ...mergeProps(pressProps, hoverProps),\n      id: getItemId(state, key)\n    },\n    labelProps: {\n      id: labelId\n    },\n    descriptionProps: {\n      id: descriptionId\n    }\n  };\n}\n","/*\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 {HTMLAttributes, ReactNode} from 'react';\nimport {useId} from '@react-aria/utils';\n\ninterface AriaListBoxSectionProps {\n  /** The heading for the section. */\n  heading?: ReactNode,\n  /** An accessibility label for the section. Required if `heading` is not present. */\n  'aria-label'?: string\n}\n\ninterface ListBoxSectionAria {\n  /** Props for the wrapper list item. */\n  itemProps: HTMLAttributes<HTMLElement>,\n\n  /** Props for the heading element, if any. */\n  headingProps: HTMLAttributes<HTMLElement>,\n\n  /** Props for the group element. */\n  groupProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a section in a listbox.\n * See `useListBox` for more details about listboxes.\n * @param props - Props for the section.\n */\nexport function useListBoxSection(props: AriaListBoxSectionProps): ListBoxSectionAria {\n  let {heading, 'aria-label': ariaLabel} = props;\n  let headingId = useId();\n\n  return {\n    itemProps: {\n      role: 'presentation'\n    },\n    headingProps: heading ? {\n      // Techincally, listbox cannot contain headings according to ARIA.\n      // We hide the heading from assistive technology, and only use it\n      // as a label for the nested group.\n      id: headingId,\n      'aria-hidden': true\n    } : {},\n    groupProps: {\n      role: 'group',\n      'aria-label': ariaLabel,\n      'aria-labelledby': heading ? headingId : undefined\n    }\n  };\n}\n"]},"metadata":{},"sourceType":"module"}