{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;AAUA;;;;;;;;AAqCO,SAAS,0CAAc,KAA4B,EAAE,KAAsB,EAAE,GAAkC;IACpH,IAAI,eACF,cAAc,kCACd,qBAAqB,aACtB,GAAG;IACJ,IAAI,cACF,UAAU,EACV,kBAAkB,OAAO,gBACzB,YAAY,EACb,GAAG;IACJ,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,mCAAQ;IAC1B,IAAI,WAAW,CAAA,GAAA,oBAAM,EAAE,IAAM,IAAI,CAAA,GAAA,8CAAmB,EAClD,YACA,WACA,aACA,eAAe;QAAC;QAAY;QAAc;QAAa;KAAU;IAEnE,IAAI,mBAAC,eAAe,EAAC,GAAG,CAAA,GAAA,iDAAsB,EAAE;aAC9C;QACA,kBAAkB;QAClB,kBAAkB;QAClB,eAAe,uBAAuB;QACtC,wBAAwB;QACxB,WAAW;QACX,cAAc;IAChB;IAEA,+BAA+B;IAC/B,IAAI,SAAS,CAAA,GAAA,+BAAI;IACjB,CAAA,GAAA,iCAAM,EAAE,GAAG,CAAC,OAAO;IAEnB,IAAI,oBAAoB,CAAA,GAAA,mCAAQ,EAAE;QAAC,GAAG,KAAK;QAAE,IAAI;IAAM;IAEvD,OAAO;QACL,cAAc;YACZ,GAAG,CAAA,GAAA,oCAAS,EAAE,iBAAiB,kBAAkB;YACjD,MAAM;YACN,oBAAoB;YACpB,UAAU;QACZ;IACF;AACF","sources":["packages/react-aria/src/tabs/useTabList.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 {AriaLabelingProps, DOMAttributes, DOMProps, Orientation, RefObject} from '@react-types/shared';\nimport {mergeProps} from '../utils/mergeProps';\nimport {TabListProps, TabListState} from 'react-stately/useTabListState';\nimport {tabsIds} from './utils';\nimport {TabsKeyboardDelegate} from './TabsKeyboardDelegate';\nimport {useId} from '../utils/useId';\nimport {useLabels} from '../utils/useLabels';\nimport {useLocale} from '../i18n/I18nProvider';\nimport {useMemo} from 'react';\nimport {useSelectableCollection} from '../selection/useSelectableCollection';\n\nexport interface AriaTabListProps<T> extends TabListProps<T>, DOMProps, AriaLabelingProps {\n  /**\n   * Whether tabs are activated automatically on focus or manually.\n   * @default 'automatic'\n   */\n  keyboardActivation?: 'automatic' | 'manual',\n  /**\n   * The orientation of the tabs.\n   * @default 'horizontal'\n   */\n  orientation?: Orientation\n}\n\nexport interface AriaTabListOptions<T> extends Omit<AriaTabListProps<T>, 'children'> {}\n\nexport interface TabListAria {\n  /** Props for the tablist container. */\n  tabListProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a tab list.\n * Tabs organize content into multiple sections and allow users to navigate between them.\n */\nexport function useTabList<T>(props: AriaTabListOptions<T>, state: TabListState<T>, ref: RefObject<HTMLElement | null>): TabListAria {\n  let {\n    orientation = 'horizontal',\n    keyboardActivation = 'automatic'\n  } = props;\n  let {\n    collection,\n    selectionManager: manager,\n    disabledKeys\n  } = state;\n  let {direction} = useLocale();\n  let delegate = useMemo(() => new TabsKeyboardDelegate(\n    collection,\n    direction,\n    orientation,\n    disabledKeys), [collection, disabledKeys, orientation, direction]);\n\n  let {collectionProps} = useSelectableCollection({\n    ref,\n    selectionManager: manager,\n    keyboardDelegate: delegate,\n    selectOnFocus: keyboardActivation === 'automatic',\n    disallowEmptySelection: true,\n    scrollRef: ref,\n    linkBehavior: 'selection'\n  });\n\n  // Compute base id for all tabs\n  let tabsId = useId();\n  tabsIds.set(state, tabsId);\n\n  let tabListLabelProps = useLabels({...props, id: tabsId});\n\n  return {\n    tabListProps: {\n      ...mergeProps(collectionProps, tabListLabelProps),\n      role: 'tablist',\n      'aria-orientation': orientation,\n      tabIndex: undefined\n    }\n  };\n}\n"],"names":[],"version":3,"file":"useTabList.cjs.map"}