@depup/react-aria-components 1.19.0-depup.27 → 1.21.0-depup.0
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.
- package/NavigationTree/package.json +5 -0
- package/PreviewTrigger/package.json +5 -0
- package/README.md +2 -2
- package/TokenField/package.json +5 -0
- package/changes.json +1 -1
- package/dist/exports/GridList.cjs.map +1 -1
- package/dist/exports/GridList.js.map +1 -1
- package/dist/exports/GridList.mjs.map +1 -1
- package/dist/exports/Menu.cjs +1 -0
- package/dist/exports/Menu.cjs.map +1 -1
- package/dist/exports/Menu.js +2 -2
- package/dist/exports/Menu.js.map +1 -1
- package/dist/exports/Menu.mjs +2 -2
- package/dist/exports/Menu.mjs.map +1 -1
- package/dist/exports/NavigationTree.cjs +37 -0
- package/dist/exports/NavigationTree.cjs.map +1 -0
- package/dist/exports/NavigationTree.js +25 -0
- package/dist/exports/NavigationTree.js.map +1 -0
- package/dist/exports/NavigationTree.mjs +25 -0
- package/dist/exports/NavigationTree.mjs.map +1 -0
- package/dist/exports/PreviewTrigger.cjs +26 -0
- package/dist/exports/PreviewTrigger.cjs.map +1 -0
- package/dist/exports/PreviewTrigger.js +21 -0
- package/dist/exports/PreviewTrigger.js.map +1 -0
- package/dist/exports/PreviewTrigger.mjs +21 -0
- package/dist/exports/PreviewTrigger.mjs.map +1 -0
- package/dist/exports/TokenField.cjs +31 -0
- package/dist/exports/TokenField.cjs.map +1 -0
- package/dist/exports/TokenField.js +21 -0
- package/dist/exports/TokenField.js.map +1 -0
- package/dist/exports/TokenField.mjs +21 -0
- package/dist/exports/TokenField.mjs.map +1 -0
- package/dist/exports/Tree.cjs.map +1 -1
- package/dist/exports/Tree.js.map +1 -1
- package/dist/exports/Tree.mjs.map +1 -1
- package/dist/exports/index.cjs +25 -0
- package/dist/exports/index.cjs.map +1 -1
- package/dist/exports/index.js +12 -2
- package/dist/exports/index.js.map +1 -1
- package/dist/exports/index.mjs +12 -2
- package/dist/exports/index.mjs.map +1 -1
- package/dist/private/Checkbox.cjs.map +1 -1
- package/dist/private/Checkbox.js.map +1 -1
- package/dist/private/Checkbox.mjs.map +1 -1
- package/dist/private/ComboBox.cjs +21 -2
- package/dist/private/ComboBox.cjs.map +1 -1
- package/dist/private/ComboBox.js +21 -2
- package/dist/private/ComboBox.js.map +1 -1
- package/dist/private/ComboBox.mjs +21 -2
- package/dist/private/ComboBox.mjs.map +1 -1
- package/dist/private/Dialog.cjs +21 -1
- package/dist/private/Dialog.cjs.map +1 -1
- package/dist/private/Dialog.js +21 -1
- package/dist/private/Dialog.js.map +1 -1
- package/dist/private/Dialog.mjs +21 -1
- package/dist/private/Dialog.mjs.map +1 -1
- package/dist/private/DragAndDrop.cjs +1 -0
- package/dist/private/DragAndDrop.cjs.map +1 -1
- package/dist/private/DragAndDrop.js +1 -0
- package/dist/private/DragAndDrop.js.map +1 -1
- package/dist/private/DragAndDrop.mjs +1 -0
- package/dist/private/DragAndDrop.mjs.map +1 -1
- package/dist/private/DropZone.cjs +5 -2
- package/dist/private/DropZone.cjs.map +1 -1
- package/dist/private/DropZone.js +5 -3
- package/dist/private/DropZone.js.map +1 -1
- package/dist/private/DropZone.mjs +5 -2
- package/dist/private/DropZone.mjs.map +1 -1
- package/dist/private/FileTrigger.cjs +1 -0
- package/dist/private/FileTrigger.cjs.map +1 -1
- package/dist/private/FileTrigger.js +1 -0
- package/dist/private/FileTrigger.js.map +1 -1
- package/dist/private/FileTrigger.mjs +1 -0
- package/dist/private/FileTrigger.mjs.map +1 -1
- package/dist/private/GridLayout.cjs +3 -1
- package/dist/private/GridLayout.cjs.map +1 -1
- package/dist/private/GridLayout.js +3 -1
- package/dist/private/GridLayout.js.map +1 -1
- package/dist/private/GridLayout.mjs +3 -1
- package/dist/private/GridLayout.mjs.map +1 -1
- package/dist/private/GridList.cjs +12 -1
- package/dist/private/GridList.cjs.map +1 -1
- package/dist/private/GridList.js +12 -1
- package/dist/private/GridList.js.map +1 -1
- package/dist/private/GridList.mjs +12 -1
- package/dist/private/GridList.mjs.map +1 -1
- package/dist/private/ListBox.cjs +9 -1
- package/dist/private/ListBox.cjs.map +1 -1
- package/dist/private/ListBox.js +9 -1
- package/dist/private/ListBox.js.map +1 -1
- package/dist/private/ListBox.mjs +9 -1
- package/dist/private/ListBox.mjs.map +1 -1
- package/dist/private/Menu.cjs +59 -2
- package/dist/private/Menu.cjs.map +1 -1
- package/dist/private/Menu.js +60 -4
- package/dist/private/Menu.js.map +1 -1
- package/dist/private/Menu.mjs +60 -4
- package/dist/private/Menu.mjs.map +1 -1
- package/dist/private/Meter.cjs +2 -1
- package/dist/private/Meter.cjs.map +1 -1
- package/dist/private/Meter.js +2 -1
- package/dist/private/Meter.js.map +1 -1
- package/dist/private/Meter.mjs +2 -1
- package/dist/private/Meter.mjs.map +1 -1
- package/dist/private/Modal.cjs +2 -0
- package/dist/private/Modal.cjs.map +1 -1
- package/dist/private/Modal.js +2 -0
- package/dist/private/Modal.js.map +1 -1
- package/dist/private/Modal.mjs +2 -0
- package/dist/private/Modal.mjs.map +1 -1
- package/dist/private/NavigationTree.cjs +272 -0
- package/dist/private/NavigationTree.cjs.map +1 -0
- package/dist/private/NavigationTree.js +258 -0
- package/dist/private/NavigationTree.js.map +1 -0
- package/dist/private/NavigationTree.mjs +257 -0
- package/dist/private/NavigationTree.mjs.map +1 -0
- package/dist/private/Popover.cjs +34 -9
- package/dist/private/Popover.cjs.map +1 -1
- package/dist/private/Popover.js +34 -9
- package/dist/private/Popover.js.map +1 -1
- package/dist/private/Popover.mjs +34 -9
- package/dist/private/Popover.mjs.map +1 -1
- package/dist/private/PreviewTrigger.cjs +88 -0
- package/dist/private/PreviewTrigger.cjs.map +1 -0
- package/dist/private/PreviewTrigger.js +80 -0
- package/dist/private/PreviewTrigger.js.map +1 -0
- package/dist/private/PreviewTrigger.mjs +79 -0
- package/dist/private/PreviewTrigger.mjs.map +1 -0
- package/dist/private/ProgressBar.cjs +6 -1
- package/dist/private/ProgressBar.cjs.map +1 -1
- package/dist/private/ProgressBar.js +6 -1
- package/dist/private/ProgressBar.js.map +1 -1
- package/dist/private/ProgressBar.mjs +6 -1
- package/dist/private/ProgressBar.mjs.map +1 -1
- package/dist/private/RadioGroup.cjs.map +1 -1
- package/dist/private/RadioGroup.js.map +1 -1
- package/dist/private/RadioGroup.mjs.map +1 -1
- package/dist/private/Select.cjs.map +1 -1
- package/dist/private/Select.js.map +1 -1
- package/dist/private/Select.mjs.map +1 -1
- package/dist/private/Switch.cjs +8 -2
- package/dist/private/Switch.cjs.map +1 -1
- package/dist/private/Switch.js +9 -3
- package/dist/private/Switch.js.map +1 -1
- package/dist/private/Switch.mjs +9 -3
- package/dist/private/Switch.mjs.map +1 -1
- package/dist/private/Table.cjs +26 -14
- package/dist/private/Table.cjs.map +1 -1
- package/dist/private/Table.js +26 -14
- package/dist/private/Table.js.map +1 -1
- package/dist/private/Table.mjs +26 -14
- package/dist/private/Table.mjs.map +1 -1
- package/dist/private/TableLayout.cjs +3 -1
- package/dist/private/TableLayout.cjs.map +1 -1
- package/dist/private/TableLayout.js +3 -1
- package/dist/private/TableLayout.js.map +1 -1
- package/dist/private/TableLayout.mjs +3 -1
- package/dist/private/TableLayout.mjs.map +1 -1
- package/dist/private/TagGroup.cjs +1 -0
- package/dist/private/TagGroup.cjs.map +1 -1
- package/dist/private/TagGroup.js +1 -0
- package/dist/private/TagGroup.js.map +1 -1
- package/dist/private/TagGroup.mjs +1 -0
- package/dist/private/TagGroup.mjs.map +1 -1
- package/dist/private/Text.cjs +3 -1
- package/dist/private/Text.cjs.map +1 -1
- package/dist/private/Text.js +4 -2
- package/dist/private/Text.js.map +1 -1
- package/dist/private/Text.mjs +4 -2
- package/dist/private/Text.mjs.map +1 -1
- package/dist/private/ToggleButton.cjs.map +1 -1
- package/dist/private/ToggleButton.js.map +1 -1
- package/dist/private/ToggleButton.mjs.map +1 -1
- package/dist/private/TokenField.cjs +235 -0
- package/dist/private/TokenField.cjs.map +1 -0
- package/dist/private/TokenField.js +225 -0
- package/dist/private/TokenField.js.map +1 -0
- package/dist/private/TokenField.mjs +223 -0
- package/dist/private/TokenField.mjs.map +1 -0
- package/dist/private/Tooltip.cjs +10 -2
- package/dist/private/Tooltip.cjs.map +1 -1
- package/dist/private/Tooltip.js +10 -2
- package/dist/private/Tooltip.js.map +1 -1
- package/dist/private/Tooltip.mjs +10 -2
- package/dist/private/Tooltip.mjs.map +1 -1
- package/dist/private/Tree.cjs +11 -1
- package/dist/private/Tree.cjs.map +1 -1
- package/dist/private/Tree.js +11 -1
- package/dist/private/Tree.js.map +1 -1
- package/dist/private/Tree.mjs +11 -1
- package/dist/private/Tree.mjs.map +1 -1
- package/dist/private/TreeDropTargetDelegate.cjs +11 -6
- package/dist/private/TreeDropTargetDelegate.cjs.map +1 -1
- package/dist/private/TreeDropTargetDelegate.js +11 -6
- package/dist/private/TreeDropTargetDelegate.js.map +1 -1
- package/dist/private/TreeDropTargetDelegate.mjs +11 -6
- package/dist/private/TreeDropTargetDelegate.mjs.map +1 -1
- package/dist/private/Virtualizer.cjs +18 -16
- package/dist/private/Virtualizer.cjs.map +1 -1
- package/dist/private/Virtualizer.js +18 -16
- package/dist/private/Virtualizer.js.map +1 -1
- package/dist/private/Virtualizer.mjs +18 -16
- package/dist/private/Virtualizer.mjs.map +1 -1
- package/dist/private/useDragAndDrop.cjs +7 -0
- package/dist/private/useDragAndDrop.cjs.map +1 -1
- package/dist/private/useDragAndDrop.js +7 -0
- package/dist/private/useDragAndDrop.js.map +1 -1
- package/dist/private/useDragAndDrop.mjs +7 -0
- package/dist/private/useDragAndDrop.mjs.map +1 -1
- package/dist/private/utils.cjs.map +1 -1
- package/dist/private/utils.js.map +1 -1
- package/dist/private/utils.mjs.map +1 -1
- package/dist/types/exports/GridList.d.ts +1 -1
- package/dist/types/exports/Menu.d.ts +2 -2
- package/dist/types/exports/NavigationTree.d.ts +8 -0
- package/dist/types/exports/PreviewTrigger.d.ts +3 -0
- package/dist/types/exports/TokenField.d.ts +5 -0
- package/dist/types/exports/Tree.d.ts +1 -1
- package/dist/types/exports/index.d.ts +14 -5
- package/dist/types/src/Breadcrumbs.d.ts +2 -2
- package/dist/types/src/Button.d.ts +1 -1
- package/dist/types/src/Calendar.d.ts +6 -6
- package/dist/types/src/Checkbox.d.ts +8 -8
- package/dist/types/src/Collection.d.ts +1 -1
- package/dist/types/src/ComboBox.d.ts +6 -3
- package/dist/types/src/DateField.d.ts +4 -4
- package/dist/types/src/DatePicker.d.ts +2 -2
- package/dist/types/src/Dialog.d.ts +2 -2
- package/dist/types/src/Disclosure.d.ts +2 -2
- package/dist/types/src/GridList.d.ts +18 -7
- package/dist/types/src/Group.d.ts +1 -1
- package/dist/types/src/Header.d.ts +1 -1
- package/dist/types/src/Input.d.ts +1 -1
- package/dist/types/src/Label.d.ts +1 -1
- package/dist/types/src/Link.d.ts +1 -1
- package/dist/types/src/ListBox.d.ts +6 -6
- package/dist/types/src/Menu.d.ts +25 -6
- package/dist/types/src/Meter.d.ts +1 -1
- package/dist/types/src/Modal.d.ts +2 -2
- package/dist/types/src/NavigationTree.d.ts +80 -0
- package/dist/types/src/NumberField.d.ts +1 -1
- package/dist/types/src/OverlayArrow.d.ts +1 -1
- package/dist/types/src/Popover.d.ts +8 -1
- package/dist/types/src/PreviewTrigger.d.ts +23 -0
- package/dist/types/src/RadioGroup.d.ts +8 -8
- package/dist/types/src/SearchField.d.ts +1 -1
- package/dist/types/src/Select.d.ts +3 -3
- package/dist/types/src/Separator.d.ts +1 -1
- package/dist/types/src/Slider.d.ts +5 -5
- package/dist/types/src/Switch.d.ts +7 -7
- package/dist/types/src/Table.d.ts +32 -8
- package/dist/types/src/Tabs.d.ts +5 -5
- package/dist/types/src/TagGroup.d.ts +3 -3
- package/dist/types/src/Text.d.ts +1 -1
- package/dist/types/src/TextField.d.ts +1 -1
- package/dist/types/src/Toast.d.ts +3 -3
- package/dist/types/src/ToggleButton.d.ts +1 -1
- package/dist/types/src/ToggleButtonGroup.d.ts +1 -1
- package/dist/types/src/TokenField.d.ts +111 -0
- package/dist/types/src/Toolbar.d.ts +1 -1
- package/dist/types/src/Tooltip.d.ts +1 -1
- package/dist/types/src/Tree.d.ts +12 -10
- package/dist/types/src/Virtualizer.d.ts +4 -0
- package/dist/types/src/utils.d.ts +19 -5
- package/i18n/ar-AE.js +1 -1
- package/i18n/ar-AE.mjs +1 -1
- package/i18n/bg-BG.js +1 -1
- package/i18n/bg-BG.mjs +1 -1
- package/i18n/cs-CZ.js +1 -1
- package/i18n/cs-CZ.mjs +1 -1
- package/i18n/da-DK.js +1 -1
- package/i18n/da-DK.mjs +1 -1
- package/i18n/de-DE.js +1 -1
- package/i18n/de-DE.mjs +1 -1
- package/i18n/el-GR.js +1 -1
- package/i18n/el-GR.mjs +1 -1
- package/i18n/en-US.js +1 -1
- package/i18n/en-US.mjs +1 -1
- package/i18n/es-ES.js +1 -1
- package/i18n/es-ES.mjs +1 -1
- package/i18n/et-EE.js +1 -1
- package/i18n/et-EE.mjs +1 -1
- package/i18n/fi-FI.js +1 -1
- package/i18n/fi-FI.mjs +1 -1
- package/i18n/fr-FR.js +1 -1
- package/i18n/fr-FR.mjs +1 -1
- package/i18n/he-IL.js +1 -1
- package/i18n/he-IL.mjs +1 -1
- package/i18n/hr-HR.js +1 -1
- package/i18n/hr-HR.mjs +1 -1
- package/i18n/hu-HU.js +1 -1
- package/i18n/hu-HU.mjs +1 -1
- package/i18n/it-IT.js +1 -1
- package/i18n/it-IT.mjs +1 -1
- package/i18n/ja-JP.js +1 -1
- package/i18n/ja-JP.mjs +1 -1
- package/i18n/ko-KR.js +1 -1
- package/i18n/ko-KR.mjs +1 -1
- package/i18n/lt-LT.js +1 -1
- package/i18n/lt-LT.mjs +1 -1
- package/i18n/lv-LV.js +1 -1
- package/i18n/lv-LV.mjs +1 -1
- package/i18n/nb-NO.js +1 -1
- package/i18n/nb-NO.mjs +1 -1
- package/i18n/nl-NL.js +1 -1
- package/i18n/nl-NL.mjs +1 -1
- package/i18n/pl-PL.js +1 -1
- package/i18n/pl-PL.mjs +1 -1
- package/i18n/pt-BR.js +1 -1
- package/i18n/pt-BR.mjs +1 -1
- package/i18n/pt-PT.js +1 -1
- package/i18n/pt-PT.mjs +1 -1
- package/i18n/ro-RO.js +1 -1
- package/i18n/ro-RO.mjs +1 -1
- package/i18n/ru-RU.js +1 -1
- package/i18n/ru-RU.mjs +1 -1
- package/i18n/sk-SK.js +1 -1
- package/i18n/sk-SK.mjs +1 -1
- package/i18n/sl-SI.js +1 -1
- package/i18n/sl-SI.mjs +1 -1
- package/i18n/sr-SP.js +1 -1
- package/i18n/sr-SP.mjs +1 -1
- package/i18n/sv-SE.js +1 -1
- package/i18n/sv-SE.mjs +1 -1
- package/i18n/tr-TR.js +1 -1
- package/i18n/tr-TR.mjs +1 -1
- package/i18n/uk-UA.js +1 -1
- package/i18n/uk-UA.mjs +1 -1
- package/i18n/zh-CN.js +1 -1
- package/i18n/zh-CN.mjs +1 -1
- package/i18n/zh-TW.js +1 -1
- package/i18n/zh-TW.mjs +1 -1
- package/package.json +33 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyLM,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAAmD;AACtF,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAAyB;AAK9D,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,QAC3E,KAAsB,EACtB,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,QAAQ,CAAA,GAAA,iBAAS,EAAE;IAEvB,uHAAuH;IACvH,4HAA4H;IAC5H,qGAAqG;IACrG,wHAAwH;IACxH,kGAAkG;IAClG,IAAI,OACF,qBAAO,gCAAC;QAAa,OAAO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FAEE,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,qBAAa,EAAE,OAAO;YAAC,QAAQ;QAAI,IAAI,YAAY;QACjE,GAAG,WAAW;QACf,uEAAuE;QACvE,MAAK;QACL,KAAK;OACJ,YAAY,QAAQ;AAOjC","sources":["packages/react-aria-components/src/ListBox.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {\n AriaListBoxOptions,\n AriaListBoxProps,\n useListBox,\n useListBoxSection,\n useOption\n} from 'react-aria/useListBox';\n\nimport {\n ClassNameOrFunction,\n ContextValue,\n DEFAULT_SLOT,\n dom,\n DOMRenderProps,\n PossibleLinkDOMRenderProps,\n Provider,\n RenderProps,\n SlotProps,\n StyleProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {Collection} from 'react-aria/Collection';\nimport {\n CollectionBuilder,\n createBranchComponent,\n createLeafComponent\n} from 'react-aria/CollectionBuilder';\nimport {\n CollectionProps,\n CollectionRendererContext,\n ItemRenderProps,\n SectionContext,\n SectionProps\n} from './Collection';\nimport {\n DragAndDropContext,\n DropIndicatorContext,\n DropIndicatorProps,\n useDndPersistedKeys,\n useRenderDropIndicator\n} from './DragAndDrop';\nimport {DragAndDropHooks} from './useDragAndDrop';\nimport {DraggableCollectionState} from 'react-stately/useDraggableCollectionState';\nimport {DraggableItemResult} from 'react-aria/useDraggableCollection';\nimport {DragPreviewRenderer} from '@react-types/shared';\nimport {DroppableCollectionResult, DroppableItemResult} from 'react-aria/useDroppableCollection';\nimport {DroppableCollectionState} from 'react-stately/useDroppableCollectionState';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {\n FocusEvents,\n forwardRefType,\n GlobalDOMAttributes,\n HoverEvents,\n Key,\n KeyboardEvents,\n LinkDOMProps,\n PressEvents,\n RefObject\n} from '@react-types/shared';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport {HeaderContext} from './Header';\nimport {inertValue} from 'react-aria/private/utils/inertValue';\nimport {ItemNode, LoaderNode, SectionNode} from 'react-aria/private/collections/BaseCollection';\nimport {ListKeyboardDelegate} from 'react-aria/ListKeyboardDelegate';\nimport {ListState, UNSTABLE_useFilteredListState, useListState} from 'react-stately/useListState';\nimport {\n LoadMoreSentinelProps,\n useLoadMoreSentinel\n} from 'react-aria/private/utils/useLoadMoreSentinel';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {Node, Orientation, SelectionBehavior} from '@react-types/shared';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n JSX,\n ReactNode,\n useContext,\n useEffect,\n useMemo,\n useRef\n} from 'react';\nimport {SelectableCollectionContext, SelectableCollectionContextValue} from './Autocomplete';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SeparatorContext} from './Separator';\nimport {SharedElementTransition} from './SharedElementTransition';\nimport {TextContext} from './Text';\nimport {useCollator} from 'react-aria/useCollator';\nimport {useFocus} from 'react-aria/useFocus';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useKeyboard} from 'react-aria/useKeyboard';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useObjectRef} from 'react-aria/useObjectRef';\n\nexport interface ListBoxRenderProps {\n /**\n * Whether the listbox has no items and should display its empty state.\n *\n * @selector [data-empty]\n */\n isEmpty: boolean;\n /**\n * Whether the listbox is currently focused.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the listbox is currently keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * Whether the listbox is currently the active drop target.\n *\n * @selector [data-drop-target]\n */\n isDropTarget: boolean;\n /**\n * Whether the items are arranged in a stack or grid.\n *\n * @selector [data-layout=\"stack | grid\"]\n */\n layout: 'stack' | 'grid';\n /**\n * The primary orientation of the items.\n *\n * @selector [data-orientation=\"vertical | horizontal\"]\n */\n orientation: Orientation;\n /**\n * State of the listbox.\n */\n state: ListState<unknown>;\n}\n\nexport interface ListBoxProps<T>\n extends\n Omit<AriaListBoxProps<T>, 'children' | 'label'>,\n CollectionProps<T>,\n StyleRenderProps<ListBoxRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-ListBox'\n */\n className?: ClassNameOrFunction<ListBoxRenderProps>;\n /**\n * How multiple selection should behave in the collection.\n *\n * @default 'toggle'\n */\n selectionBehavior?: SelectionBehavior;\n /**\n * The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for\n * the ListBox.\n */\n dragAndDropHooks?: DragAndDropHooks<NoInfer<T>>;\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: ListBoxRenderProps) => ReactNode;\n /**\n * Whether the items are arranged in a stack or grid.\n *\n * @default 'stack'\n */\n layout?: 'stack' | 'grid';\n /**\n * The primary orientation of the items. Usually this is the\n * direction that the collection scrolls.\n *\n * @default 'vertical'\n */\n orientation?: Orientation;\n}\n\nexport const ListBoxContext = createContext<ContextValue<ListBoxProps<any>, HTMLDivElement>>(null);\nexport const ListStateContext = createContext<ListState<any> | null>(null);\n\n/**\n * A listbox displays a list of options and allows a user to select one or more of them.\n */\nexport const ListBox = /*#__PURE__*/ (forwardRef as forwardRefType)(function ListBox<T>(\n props: ListBoxProps<T>,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, ListBoxContext);\n let state = useContext(ListStateContext);\n\n // The structure of ListBox is a bit strange because it needs to work inside other components like ComboBox and Select.\n // Those components render two copies of their children so that the collection can be built even when the popover is closed.\n // The first copy sends a collection document via context which we render the collection portal into.\n // The second copy sends a ListState object via context which we use to render the ListBox without rebuilding the state.\n // Otherwise, we have a standalone ListBox, so we need to create a collection and state ourselves.\n if (state) {\n return <ListBoxInner state={state} props={props} listBoxRef={ref} />;\n }\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <StandaloneListBox props={props} listBoxRef={ref} collection={collection} />}\n </CollectionBuilder>\n );\n});\n\nfunction StandaloneListBox({props, listBoxRef, collection}) {\n props = {...props, collection, children: null, items: null};\n let {layoutDelegate} = useContext(CollectionRendererContext);\n let state = useListState({...props, layoutDelegate});\n return <ListBoxInner state={state} props={props} listBoxRef={listBoxRef} />;\n}\n\ninterface ListBoxInnerProps<T> {\n state: ListState<T>;\n props: ListBoxProps<T> &\n AriaListBoxOptions<T> & {filter?: SelectableCollectionContextValue<T>['filter']};\n listBoxRef: RefObject<HTMLElement | null>;\n}\n\nfunction ListBoxInner<T>({state: inputState, props, listBoxRef}: ListBoxInnerProps<T>) {\n [props, listBoxRef] = useContextProps(props, listBoxRef, SelectableCollectionContext);\n let {dragAndDropHooks, layout = 'stack', orientation = 'vertical', filter} = props;\n let state = UNSTABLE_useFilteredListState(inputState, filter);\n let {collection, selectionManager} = state;\n let isListDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState;\n let {direction} = useLocale();\n let {disabledBehavior, disabledKeys} = selectionManager;\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {\n isVirtualized,\n layoutDelegate,\n dropTargetDelegate: ctxDropTargetDelegate,\n CollectionRoot\n } = useContext(CollectionRendererContext);\n let keyboardDelegate = useMemo(\n () =>\n props.keyboardDelegate ||\n new ListKeyboardDelegate({\n collection,\n collator,\n ref: listBoxRef,\n disabledKeys,\n disabledBehavior,\n layout,\n orientation,\n direction,\n layoutDelegate\n }),\n [\n collection,\n collator,\n listBoxRef,\n disabledBehavior,\n disabledKeys,\n orientation,\n direction,\n props.keyboardDelegate,\n layout,\n layoutDelegate\n ]\n );\n\n let {listBoxProps} = useListBox(\n {\n ...props,\n shouldSelectOnPressUp: isListDraggable || props.shouldSelectOnPressUp,\n keyboardDelegate,\n isVirtualized\n },\n state,\n listBoxRef\n );\n\n let dragHooksProvided = useRef(isListDraggable);\n let dropHooksProvided = useRef(isListDroppable);\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n if (dragHooksProvided.current !== isListDraggable) {\n console.warn(\n 'Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.'\n );\n }\n if (dropHooksProvided.current !== isListDroppable) {\n console.warn(\n 'Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.'\n );\n }\n }, [isListDraggable, isListDroppable]);\n\n let dragState: DraggableCollectionState | undefined = undefined;\n let dropState: DroppableCollectionState | undefined = undefined;\n let droppableCollection: DroppableCollectionResult | undefined = undefined;\n let isRootDropTarget = false;\n let dragPreview: JSX.Element | null = null;\n let preview = useRef<DragPreviewRenderer>(null);\n\n if (isListDraggable && dragAndDropHooks) {\n dragState = dragAndDropHooks.useDraggableCollectionState!({\n collection,\n selectionManager,\n preview: dragAndDropHooks.renderDragPreview ? preview : undefined\n });\n dragAndDropHooks.useDraggableCollection!({}, dragState, listBoxRef);\n\n let DragPreview = dragAndDropHooks.DragPreview!;\n dragPreview = dragAndDropHooks.renderDragPreview ? (\n <DragPreview ref={preview}>{dragAndDropHooks.renderDragPreview}</DragPreview>\n ) : null;\n }\n\n if (isListDroppable && dragAndDropHooks) {\n dropState = dragAndDropHooks.useDroppableCollectionState!({\n collection,\n selectionManager\n });\n\n let dropTargetDelegate =\n dragAndDropHooks.dropTargetDelegate ||\n ctxDropTargetDelegate ||\n new dragAndDropHooks.ListDropTargetDelegate(collection, listBoxRef, {\n orientation,\n layout,\n direction\n });\n droppableCollection = dragAndDropHooks.useDroppableCollection!(\n {\n keyboardDelegate,\n dropTargetDelegate\n },\n dropState,\n listBoxRef\n );\n\n isRootDropTarget = dropState.isDropTarget({type: 'root'});\n }\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let isEmpty = state.collection.size === 0;\n let renderValues = {\n isDropTarget: isRootDropTarget,\n isEmpty,\n isFocused,\n isFocusVisible,\n layout: props.layout || 'stack',\n orientation,\n state\n };\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-ListBox',\n values: renderValues\n });\n\n let emptyState: JSX.Element | null = null;\n if (isEmpty && props.renderEmptyState) {\n emptyState = (\n <div\n // eslint-disable-next-line\n role=\"option\"\n style={{display: 'contents'}}>\n {props.renderEmptyState(renderValues)}\n </div>\n );\n }\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <FocusScope>\n <dom.div\n {...mergeProps(\n DOMProps,\n renderProps,\n listBoxProps,\n focusProps,\n droppableCollection?.collectionProps\n )}\n ref={listBoxRef as RefObject<HTMLDivElement>}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-drop-target={isRootDropTarget || undefined}\n data-empty={isEmpty || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-layout={props.layout || 'stack'}\n data-orientation={orientation}>\n <Provider\n values={[\n [ListBoxContext, props],\n [ListStateContext, state],\n [DragAndDropContext, {dragAndDropHooks, dragState, dropState}],\n [SeparatorContext, {elementType: 'div'}],\n [DropIndicatorContext, {render: ListBoxDropIndicatorWrapper}],\n [SectionContext, {name: 'ListBoxSection', render: ListBoxSectionInner}]\n ]}>\n <SharedElementTransition>\n <CollectionRoot\n collection={collection}\n scrollRef={listBoxRef}\n persistedKeys={useDndPersistedKeys(selectionManager, dragAndDropHooks, dropState)}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)}\n />\n </SharedElementTransition>\n </Provider>\n {emptyState}\n {dragPreview}\n </dom.div>\n </FocusScope>\n );\n}\n\nexport interface ListBoxSectionProps<T>\n extends SectionProps<T>, DOMRenderProps<'section', undefined> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element.\n *\n * @default 'react-aria-ListBoxSection'\n */\n className?: string;\n}\n\nfunction ListBoxSectionInner<T>(\n props: ListBoxSectionProps<T>,\n ref: ForwardedRef<HTMLElement>,\n section: Node<T>,\n className = 'react-aria-ListBoxSection'\n) {\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useListBoxSection({\n heading,\n 'aria-label': props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: undefined,\n defaultClassName: className,\n values: undefined\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n\n return (\n <dom.section {...mergeProps(DOMProps, renderProps, groupProps)} ref={ref}>\n <HeaderContext.Provider value={{...headingProps, ref: headingRef}}>\n <CollectionBranch\n collection={state.collection}\n parent={section}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)}\n />\n </HeaderContext.Provider>\n </dom.section>\n );\n}\n\n/**\n * A ListBoxSection represents a section within a ListBox.\n */\nexport const ListBoxSection = /*#__PURE__*/ createBranchComponent(SectionNode, ListBoxSectionInner);\n\nexport interface ListBoxItemRenderProps extends ItemRenderProps {}\n\nexport interface ListBoxItemProps<T = object>\n extends\n Omit<RenderProps<ListBoxItemRenderProps>, 'render'>,\n PossibleLinkDOMRenderProps<'div', ListBoxItemRenderProps>,\n LinkDOMProps,\n HoverEvents,\n PressEvents,\n KeyboardEvents,\n FocusEvents<HTMLDivElement>,\n Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-ListBoxItem'\n */\n className?: ClassNameOrFunction<ListBoxItemRenderProps>;\n /** The unique id of the item. */\n id?: Key;\n /**\n * The object value that this item represents. When using dynamic collections, this is set\n * automatically.\n */\n value?: T;\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string;\n /** An accessibility label for this item. */\n 'aria-label'?: string;\n /** Whether the item is disabled. */\n isDisabled?: boolean;\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends\n * on the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void;\n}\n\n/**\n * A ListBoxItem represents an individual option in a ListBox.\n */\nexport const ListBoxItem = /*#__PURE__*/ createLeafComponent(ItemNode, function ListBoxItem<\n T\n>(props: ListBoxItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let ref = useObjectRef<any>(forwardedRef);\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dragState, dropState} = useContext(DragAndDropContext)!;\n let isDraggable =\n dragState && !(dragState.isDisabled || dragState.selectionManager.isDisabled(item.key));\n let {optionProps, labelProps, descriptionProps, ...states} = useOption(\n {key: item.key, 'aria-label': props?.['aria-label']},\n state,\n ref\n );\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction && !isDraggable,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let {keyboardProps} = useKeyboard(props);\n let {focusProps} = useFocus(props);\n\n let draggableItem: DraggableItemResult | null = null;\n if (dragState && dragAndDropHooks) {\n draggableItem = dragAndDropHooks.useDraggableItem!(\n {key: item.key, hasAction: states.hasAction},\n dragState\n );\n }\n\n let droppableItem: DroppableItemResult | null = null;\n if (dropState && dragAndDropHooks) {\n droppableItem = dragAndDropHooks.useDroppableItem!(\n {\n target: {type: 'item', key: item.key, dropPosition: 'on'}\n },\n dropState,\n ref\n );\n }\n\n let isDragging = dragState && dragState.isDragging(item.key);\n let renderProps = useRenderProps<ListBoxItemRenderProps, any>({\n ...props,\n id: undefined,\n children: props.children,\n defaultClassName: 'react-aria-ListBoxItem',\n values: {\n ...states,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n allowsDragging: !!dragState,\n isDragging,\n isDropTarget: droppableItem?.isDropTarget\n }\n });\n\n useEffect(() => {\n if (!item.textValue && process.env.NODE_ENV !== 'production') {\n console.warn(\n 'A `textValue` prop is required for <ListBoxItem> elements with non-plain text children in order to support accessibility features such as type to select.'\n );\n }\n }, [item.textValue]);\n\n let ElementType = props.href ? dom.a : dom.div;\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n if (props.href && optionProps.tabIndex == null) {\n optionProps.tabIndex = -1;\n }\n\n return (\n <ElementType\n {...mergeProps(\n DOMProps,\n renderProps,\n optionProps,\n hoverProps,\n keyboardProps,\n focusProps,\n draggableItem?.dragProps,\n droppableItem?.dropProps\n )}\n ref={ref}\n data-allows-dragging={!!dragState || undefined}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={states.isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-dragging={isDragging || undefined}\n data-drop-target={droppableItem?.isDropTarget || undefined}\n data-selection-mode={\n state.selectionManager.selectionMode === 'none'\n ? undefined\n : state.selectionManager.selectionMode\n }>\n <Provider\n values={[\n [\n TextContext,\n {\n slots: {\n [DEFAULT_SLOT]: labelProps,\n label: labelProps,\n description: descriptionProps\n }\n }\n ],\n [SelectionIndicatorContext, {isSelected: states.isSelected}]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n\nfunction ListBoxDropIndicatorWrapper(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n ref = useObjectRef(ref);\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;\n let {dropIndicatorProps, isHidden, isDropTarget} = dragAndDropHooks!.useDropIndicator!(\n props,\n dropState!,\n ref\n );\n\n if (isHidden) {\n return null;\n }\n\n return (\n <ListBoxDropIndicatorForwardRef\n {...props}\n dropIndicatorProps={dropIndicatorProps}\n isDropTarget={isDropTarget}\n ref={ref}\n />\n );\n}\n\ninterface ListBoxDropIndicatorProps extends DropIndicatorProps {\n dropIndicatorProps: React.HTMLAttributes<HTMLElement>;\n isDropTarget: boolean;\n}\n\nfunction ListBoxDropIndicator(props: ListBoxDropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n let {dropIndicatorProps, isDropTarget, ...otherProps} = props;\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultClassName: 'react-aria-DropIndicator',\n values: {\n isDropTarget\n }\n });\n\n return (\n <>\n {/* oxlint-disable jsx-a11y/role-has-required-aria-props -- drop indicator is not selectable */}\n <dom.div\n {...dropIndicatorProps}\n {...renderProps}\n role=\"option\"\n ref={ref as RefObject<HTMLDivElement | null>}\n data-drop-target={isDropTarget || undefined}\n />\n {/* oxlint-enable jsx-a11y/role-has-required-aria-props */}\n </>\n );\n}\n\nconst ListBoxDropIndicatorForwardRef = forwardRef(ListBoxDropIndicator);\n\nexport interface ListBoxLoadMoreItemProps\n extends\n Omit<LoadMoreSentinelProps, 'collection'>,\n StyleProps,\n DOMRenderProps<'div', undefined>,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element.\n *\n * @default 'react-aria-ListBoxLoadMoreItem'\n */\n className?: string;\n /**\n * The load more spinner to render when loading additional items.\n */\n children?: ReactNode;\n /**\n * Whether or not the loading spinner should be rendered or not.\n */\n isLoading?: boolean;\n}\n\nexport const ListBoxLoadMoreItem = createLeafComponent(\n LoaderNode,\n function ListBoxLoadingIndicator(\n props: ListBoxLoadMoreItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n item: Node<object>\n ) {\n let state = useContext(ListStateContext)!;\n let {isLoading, onLoadMore, scrollOffset, ...otherProps} = props;\n\n let sentinelRef = useRef<HTMLDivElement>(null);\n let memoedLoadMoreProps = useMemo(\n () => ({\n onLoadMore,\n collection: state?.collection,\n sentinelRef,\n scrollOffset\n }),\n [onLoadMore, scrollOffset, state?.collection]\n );\n useLoadMoreSentinel(memoedLoadMoreProps, sentinelRef);\n let renderProps = useRenderProps({\n ...otherProps,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-ListBoxLoadingIndicator',\n values: undefined\n });\n\n let optionProps = {\n // For Android talkback\n tabIndex: -1\n // For now don't include aria-posinset and aria-setsize on loader since they aren't keyboard focusable\n // Arguably shouldn't include them ever since it might be confusing to the user to include the loaders as part of the\n // item count\n };\n\n return (\n <>\n {/* Alway render the sentinel. For now onus is on the user for styling when using flex + gap (this would introduce a gap even though it doesn't take room) */}\n {/* @ts-ignore - compatibility with React < 19 */}\n <div style={{position: 'relative', width: 0, height: 0}} inert={inertValue(true)}>\n <div\n data-testid=\"loadMoreSentinel\"\n ref={sentinelRef}\n style={{position: 'absolute', height: 1, width: 1}}\n />\n </div>\n {isLoading && renderProps.children && (\n <>\n {/* oxlint-disable jsx-a11y/role-has-required-aria-props -- loader row is not selectable */}\n <dom.div\n {...mergeProps(filterDOMProps(props, {global: true}), optionProps)}\n {...renderProps}\n // aria-selected isn't needed here since this option is not selectable.\n role=\"option\"\n ref={ref as ForwardedRef<HTMLDivElement>}>\n {renderProps.children}\n </dom.div>\n {/* oxlint-enable jsx-a11y/role-has-required-aria-props */}\n </>\n )}\n </>\n );\n }\n);\n"],"names":[],"version":3,"file":"ListBox.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyLM,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAAmD;AACtF,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AAc,OAAO;KAAW;IAE/C,CAAA,GAAA,0BAAkB,EAAE,qBAAqB;IACzC,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,UAAU;QACb,IAAI;QACJ,UAAU,KAAK,QAAQ;QACvB,kBAAkB;QAClB,QAAQ;IACV;IAEA,IAAI,cAAc;QAChB,uBAAuB;QACvB,UAAU;IAIZ;IAEA,qBACE,gFAGE,gCAAC;QAAI,OAAO;YAAC,UAAU;YAAY,OAAO;YAAG,QAAQ;QAAC;QAAG,OAAO,CAAA,GAAA,iBAAS,EAAE;qBACzE,gCAAC;QACC,eAAY;QACZ,KAAK;QACL,OAAO;YAAC,UAAU;YAAY,QAAQ;YAAG,OAAO;QAAC;SAGpD,aAAa,YAAY,QAAQ,kBAChC,gFAEE,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,qBAAa,EAAE,OAAO;YAAC,QAAQ;QAAI,IAAI,YAAY;QACjE,GAAG,WAAW;QACf,uEAAuE;QACvE,MAAK;QACL,KAAK;OACJ,YAAY,QAAQ;AAOjC","sources":["packages/react-aria-components/src/ListBox.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {\n AriaListBoxOptions,\n AriaListBoxProps,\n useListBox,\n useListBoxSection,\n useOption\n} from 'react-aria/useListBox';\n\nimport {\n ClassNameOrFunction,\n ContextValue,\n DEFAULT_SLOT,\n dom,\n DOMRenderProps,\n PossibleLinkDOMRenderProps,\n Provider,\n RenderProps,\n SlotProps,\n StyleProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {Collection} from 'react-aria/Collection';\nimport {\n CollectionBuilder,\n createBranchComponent,\n createLeafComponent\n} from 'react-aria/CollectionBuilder';\nimport {\n CollectionProps,\n CollectionRendererContext,\n ItemRenderProps,\n SectionContext,\n SectionProps\n} from './Collection';\nimport {\n DragAndDropContext,\n DropIndicatorContext,\n DropIndicatorProps,\n useDndPersistedKeys,\n useRenderDropIndicator\n} from './DragAndDrop';\nimport {DragAndDropHooks} from './useDragAndDrop';\nimport {DraggableCollectionState} from 'react-stately/useDraggableCollectionState';\nimport {DraggableItemResult} from 'react-aria/useDraggableCollection';\nimport {DragPreviewRenderer} from '@react-types/shared';\nimport {DroppableCollectionResult, DroppableItemResult} from 'react-aria/useDroppableCollection';\nimport {DroppableCollectionState} from 'react-stately/useDroppableCollectionState';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {\n FocusEvents,\n forwardRefType,\n GlobalDOMAttributes,\n HoverEvents,\n Key,\n KeyboardEvents,\n LinkDOMProps,\n PressEvents,\n RefObject\n} from '@react-types/shared';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport {HeaderContext} from './Header';\nimport {inertValue} from 'react-aria/private/utils/inertValue';\nimport {ItemNode, LoaderNode, SectionNode} from 'react-aria/private/collections/BaseCollection';\nimport {ListKeyboardDelegate} from 'react-aria/ListKeyboardDelegate';\nimport {ListState, UNSTABLE_useFilteredListState, useListState} from 'react-stately/useListState';\nimport {\n LoadMoreSentinelProps,\n useLoadMoreSentinel\n} from 'react-aria/private/utils/useLoadMoreSentinel';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {Node, Orientation, SelectionBehavior} from '@react-types/shared';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n JSX,\n ReactNode,\n useContext,\n useEffect,\n useMemo,\n useRef\n} from 'react';\nimport {SelectableCollectionContext, SelectableCollectionContextValue} from './Autocomplete';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SeparatorContext} from './Separator';\nimport {SharedElementTransition} from './SharedElementTransition';\nimport {TextContext} from './Text';\nimport {useCollator} from 'react-aria/useCollator';\nimport {useFocus} from 'react-aria/useFocus';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useKeyboard} from 'react-aria/useKeyboard';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useObjectRef} from 'react-aria/useObjectRef';\n\nexport interface ListBoxRenderProps {\n /**\n * Whether the listbox has no items and should display its empty state.\n *\n * @selector [data-empty]\n */\n isEmpty: boolean;\n /**\n * Whether the listbox is currently focused.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the listbox is currently keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * Whether the listbox is currently the active drop target.\n *\n * @selector [data-drop-target]\n */\n isDropTarget: boolean;\n /**\n * Whether the items are arranged in a stack or grid.\n *\n * @selector [data-layout=\"stack | grid\"]\n */\n layout: 'stack' | 'grid';\n /**\n * The primary orientation of the items.\n *\n * @selector [data-orientation=\"vertical | horizontal\"]\n */\n orientation: Orientation;\n /**\n * State of the listbox.\n */\n state: ListState<unknown>;\n}\n\nexport interface ListBoxProps<T>\n extends\n Omit<AriaListBoxProps<T>, 'children' | 'label'>,\n CollectionProps<T>,\n StyleRenderProps<ListBoxRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-ListBox'\n */\n className?: ClassNameOrFunction<ListBoxRenderProps>;\n /**\n * How multiple selection should behave in the collection.\n *\n * @default 'toggle'\n */\n selectionBehavior?: SelectionBehavior;\n /**\n * The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for\n * the ListBox.\n */\n dragAndDropHooks?: DragAndDropHooks<NoInfer<T>>;\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: ListBoxRenderProps) => ReactNode;\n /**\n * Whether the items are arranged in a stack or grid.\n *\n * @default 'stack'\n */\n layout?: 'stack' | 'grid';\n /**\n * The primary orientation of the items. Usually this is the\n * direction that the collection scrolls.\n *\n * @default 'vertical'\n */\n orientation?: Orientation;\n}\n\nexport const ListBoxContext = createContext<ContextValue<ListBoxProps<any>, HTMLDivElement>>(null);\nexport const ListStateContext = createContext<ListState<any> | null>(null);\n\n/**\n * A listbox displays a list of options and allows a user to select one or more of them.\n */\nexport const ListBox = /*#__PURE__*/ (forwardRef as forwardRefType)(function ListBox<T>(\n props: ListBoxProps<T>,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, ListBoxContext);\n let state = useContext(ListStateContext);\n\n // The structure of ListBox is a bit strange because it needs to work inside other components like ComboBox and Select.\n // Those components render two copies of their children so that the collection can be built even when the popover is closed.\n // The first copy sends a collection document via context which we render the collection portal into.\n // The second copy sends a ListState object via context which we use to render the ListBox without rebuilding the state.\n // Otherwise, we have a standalone ListBox, so we need to create a collection and state ourselves.\n if (state) {\n return <ListBoxInner state={state} props={props} listBoxRef={ref} />;\n }\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <StandaloneListBox props={props} listBoxRef={ref} collection={collection} />}\n </CollectionBuilder>\n );\n});\n\nfunction StandaloneListBox({props, listBoxRef, collection}) {\n props = {...props, collection, children: null, items: null};\n let {layoutDelegate} = useContext(CollectionRendererContext);\n let state = useListState({...props, layoutDelegate});\n return <ListBoxInner state={state} props={props} listBoxRef={listBoxRef} />;\n}\n\ninterface ListBoxInnerProps<T> {\n state: ListState<T>;\n props: ListBoxProps<T> &\n AriaListBoxOptions<T> & {filter?: SelectableCollectionContextValue<T>['filter']};\n listBoxRef: RefObject<HTMLElement | null>;\n}\n\nfunction ListBoxInner<T>({state: inputState, props, listBoxRef}: ListBoxInnerProps<T>) {\n // oxlint-disable-next-line react/react-compiler\n [props, listBoxRef] = useContextProps(props, listBoxRef, SelectableCollectionContext);\n let {dragAndDropHooks, layout = 'stack', orientation = 'vertical', filter} = props;\n // oxlint-disable-next-line react/react-compiler\n let state = UNSTABLE_useFilteredListState(inputState, filter);\n let {collection, selectionManager} = state;\n let isListDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState;\n let {direction} = useLocale();\n let {disabledBehavior, disabledKeys} = selectionManager;\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {\n isVirtualized,\n layoutDelegate,\n dropTargetDelegate: ctxDropTargetDelegate,\n CollectionRoot\n } = useContext(CollectionRendererContext);\n let keyboardDelegate = useMemo(\n // oxlint-disable-next-line react/react-compiler\n () =>\n props.keyboardDelegate ||\n new ListKeyboardDelegate({\n collection,\n collator,\n ref: listBoxRef,\n disabledKeys,\n disabledBehavior,\n layout,\n orientation,\n direction,\n layoutDelegate\n }),\n [\n collection,\n collator,\n listBoxRef,\n disabledBehavior,\n disabledKeys,\n orientation,\n direction,\n props.keyboardDelegate,\n layout,\n layoutDelegate\n ]\n );\n\n let {listBoxProps} = useListBox(\n {\n ...props,\n shouldSelectOnPressUp: isListDraggable || props.shouldSelectOnPressUp,\n keyboardDelegate,\n isVirtualized\n },\n state,\n listBoxRef\n );\n\n let dragHooksProvided = useRef(isListDraggable);\n let dropHooksProvided = useRef(isListDroppable);\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n if (dragHooksProvided.current !== isListDraggable) {\n console.warn(\n 'Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.'\n );\n }\n if (dropHooksProvided.current !== isListDroppable) {\n console.warn(\n 'Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.'\n );\n }\n }, [isListDraggable, isListDroppable]);\n\n let dragState: DraggableCollectionState | undefined = undefined;\n let dropState: DroppableCollectionState | undefined = undefined;\n let droppableCollection: DroppableCollectionResult | undefined = undefined;\n let isRootDropTarget = false;\n let dragPreview: JSX.Element | null = null;\n let preview = useRef<DragPreviewRenderer>(null);\n\n if (isListDraggable && dragAndDropHooks) {\n // oxlint-disable-next-line react/react-compiler\n dragState = dragAndDropHooks.useDraggableCollectionState!({\n collection,\n selectionManager,\n preview: dragAndDropHooks.renderDragPreview ? preview : undefined\n });\n // oxlint-disable-next-line react/react-compiler\n dragAndDropHooks.useDraggableCollection!({}, dragState, listBoxRef);\n\n let DragPreview = dragAndDropHooks.DragPreview!;\n dragPreview = dragAndDropHooks.renderDragPreview ? (\n <DragPreview ref={preview}>{dragAndDropHooks.renderDragPreview}</DragPreview>\n ) : null;\n }\n\n if (isListDroppable && dragAndDropHooks) {\n // oxlint-disable-next-line react/react-compiler\n dropState = dragAndDropHooks.useDroppableCollectionState!({\n collection,\n selectionManager\n });\n\n let dropTargetDelegate =\n dragAndDropHooks.dropTargetDelegate ||\n ctxDropTargetDelegate ||\n new dragAndDropHooks.ListDropTargetDelegate(collection, listBoxRef, {\n orientation,\n layout,\n direction\n });\n // oxlint-disable-next-line react/react-compiler\n droppableCollection = dragAndDropHooks.useDroppableCollection!(\n {\n keyboardDelegate,\n dropTargetDelegate\n },\n dropState,\n listBoxRef\n );\n\n isRootDropTarget = dropState.isDropTarget({type: 'root'});\n }\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let isEmpty = state.collection.size === 0;\n let renderValues = {\n isDropTarget: isRootDropTarget,\n isEmpty,\n isFocused,\n isFocusVisible,\n layout: props.layout || 'stack',\n orientation,\n state\n };\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-ListBox',\n values: renderValues\n });\n\n let emptyState: JSX.Element | null = null;\n if (isEmpty && props.renderEmptyState) {\n emptyState = (\n <div\n // eslint-disable-next-line\n role=\"option\"\n style={{display: 'contents'}}>\n {props.renderEmptyState(renderValues)}\n </div>\n );\n }\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <FocusScope>\n <dom.div\n {...mergeProps(\n DOMProps,\n renderProps,\n listBoxProps,\n focusProps,\n droppableCollection?.collectionProps\n )}\n ref={listBoxRef as RefObject<HTMLDivElement>}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-drop-target={isRootDropTarget || undefined}\n data-empty={isEmpty || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-layout={props.layout || 'stack'}\n data-orientation={orientation}>\n <Provider\n values={[\n [ListBoxContext, props],\n [ListStateContext, state],\n [DragAndDropContext, {dragAndDropHooks, dragState, dropState}],\n [SeparatorContext, {elementType: 'div'}],\n [DropIndicatorContext, {render: ListBoxDropIndicatorWrapper}],\n [SectionContext, {name: 'ListBoxSection', render: ListBoxSectionInner}]\n ]}>\n <SharedElementTransition>\n <CollectionRoot\n collection={collection}\n scrollRef={listBoxRef}\n persistedKeys={useDndPersistedKeys(selectionManager, dragAndDropHooks, dropState)}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)}\n />\n </SharedElementTransition>\n </Provider>\n {emptyState}\n {dragPreview}\n </dom.div>\n </FocusScope>\n );\n}\n\nexport interface ListBoxSectionProps<T>\n extends SectionProps<T>, DOMRenderProps<'section', undefined> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element.\n *\n * @default 'react-aria-ListBoxSection'\n */\n className?: string;\n}\n\nfunction ListBoxSectionInner<T>(\n props: ListBoxSectionProps<T>,\n ref: ForwardedRef<HTMLElement>,\n section: Node<T>,\n className = 'react-aria-ListBoxSection'\n) {\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useListBoxSection({\n heading,\n 'aria-label': props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: undefined,\n defaultClassName: className,\n values: undefined\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n\n return (\n <dom.section {...mergeProps(DOMProps, renderProps, groupProps)} ref={ref}>\n <HeaderContext.Provider value={{...headingProps, ref: headingRef}}>\n <CollectionBranch\n collection={state.collection}\n parent={section}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)}\n />\n </HeaderContext.Provider>\n </dom.section>\n );\n}\n\n/**\n * A ListBoxSection represents a section within a ListBox.\n */\nexport const ListBoxSection = /*#__PURE__*/ createBranchComponent(SectionNode, ListBoxSectionInner);\n\nexport interface ListBoxItemRenderProps extends ItemRenderProps {}\n\nexport interface ListBoxItemProps<T = object>\n extends\n Omit<RenderProps<ListBoxItemRenderProps>, 'render'>,\n PossibleLinkDOMRenderProps<'div', ListBoxItemRenderProps>,\n LinkDOMProps,\n HoverEvents,\n PressEvents,\n KeyboardEvents,\n FocusEvents<HTMLDivElement>,\n Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-ListBoxItem'\n */\n className?: ClassNameOrFunction<ListBoxItemRenderProps>;\n /** The unique id of the item. */\n id?: Key;\n /**\n * The object value that this item represents. When using dynamic collections, this is set\n * automatically.\n */\n value?: T;\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string;\n /** An accessibility label for this item. */\n 'aria-label'?: string;\n /** Whether the item is disabled. */\n isDisabled?: boolean;\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends\n * on the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void;\n}\n\n/**\n * A ListBoxItem represents an individual option in a ListBox.\n */\nexport const ListBoxItem = /*#__PURE__*/ createLeafComponent(ItemNode, function ListBoxItem<\n T\n>(props: ListBoxItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let ref = useObjectRef<any>(forwardedRef);\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dragState, dropState} = useContext(DragAndDropContext)!;\n let isDraggable =\n dragState && !(dragState.isDisabled || dragState.selectionManager.isDisabled(item.key));\n let {optionProps, labelProps, descriptionProps, ...states} = useOption(\n {key: item.key, 'aria-label': props?.['aria-label']},\n state,\n ref\n );\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction && !isDraggable,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let {keyboardProps} = useKeyboard(props);\n let {focusProps} = useFocus(props);\n\n let draggableItem: DraggableItemResult | null = null;\n if (dragState && dragAndDropHooks) {\n draggableItem = dragAndDropHooks.useDraggableItem!(\n {key: item.key, hasAction: states.hasAction},\n dragState\n );\n }\n\n let droppableItem: DroppableItemResult | null = null;\n if (dropState && dragAndDropHooks) {\n droppableItem = dragAndDropHooks.useDroppableItem!(\n {\n target: {type: 'item', key: item.key, dropPosition: 'on'}\n },\n dropState,\n ref\n );\n }\n\n let isDragging = dragState && dragState.isDragging(item.key);\n let renderProps = useRenderProps<ListBoxItemRenderProps, any>({\n ...props,\n id: undefined,\n children: props.children,\n defaultClassName: 'react-aria-ListBoxItem',\n values: {\n ...states,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n allowsDragging: !!dragState,\n isDragging,\n isDropTarget: droppableItem?.isDropTarget\n }\n });\n\n useEffect(() => {\n if (!item.textValue && process.env.NODE_ENV !== 'production') {\n console.warn(\n 'A `textValue` prop is required for <ListBoxItem> elements with non-plain text children in order to support accessibility features such as type to select.'\n );\n }\n }, [item.textValue]);\n\n let ElementType = props.href ? dom.a : dom.div;\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n if (props.href && optionProps.tabIndex == null) {\n optionProps.tabIndex = -1;\n }\n\n return (\n <ElementType\n {...mergeProps(\n DOMProps,\n renderProps,\n optionProps,\n hoverProps,\n keyboardProps,\n focusProps,\n draggableItem?.dragProps,\n droppableItem?.dropProps\n )}\n ref={ref}\n data-allows-dragging={!!dragState || undefined}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={states.isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-dragging={isDragging || undefined}\n data-drop-target={droppableItem?.isDropTarget || undefined}\n data-selection-mode={\n state.selectionManager.selectionMode === 'none'\n ? undefined\n : state.selectionManager.selectionMode\n }>\n <Provider\n values={[\n [\n TextContext,\n {\n slots: {\n [DEFAULT_SLOT]: labelProps,\n label: labelProps,\n description: descriptionProps\n }\n }\n ],\n [SelectionIndicatorContext, {isSelected: states.isSelected}]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n\nfunction ListBoxDropIndicatorWrapper(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n ref = useObjectRef(ref);\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;\n // oxlint-disable-next-line react/react-compiler\n let {dropIndicatorProps, isHidden, isDropTarget} = dragAndDropHooks!.useDropIndicator!(\n props,\n dropState!,\n ref\n );\n\n if (isHidden) {\n return null;\n }\n\n return (\n <ListBoxDropIndicatorForwardRef\n {...props}\n dropIndicatorProps={dropIndicatorProps}\n isDropTarget={isDropTarget}\n ref={ref}\n />\n );\n}\n\ninterface ListBoxDropIndicatorProps extends DropIndicatorProps {\n dropIndicatorProps: React.HTMLAttributes<HTMLElement>;\n isDropTarget: boolean;\n}\n\nfunction ListBoxDropIndicator(props: ListBoxDropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n let {dropIndicatorProps, isDropTarget, ...otherProps} = props;\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultClassName: 'react-aria-DropIndicator',\n values: {\n isDropTarget\n }\n });\n\n return (\n <>\n {/* oxlint-disable jsx-a11y/role-has-required-aria-props -- drop indicator is not selectable */}\n <dom.div\n {...dropIndicatorProps}\n {...renderProps}\n role=\"option\"\n ref={ref as RefObject<HTMLDivElement | null>}\n data-drop-target={isDropTarget || undefined}\n />\n {/* oxlint-enable jsx-a11y/role-has-required-aria-props */}\n </>\n );\n}\n\nconst ListBoxDropIndicatorForwardRef = forwardRef(ListBoxDropIndicator);\n\nexport interface ListBoxLoadMoreItemProps\n extends\n Omit<LoadMoreSentinelProps, 'collection' | 'direction'>,\n StyleProps,\n DOMRenderProps<'div', undefined>,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element.\n *\n * @default 'react-aria-ListBoxLoadingIndicator'\n */\n className?: string;\n /**\n * The load more spinner to render when loading additional items.\n */\n children?: ReactNode;\n /**\n * Whether or not the loading spinner should be rendered or not.\n */\n isLoading?: boolean;\n}\n\nexport const ListBoxLoadMoreItem = createLeafComponent(\n LoaderNode,\n function ListBoxLoadingIndicator(\n props: ListBoxLoadMoreItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n item: Node<object>\n ) {\n let state = useContext(ListStateContext)!;\n let {isLoading, onLoadMore, scrollOffset, ...otherProps} = props;\n\n let sentinelRef = useRef<HTMLDivElement>(null);\n let memoedLoadMoreProps = useMemo(\n () => ({\n onLoadMore,\n collection: state?.collection,\n sentinelRef,\n scrollOffset\n }),\n [onLoadMore, scrollOffset, state?.collection]\n );\n useLoadMoreSentinel(memoedLoadMoreProps, sentinelRef);\n let renderProps = useRenderProps({\n ...otherProps,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-ListBoxLoadingIndicator',\n values: undefined\n });\n\n let optionProps = {\n // For Android talkback\n tabIndex: -1\n // For now don't include aria-posinset and aria-setsize on loader since they aren't keyboard focusable\n // Arguably shouldn't include them ever since it might be confusing to the user to include the loaders as part of the\n // item count\n };\n\n return (\n <>\n {/* Alway render the sentinel. For now onus is on the user for styling when using flex + gap (this would introduce a gap even though it doesn't take room) */}\n {/* @ts-ignore - compatibility with React < 19 */}\n <div style={{position: 'relative', width: 0, height: 0}} inert={inertValue(true)}>\n <div\n data-testid=\"loadMoreSentinel\"\n ref={sentinelRef}\n style={{position: 'absolute', height: 1, width: 1}}\n />\n </div>\n {isLoading && renderProps.children && (\n <>\n {/* oxlint-disable jsx-a11y/role-has-required-aria-props -- loader row is not selectable */}\n <dom.div\n {...mergeProps(filterDOMProps(props, {global: true}), optionProps)}\n {...renderProps}\n // aria-selected isn't needed here since this option is not selectable.\n role=\"option\"\n ref={ref as ForwardedRef<HTMLDivElement>}>\n {renderProps.children}\n </dom.div>\n {/* oxlint-enable jsx-a11y/role-has-required-aria-props */}\n </>\n )}\n </>\n );\n }\n);\n"],"names":[],"version":3,"file":"ListBox.mjs.map"}
|
package/dist/private/Menu.cjs
CHANGED
|
@@ -16,6 +16,8 @@ var $fDx7A$reactariaCollection = require("react-aria/Collection");
|
|
|
16
16
|
var $fDx7A$reactariaCollectionBuilder = require("react-aria/CollectionBuilder");
|
|
17
17
|
var $fDx7A$reactariafilterDOMProps = require("react-aria/filterDOMProps");
|
|
18
18
|
var $fDx7A$reactariaFocusScope = require("react-aria/FocusScope");
|
|
19
|
+
var $fDx7A$reactariaprivateutilsinertValue = require("react-aria/private/utils/inertValue");
|
|
20
|
+
var $fDx7A$reactariaprivateutilsuseLoadMoreSentinel = require("react-aria/private/utils/useLoadMoreSentinel");
|
|
19
21
|
var $fDx7A$reactariamergeProps = require("react-aria/mergeProps");
|
|
20
22
|
var $fDx7A$reactariaprivateinteractionsPressResponder = require("react-aria/private/interactions/PressResponder");
|
|
21
23
|
var $fDx7A$react = require("react");
|
|
@@ -43,6 +45,7 @@ $parcel$export(module.exports, "SubmenuTrigger", function () { return $76f9e98b4
|
|
|
43
45
|
$parcel$export(module.exports, "Menu", function () { return $76f9e98b4261ab43$export$d9b273488cd8ce6f; });
|
|
44
46
|
$parcel$export(module.exports, "MenuSection", function () { return $76f9e98b4261ab43$export$4b1545b4f2016d26; });
|
|
45
47
|
$parcel$export(module.exports, "MenuItem", function () { return $76f9e98b4261ab43$export$2ce376c2cc3355c8; });
|
|
48
|
+
$parcel$export(module.exports, "MenuLoadMoreItem", function () { return $76f9e98b4261ab43$export$93aba29d3a678058; });
|
|
46
49
|
/*
|
|
47
50
|
* Copyright 2022 Adobe. All rights reserved.
|
|
48
51
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -77,6 +80,8 @@ $parcel$export(module.exports, "MenuItem", function () { return $76f9e98b4261ab4
|
|
|
77
80
|
|
|
78
81
|
|
|
79
82
|
|
|
83
|
+
|
|
84
|
+
|
|
80
85
|
|
|
81
86
|
|
|
82
87
|
|
|
@@ -120,7 +125,8 @@ function $76f9e98b4261ab43$export$27d2ad3c5815583e(props) {
|
|
|
120
125
|
triggerRef: ref,
|
|
121
126
|
scrollRef: scrollRef,
|
|
122
127
|
placement: 'bottom start',
|
|
123
|
-
'aria-labelledby': menuProps['aria-labelledby']
|
|
128
|
+
'aria-labelledby': menuProps['aria-labelledby'],
|
|
129
|
+
offset: props.trigger === 'contextMenu' ? 0 : undefined
|
|
124
130
|
}
|
|
125
131
|
]
|
|
126
132
|
]
|
|
@@ -296,7 +302,8 @@ function $76f9e98b4261ab43$var$MenuInner({ props: props, collection: collection,
|
|
|
296
302
|
$76f9e98b4261ab43$var$SelectionManagerContext,
|
|
297
303
|
state.selectionManager
|
|
298
304
|
],
|
|
299
|
-
/* Ensure root MenuTriggerState is defined, in case Menu is rendered outside a MenuTrigger. */ /* We assume the context can never change between defined and undefined. */
|
|
305
|
+
/* Ensure root MenuTriggerState is defined, in case Menu is rendered outside a MenuTrigger. */ /* We assume the context can never change between defined and undefined. */ // oxlint-disable-next-line react/react-compiler, react-hooks/rules-of-hooks
|
|
306
|
+
[
|
|
300
307
|
$76f9e98b4261ab43$export$795aec4671cbae19,
|
|
301
308
|
triggerState ?? (0, $fDx7A$reactstatelyuseMenuTriggerState.useMenuTriggerState)({})
|
|
302
309
|
]
|
|
@@ -460,6 +467,56 @@ const $76f9e98b4261ab43$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $fDx7A$react
|
|
|
460
467
|
]
|
|
461
468
|
}, renderProps.children));
|
|
462
469
|
});
|
|
470
|
+
const $76f9e98b4261ab43$export$93aba29d3a678058 = (0, $fDx7A$reactariaCollectionBuilder.createLeafComponent)((0, $fDx7A$reactariaprivatecollectionsBaseCollection.LoaderNode), function MenuLoadingIndicator(props, ref, item) {
|
|
471
|
+
let state = (0, $fDx7A$react.useContext)($76f9e98b4261ab43$export$24aad8519b95b41b);
|
|
472
|
+
let { isLoading: isLoading, onLoadMore: onLoadMore, scrollOffset: scrollOffset, ...otherProps } = props;
|
|
473
|
+
let sentinelRef = (0, $fDx7A$react.useRef)(null);
|
|
474
|
+
let memoedLoadMoreProps = (0, $fDx7A$react.useMemo)(()=>({
|
|
475
|
+
onLoadMore: onLoadMore,
|
|
476
|
+
collection: state?.collection,
|
|
477
|
+
sentinelRef: sentinelRef,
|
|
478
|
+
scrollOffset: scrollOffset
|
|
479
|
+
}), [
|
|
480
|
+
onLoadMore,
|
|
481
|
+
scrollOffset,
|
|
482
|
+
state?.collection
|
|
483
|
+
]);
|
|
484
|
+
(0, $fDx7A$reactariaprivateutilsuseLoadMoreSentinel.useLoadMoreSentinel)(memoedLoadMoreProps, sentinelRef);
|
|
485
|
+
let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
|
|
486
|
+
...otherProps,
|
|
487
|
+
id: undefined,
|
|
488
|
+
children: item.rendered,
|
|
489
|
+
defaultClassName: 'react-aria-MenuLoadingIndicator',
|
|
490
|
+
values: undefined
|
|
491
|
+
});
|
|
492
|
+
let itemProps = {
|
|
493
|
+
// For Android talkback
|
|
494
|
+
tabIndex: -1
|
|
495
|
+
};
|
|
496
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($fDx7A$react))).createElement((0, ($parcel$interopDefault($fDx7A$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($fDx7A$react))).createElement("div", {
|
|
497
|
+
style: {
|
|
498
|
+
position: 'relative',
|
|
499
|
+
width: 0,
|
|
500
|
+
height: 0
|
|
501
|
+
},
|
|
502
|
+
inert: (0, $fDx7A$reactariaprivateutilsinertValue.inertValue)(true)
|
|
503
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($fDx7A$react))).createElement("div", {
|
|
504
|
+
"data-testid": "loadMoreSentinel",
|
|
505
|
+
ref: sentinelRef,
|
|
506
|
+
style: {
|
|
507
|
+
position: 'absolute',
|
|
508
|
+
height: 1,
|
|
509
|
+
width: 1
|
|
510
|
+
}
|
|
511
|
+
})), isLoading && renderProps.children && /*#__PURE__*/ (0, ($parcel$interopDefault($fDx7A$react))).createElement((0, ($parcel$interopDefault($fDx7A$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($fDx7A$react))).createElement((0, $048d76b84370f141$exports.dom).div, {
|
|
512
|
+
...(0, $fDx7A$reactariamergeProps.mergeProps)((0, $fDx7A$reactariafilterDOMProps.filterDOMProps)(props, {
|
|
513
|
+
global: true
|
|
514
|
+
}), itemProps),
|
|
515
|
+
...renderProps,
|
|
516
|
+
role: "menuitem",
|
|
517
|
+
ref: ref
|
|
518
|
+
}, renderProps.children)));
|
|
519
|
+
});
|
|
463
520
|
|
|
464
521
|
|
|
465
522
|
//# sourceMappingURL=Menu.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqGM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAAgD;AAChF,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAAyB;AAC9D,MAAM,0DAA8B,CAAA,GAAA,0BAAY,EAA+B;AACtF,MAAM,8DAA0B,CAA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,CAAA,GAAA,qCAAU;gBACV;oBACE,OAAO;wBACL,CAAC,CAAA,GAAA,sCAAW,EAAE,EAAE;wBAChB,OAAO;wBACP,aAAa;oBACf;gBACF;aACD;YACD;gBAAC,CAAA,GAAA,yCAAc;gBAAG;aAAsB;YACxC;gBAAC,CAAA,GAAA,mDAAwB;gBAAG;oBAAC,YAAY,OAAO,UAAU;gBAAA;aAAE;SAC7D;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Menu.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {\n AriaMenuProps,\n useMenu,\n useMenuItem,\n useMenuSection,\n useMenuTrigger,\n useSubmenuTrigger\n} from 'react-aria/useMenu';\nimport {\n BaseCollection,\n CollectionNode,\n ItemNode,\n SectionNode\n} from 'react-aria/private/collections/BaseCollection';\nimport {\n MenuTriggerProps as BaseMenuTriggerProps,\n RootMenuTriggerState,\n useMenuTriggerState,\n useSubmenuTriggerState\n} from 'react-stately/useMenuTriggerState';\nimport {\n ClassNameOrFunction,\n ContextValue,\n DEFAULT_SLOT,\n dom,\n DOMRenderProps,\n PossibleLinkDOMRenderProps,\n Provider,\n RenderProps,\n SlotProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {Collection} from 'react-aria/Collection';\nimport {\n CollectionBuilder,\n createBranchComponent,\n createLeafComponent\n} from 'react-aria/CollectionBuilder';\nimport {\n CollectionProps,\n CollectionRendererContext,\n ItemRenderProps,\n SectionContext,\n SectionProps,\n usePersistedKeys\n} from './Collection';\nimport {\n FieldInputContext,\n SelectableCollectionContext,\n SelectableCollectionContextValue\n} from './Autocomplete';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {\n FocusEvents,\n FocusStrategy,\n forwardRefType,\n GlobalDOMAttributes,\n HoverEvents,\n Key,\n LinkDOMProps,\n MultipleSelection,\n PressEvents\n} from '@react-types/shared';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport {HeaderContext} from './Header';\nimport {KeyboardContext} from './Keyboard';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {MultipleSelectionState} from 'react-stately/useMultipleSelectionState';\nimport {Node} from '@react-types/shared';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext} from './Popover';\nimport {PressResponder} from 'react-aria/private/interactions/PressResponder';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n JSX,\n ReactElement,\n ReactNode,\n RefObject,\n useContext,\n useMemo,\n useRef\n} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SelectionManager} from 'react-stately/private/selection/SelectionManager';\nimport {SeparatorContext} from './Separator';\nimport {SharedElementTransition} from './SharedElementTransition';\nimport {TextContext} from './Text';\nimport {TreeState, useTreeState} from 'react-stately/useTreeState';\nimport {useHover} from 'react-aria/useHover';\nimport {useIsHidden} from 'react-aria/private/collections/Hidden';\nimport {useMultipleSelectionState} from 'react-stately/useMultipleSelectionState';\nimport {useObjectRef} from 'react-aria/useObjectRef';\n\nexport const MenuContext = createContext<ContextValue<MenuProps<any>, HTMLDivElement>>(null);\nexport const MenuStateContext = createContext<TreeState<any> | null>(null);\nexport const RootMenuTriggerStateContext = createContext<RootMenuTriggerState | null>(null);\nconst SelectionManagerContext = createContext<SelectionManager | null>(null);\n\nexport interface MenuTriggerProps extends BaseMenuTriggerProps {\n children: ReactNode;\n}\n\nexport function MenuTrigger(props: MenuTriggerProps): JSX.Element | null {\n let state = useMenuTriggerState(props);\n let ref = useRef<HTMLButtonElement>(null);\n let {menuTriggerProps, menuProps} = useMenuTrigger(\n {\n ...props,\n type: 'menu'\n },\n state,\n ref\n );\n let scrollRef = useRef(null);\n\n // If within a collection (e.g. Tabs), render nothing.\n // Not using createHideableComponent for this because that also creates a forwardRef.\n let isHidden = useIsHidden();\n if (isHidden) {\n return null;\n }\n\n return (\n <Provider\n values={[\n [MenuContext, {...menuProps, ref: scrollRef}],\n [OverlayTriggerStateContext, state],\n [RootMenuTriggerStateContext, state],\n [\n PopoverContext,\n {\n trigger: 'MenuTrigger',\n triggerRef: ref,\n scrollRef,\n placement: 'bottom start',\n 'aria-labelledby': menuProps['aria-labelledby']\n }\n ]\n ]}>\n <PressResponder {...menuTriggerProps} ref={ref} isPressed={state.isOpen}>\n {props.children}\n </PressResponder>\n </Provider>\n );\n}\n\nexport interface SubmenuTriggerProps {\n /**\n * The contents of the SubmenuTrigger. The first child should be an Item (the trigger) and the\n * second child should be the Popover (for the submenu).\n */\n children: ReactElement[];\n /**\n * The delay time in milliseconds for the submenu to appear after hovering over the trigger.\n *\n * @default 200\n */\n delay?: number;\n}\n\nconst SubmenuTriggerContext = createContext<{\n parentMenuRef: RefObject<HTMLElement | null>;\n shouldUseVirtualFocus?: boolean;\n} | null>(null);\n\nclass SubmenuTriggerNode<T> extends CollectionNode<T> {\n static readonly type = 'submenutrigger';\n\n filter(\n collection: BaseCollection<T>,\n newCollection: BaseCollection<T>,\n filterFn: (textValue: string, node: Node<T>) => boolean\n ): CollectionNode<T> | null {\n let triggerNode = collection.getItem(this.firstChildKey!);\n if (triggerNode && filterFn(triggerNode.textValue, this)) {\n let clone = this.clone();\n newCollection.addDescendants(clone, collection);\n return clone;\n }\n\n return null;\n }\n}\n\n/**\n * A submenu trigger is used to wrap a submenu's trigger item and the submenu itself.\n *\n * @version alpha\n */\nexport const SubmenuTrigger = /*#__PURE__*/ createBranchComponent(\n SubmenuTriggerNode,\n (props: SubmenuTriggerProps, ref: ForwardedRef<HTMLDivElement>, item) => {\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let state = useContext(MenuStateContext)!;\n let rootMenuTriggerState = useContext(RootMenuTriggerStateContext)!;\n let submenuTriggerState = useSubmenuTriggerState({triggerKey: item.key}, rootMenuTriggerState);\n let submenuRef = useRef<HTMLDivElement>(null);\n let itemRef = useObjectRef(ref);\n let {parentMenuRef, shouldUseVirtualFocus} = useContext(SubmenuTriggerContext)!;\n let {submenuTriggerProps, submenuProps, popoverProps} = useSubmenuTrigger(\n {\n parentMenuRef,\n submenuRef,\n delay: props.delay,\n shouldUseVirtualFocus\n },\n submenuTriggerState,\n itemRef\n );\n\n return (\n <Provider\n values={[\n [MenuItemContext, {...submenuTriggerProps, onAction: undefined, ref: itemRef}],\n [\n MenuContext,\n {\n ref: submenuRef,\n ...submenuProps\n }\n ],\n [OverlayTriggerStateContext, submenuTriggerState],\n [\n PopoverContext,\n {\n trigger: 'SubmenuTrigger',\n triggerRef: itemRef,\n placement: 'end top',\n 'aria-labelledby': submenuProps['aria-labelledby'],\n ...popoverProps\n }\n ]\n ]}>\n <CollectionBranch collection={state.collection} parent={item} />\n {props.children[1]}\n </Provider>\n );\n },\n props => props.children[0]\n);\n\nexport interface MenuRenderProps {\n /**\n * Whether the menu has no items and should display its empty state.\n *\n * @selector [data-empty]\n */\n isEmpty: boolean;\n}\n\nexport interface MenuProps<T>\n extends\n Omit<AriaMenuProps<T>, 'children'>,\n CollectionProps<T>,\n StyleRenderProps<MenuRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-Menu'\n */\n className?: ClassNameOrFunction<MenuRenderProps>;\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: () => ReactNode;\n /** Whether the menu should close when the menu item is selected. */\n shouldCloseOnSelect?: boolean;\n}\n\n/**\n * A menu displays a list of actions or options that a user can choose.\n */\nexport const Menu = /*#__PURE__*/ (forwardRef as forwardRefType)(function Menu<T>(\n props: MenuProps<T>,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, MenuContext);\n\n // Delay rendering the actual menu until we have the collection so that auto focus works properly.\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <MenuInner props={props} collection={collection} menuRef={ref} />}\n </CollectionBuilder>\n );\n});\n\ninterface MenuInnerProps<T> {\n // For now we append filter and other autocomplete context props here for typescript, but eventually we can consider exposing these\n // as top level props for users to use with standalone Menus\n props: MenuProps<T> & {\n filter?: SelectableCollectionContextValue<object>['filter'];\n shouldUseVirtualFocus?: boolean;\n };\n collection: BaseCollection<any>;\n menuRef: RefObject<HTMLElement | null>;\n}\n\nfunction MenuInner<T>({props, collection, menuRef: ref}: MenuInnerProps<T>) {\n [props, ref] = useContextProps(props, ref, SelectableCollectionContext);\n let {filter, ...autocompleteMenuProps} = props;\n let filteredCollection = useMemo(\n () => (filter ? collection.filter(filter) : collection),\n [collection, filter]\n );\n let state = useTreeState({\n ...props,\n collection: filteredCollection,\n children: undefined\n });\n let triggerState = useContext(RootMenuTriggerStateContext);\n let {isVirtualized, CollectionRoot} = useContext(CollectionRendererContext);\n let {menuProps} = useMenu(\n {...props, isVirtualized, onClose: props.onClose || triggerState?.close},\n state,\n ref\n );\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-Menu',\n values: {\n isEmpty: state.collection.size === 0\n }\n });\n\n let emptyState: ReactElement | null = null;\n if (state.collection.size === 0 && props.renderEmptyState) {\n emptyState = (\n <div role=\"menuitem\" style={{display: 'contents'}}>\n {props.renderEmptyState()}\n </div>\n );\n }\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <FocusScope>\n <dom.div\n {...mergeProps(DOMProps, renderProps, menuProps)}\n ref={ref as RefObject<HTMLDivElement>}\n slot={props.slot || undefined}\n data-empty={state.collection.size === 0 || undefined}\n onScroll={props.onScroll}>\n <Provider\n values={[\n [MenuStateContext, state],\n [SeparatorContext, {elementType: 'div'}],\n [SectionContext, {name: 'MenuSection', render: MenuSectionInner}],\n [\n SubmenuTriggerContext,\n {\n parentMenuRef: ref,\n shouldUseVirtualFocus: autocompleteMenuProps?.shouldUseVirtualFocus\n }\n ],\n [MenuItemContext, {shouldCloseOnSelect: props.shouldCloseOnSelect}],\n [SelectableCollectionContext, null],\n [FieldInputContext, null],\n [SelectionManagerContext, state.selectionManager],\n /* Ensure root MenuTriggerState is defined, in case Menu is rendered outside a MenuTrigger. */\n /* We assume the context can never change between defined and undefined. */\n /* eslint-disable-next-line react-hooks/rules-of-hooks */\n [RootMenuTriggerStateContext, triggerState ?? useMenuTriggerState({})]\n ]}>\n <SharedElementTransition>\n <CollectionRoot\n collection={state.collection}\n persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)}\n scrollRef={ref}\n />\n </SharedElementTransition>\n </Provider>\n {emptyState}\n </dom.div>\n </FocusScope>\n );\n}\n\nexport interface MenuSectionProps<T>\n extends\n SectionProps<T>,\n Omit<MultipleSelection, 'disabledKeys'>,\n DOMRenderProps<'section', undefined> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element.\n *\n * @default 'react-aria-MenuSection'\n */\n className?: string;\n /** Whether the menu should close when the menu item is selected. */\n shouldCloseOnSelect?: boolean;\n}\n\n// A subclass of SelectionManager that forwards focus-related properties to the parent,\n// but has its own local selection state.\nclass GroupSelectionManager extends SelectionManager {\n private parent: SelectionManager;\n\n constructor(parent: SelectionManager, state: MultipleSelectionState) {\n super(parent.collection, state);\n this.parent = parent;\n }\n\n get focusedKey() {\n return this.parent.focusedKey;\n }\n\n get isFocused() {\n return this.parent.isFocused;\n }\n\n setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy): void {\n return this.parent.setFocusedKey(key, childFocusStrategy);\n }\n\n setFocused(isFocused: boolean): void {\n this.parent.setFocused(isFocused);\n }\n\n get childFocusStrategy() {\n return this.parent.childFocusStrategy;\n }\n}\n\nfunction MenuSectionInner<T>(\n props: MenuSectionProps<T>,\n ref: ForwardedRef<HTMLElement>,\n section: Node<T>,\n className = 'react-aria-MenuSection'\n) {\n let state = useContext(MenuStateContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useMenuSection({\n heading,\n 'aria-label': section.props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: undefined,\n defaultClassName: className,\n className: section.props?.className,\n style: section.props?.style,\n values: undefined\n });\n\n let parent = useContext(SelectionManagerContext)!;\n let selectionState = useMultipleSelectionState(props);\n let manager =\n props.selectionMode != null ? new GroupSelectionManager(parent, selectionState) : parent;\n\n let closeOnSelect = useSlottedContext(MenuItemContext)?.shouldCloseOnSelect;\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n\n return (\n <dom.section {...mergeProps(DOMProps, renderProps, groupProps)} ref={ref}>\n <Provider\n values={[\n [HeaderContext, {...headingProps, ref: headingRef}],\n [SelectionManagerContext, manager],\n [MenuItemContext, {shouldCloseOnSelect: props.shouldCloseOnSelect ?? closeOnSelect}]\n ]}>\n <CollectionBranch collection={state.collection} parent={section} />\n </Provider>\n </dom.section>\n );\n}\n\n/**\n * A MenuSection represents a section within a Menu.\n */\nexport const MenuSection = /*#__PURE__*/ createBranchComponent(SectionNode, MenuSectionInner);\n\nexport interface MenuItemRenderProps extends ItemRenderProps {\n /**\n * Whether the item has a submenu.\n *\n * @selector [data-has-submenu]\n */\n hasSubmenu: boolean;\n /**\n * Whether the item's submenu is open.\n *\n * @selector [data-open]\n */\n isOpen: boolean;\n}\n\nexport interface MenuItemProps<T = object>\n extends\n Omit<RenderProps<MenuItemRenderProps>, 'render'>,\n PossibleLinkDOMRenderProps<'div', MenuItemRenderProps>,\n LinkDOMProps,\n HoverEvents,\n FocusEvents,\n PressEvents,\n Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-MenuItem'\n */\n className?: ClassNameOrFunction<MenuItemRenderProps>;\n /** The unique id of the item. */\n id?: Key;\n /**\n * The object value that this item represents. When using dynamic collections, this is set\n * automatically.\n */\n value?: T;\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string;\n /** An accessibility label for this item. */\n 'aria-label'?: string;\n /** Whether the item is disabled. */\n isDisabled?: boolean;\n /** Handler that is called when the item is selected. */\n onAction?: () => void;\n /** Whether the menu should close when the menu item is selected. */\n shouldCloseOnSelect?: boolean;\n}\n\nconst MenuItemContext = createContext<ContextValue<MenuItemProps, HTMLDivElement>>(null);\n\n/**\n * A MenuItem represents an individual action in a Menu.\n */\nexport const MenuItem = /*#__PURE__*/ createLeafComponent(ItemNode, function MenuItem<\n T\n>(props: MenuItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n [props, forwardedRef] = useContextProps(props, forwardedRef, MenuItemContext);\n let id = useSlottedContext(MenuItemContext)?.id as string;\n let state = useContext(MenuStateContext)!;\n let ref = useObjectRef<any>(forwardedRef);\n let selectionManager = useContext(SelectionManagerContext)!;\n let {isVirtualized} = useContext(CollectionRendererContext);\n let {menuItemProps, labelProps, descriptionProps, keyboardShortcutProps, ...states} = useMenuItem(\n {\n ...props,\n id,\n key: item.key,\n selectionManager,\n isVirtualized: isVirtualized\n },\n state,\n ref\n );\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: states.isDisabled\n });\n let renderProps = useRenderProps<MenuItemRenderProps, any>({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-MenuItem',\n values: {\n ...states,\n isHovered,\n isFocusVisible: states.isFocusVisible,\n selectionMode: selectionManager.selectionMode,\n selectionBehavior: selectionManager.selectionBehavior,\n hasSubmenu: !!props['aria-haspopup'],\n isOpen: props['aria-expanded'] === 'true'\n }\n });\n\n let ElementType = props.href ? dom.a : dom.div;\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <ElementType\n {...mergeProps(DOMProps, renderProps, menuItemProps, hoverProps)}\n ref={ref}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={states.isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-selected={states.isSelected || undefined}\n data-selection-mode={\n selectionManager.selectionMode === 'none' ? undefined : selectionManager.selectionMode\n }\n data-has-submenu={!!props['aria-haspopup'] || undefined}\n data-open={props['aria-expanded'] === 'true' || undefined}>\n <Provider\n values={[\n [\n TextContext,\n {\n slots: {\n [DEFAULT_SLOT]: labelProps,\n label: labelProps,\n description: descriptionProps\n }\n }\n ],\n [KeyboardContext, keyboardShortcutProps],\n [SelectionIndicatorContext, {isSelected: states.isSelected}]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n"],"names":[],"version":3,"file":"Menu.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4GM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAAgD;AAChF,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAAyB;AAC9D,MAAM,0DAA8B,CAAA,GAAA,0BAAY,EAA+B;AACtF,MAAM,8DAA0B,CAAA,GAAA,0BAAY,EAA2B;AAMhE,SAAS,0CAAY,KAAuB;IACjD,IAAI,QAAQ,CAAA,GAAA,0DAAkB,EAAE;IAChC,IAAI,MAAM,CAAA,GAAA,mBAAK,EAAqB;IACpC,IAAI,oBAAC,gBAAgB,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,sCAAa,EAC/C;QACE,GAAG,KAAK;QACR,MAAM;IACR,GACA,OACA;IAE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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 {\n AriaMenuProps,\n useMenu,\n useMenuItem,\n useMenuSection,\n useMenuTrigger,\n useSubmenuTrigger\n} from 'react-aria/useMenu';\nimport {\n BaseCollection,\n CollectionNode,\n ItemNode,\n LoaderNode,\n SectionNode\n} from 'react-aria/private/collections/BaseCollection';\nimport {\n MenuTriggerProps as BaseMenuTriggerProps,\n RootMenuTriggerState,\n useMenuTriggerState,\n useSubmenuTriggerState\n} from 'react-stately/useMenuTriggerState';\nimport {\n ClassNameOrFunction,\n ContextValue,\n DEFAULT_SLOT,\n dom,\n DOMRenderProps,\n PossibleLinkDOMRenderProps,\n Provider,\n RenderProps,\n SlotProps,\n StyleProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {Collection} from 'react-aria/Collection';\nimport {\n CollectionBuilder,\n createBranchComponent,\n createLeafComponent\n} from 'react-aria/CollectionBuilder';\nimport {\n CollectionProps,\n CollectionRendererContext,\n ItemRenderProps,\n SectionContext,\n SectionProps,\n usePersistedKeys\n} from './Collection';\nimport {\n FieldInputContext,\n SelectableCollectionContext,\n SelectableCollectionContextValue\n} from './Autocomplete';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {\n FocusEvents,\n FocusStrategy,\n forwardRefType,\n GlobalDOMAttributes,\n HoverEvents,\n Key,\n LinkDOMProps,\n MultipleSelection,\n PressEvents\n} from '@react-types/shared';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport {HeaderContext} from './Header';\nimport {inertValue} from 'react-aria/private/utils/inertValue';\nimport {KeyboardContext} from './Keyboard';\nimport {\n LoadMoreSentinelProps,\n useLoadMoreSentinel\n} from 'react-aria/private/utils/useLoadMoreSentinel';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {MultipleSelectionState} from 'react-stately/useMultipleSelectionState';\nimport {Node} from '@react-types/shared';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext} from './Popover';\nimport {PressResponder} from 'react-aria/private/interactions/PressResponder';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n JSX,\n ReactElement,\n ReactNode,\n RefObject,\n useContext,\n useMemo,\n useRef\n} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SelectionManager} from 'react-stately/private/selection/SelectionManager';\nimport {SeparatorContext} from './Separator';\nimport {SharedElementTransition} from './SharedElementTransition';\nimport {TextContext} from './Text';\nimport {TreeState, useTreeState} from 'react-stately/useTreeState';\nimport {useHover} from 'react-aria/useHover';\nimport {useIsHidden} from 'react-aria/private/collections/Hidden';\nimport {useMultipleSelectionState} from 'react-stately/useMultipleSelectionState';\nimport {useObjectRef} from 'react-aria/useObjectRef';\n\nexport const MenuContext = createContext<ContextValue<MenuProps<any>, HTMLDivElement>>(null);\nexport const MenuStateContext = createContext<TreeState<any> | null>(null);\nexport const RootMenuTriggerStateContext = createContext<RootMenuTriggerState | null>(null);\nconst SelectionManagerContext = createContext<SelectionManager | null>(null);\n\nexport interface MenuTriggerProps extends BaseMenuTriggerProps {\n children: ReactNode;\n}\n\nexport function MenuTrigger(props: MenuTriggerProps): JSX.Element | null {\n let state = useMenuTriggerState(props);\n let ref = useRef<HTMLButtonElement>(null);\n let {menuTriggerProps, menuProps} = useMenuTrigger(\n {\n ...props,\n type: 'menu'\n },\n state,\n ref\n );\n let scrollRef = useRef(null);\n\n // If within a collection (e.g. Tabs), render nothing.\n // Not using createHideableComponent for this because that also creates a forwardRef.\n let isHidden = useIsHidden();\n if (isHidden) {\n return null;\n }\n\n return (\n <Provider\n values={[\n [MenuContext, {...menuProps, ref: scrollRef}],\n [OverlayTriggerStateContext, state],\n [RootMenuTriggerStateContext, state],\n [\n PopoverContext,\n {\n trigger: 'MenuTrigger',\n triggerRef: ref,\n scrollRef,\n placement: 'bottom start',\n 'aria-labelledby': menuProps['aria-labelledby'],\n offset: props.trigger === 'contextMenu' ? 0 : undefined\n }\n ]\n ]}>\n <PressResponder {...menuTriggerProps} ref={ref} isPressed={state.isOpen}>\n {props.children}\n </PressResponder>\n </Provider>\n );\n}\n\nexport interface SubmenuTriggerProps {\n /**\n * The contents of the SubmenuTrigger. The first child should be an Item (the trigger) and the\n * second child should be the Popover (for the submenu).\n */\n children: ReactElement[];\n /**\n * The delay time in milliseconds for the submenu to appear after hovering over the trigger.\n *\n * @default 200\n */\n delay?: number;\n}\n\nconst SubmenuTriggerContext = createContext<{\n parentMenuRef: RefObject<HTMLElement | null>;\n shouldUseVirtualFocus?: boolean;\n} | null>(null);\n\nclass SubmenuTriggerNode<T> extends CollectionNode<T> {\n static readonly type = 'submenutrigger';\n\n filter(\n collection: BaseCollection<T>,\n newCollection: BaseCollection<T>,\n filterFn: (textValue: string, node: Node<T>) => boolean\n ): CollectionNode<T> | null {\n let triggerNode = collection.getItem(this.firstChildKey!);\n if (triggerNode && filterFn(triggerNode.textValue, this)) {\n let clone = this.clone();\n newCollection.addDescendants(clone, collection);\n return clone;\n }\n\n return null;\n }\n}\n\n/**\n * A submenu trigger is used to wrap a submenu's trigger item and the submenu itself.\n *\n * @version alpha\n */\nexport const SubmenuTrigger = /*#__PURE__*/ createBranchComponent(\n SubmenuTriggerNode,\n (props: SubmenuTriggerProps, ref: ForwardedRef<HTMLDivElement>, item) => {\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let state = useContext(MenuStateContext)!;\n let rootMenuTriggerState = useContext(RootMenuTriggerStateContext)!;\n let submenuTriggerState = useSubmenuTriggerState({triggerKey: item.key}, rootMenuTriggerState);\n let submenuRef = useRef<HTMLDivElement>(null);\n let itemRef = useObjectRef(ref);\n let {parentMenuRef, shouldUseVirtualFocus} = useContext(SubmenuTriggerContext)!;\n let {submenuTriggerProps, submenuProps, popoverProps} = useSubmenuTrigger(\n {\n parentMenuRef,\n submenuRef,\n delay: props.delay,\n shouldUseVirtualFocus\n },\n submenuTriggerState,\n itemRef\n );\n\n return (\n <Provider\n values={[\n [MenuItemContext, {...submenuTriggerProps, onAction: undefined, ref: itemRef}],\n [\n MenuContext,\n {\n ref: submenuRef,\n ...submenuProps\n }\n ],\n [OverlayTriggerStateContext, submenuTriggerState],\n [\n PopoverContext,\n {\n trigger: 'SubmenuTrigger',\n triggerRef: itemRef,\n placement: 'end top',\n 'aria-labelledby': submenuProps['aria-labelledby'],\n ...popoverProps\n }\n ]\n ]}>\n <CollectionBranch collection={state.collection} parent={item} />\n {props.children[1]}\n </Provider>\n );\n },\n props => props.children[0]\n);\n\nexport interface MenuRenderProps {\n /**\n * Whether the menu has no items and should display its empty state.\n *\n * @selector [data-empty]\n */\n isEmpty: boolean;\n}\n\nexport interface MenuProps<T>\n extends\n Omit<AriaMenuProps<T>, 'children'>,\n CollectionProps<T>,\n StyleRenderProps<MenuRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-Menu'\n */\n className?: ClassNameOrFunction<MenuRenderProps>;\n /** Provides content to display when there are no items in the menu. */\n renderEmptyState?: () => ReactNode;\n /** Whether the menu should close when the menu item is selected. */\n shouldCloseOnSelect?: boolean;\n}\n\n/**\n * A menu displays a list of actions or options that a user can choose.\n */\nexport const Menu = /*#__PURE__*/ (forwardRef as forwardRefType)(function Menu<T>(\n props: MenuProps<T>,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, MenuContext);\n\n // Delay rendering the actual menu until we have the collection so that auto focus works properly.\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <MenuInner props={props} collection={collection} menuRef={ref} />}\n </CollectionBuilder>\n );\n});\n\ninterface MenuInnerProps<T> {\n // For now we append filter and other autocomplete context props here for typescript, but eventually we can consider exposing these\n // as top level props for users to use with standalone Menus\n props: MenuProps<T> & {\n filter?: SelectableCollectionContextValue<object>['filter'];\n shouldUseVirtualFocus?: boolean;\n };\n collection: BaseCollection<any>;\n menuRef: RefObject<HTMLElement | null>;\n}\n\nfunction MenuInner<T>({props, collection, menuRef: ref}: MenuInnerProps<T>) {\n [props, ref] = useContextProps(props, ref, SelectableCollectionContext);\n let {filter, ...autocompleteMenuProps} = props;\n let filteredCollection = useMemo(\n () => (filter ? collection.filter(filter) : collection),\n [collection, filter]\n );\n let state = useTreeState({\n ...props,\n collection: filteredCollection,\n children: undefined\n });\n let triggerState = useContext(RootMenuTriggerStateContext);\n let {isVirtualized, CollectionRoot} = useContext(CollectionRendererContext);\n let {menuProps} = useMenu(\n {...props, isVirtualized, onClose: props.onClose || triggerState?.close},\n state,\n ref\n );\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-Menu',\n values: {\n isEmpty: state.collection.size === 0\n }\n });\n\n let emptyState: ReactElement | null = null;\n if (state.collection.size === 0 && props.renderEmptyState) {\n emptyState = (\n <div role=\"menuitem\" style={{display: 'contents'}}>\n {props.renderEmptyState()}\n </div>\n );\n }\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <FocusScope>\n <dom.div\n {...mergeProps(DOMProps, renderProps, menuProps)}\n ref={ref as RefObject<HTMLDivElement>}\n slot={props.slot || undefined}\n data-empty={state.collection.size === 0 || undefined}\n onScroll={props.onScroll}>\n <Provider\n values={[\n [MenuStateContext, state],\n [SeparatorContext, {elementType: 'div'}],\n [SectionContext, {name: 'MenuSection', render: MenuSectionInner}],\n [\n SubmenuTriggerContext,\n {\n parentMenuRef: ref,\n shouldUseVirtualFocus: autocompleteMenuProps?.shouldUseVirtualFocus\n }\n ],\n [MenuItemContext, {shouldCloseOnSelect: props.shouldCloseOnSelect}],\n [SelectableCollectionContext, null],\n [FieldInputContext, null],\n [SelectionManagerContext, state.selectionManager],\n /* Ensure root MenuTriggerState is defined, in case Menu is rendered outside a MenuTrigger. */\n /* We assume the context can never change between defined and undefined. */\n // oxlint-disable-next-line react/react-compiler, react-hooks/rules-of-hooks\n [RootMenuTriggerStateContext, triggerState ?? useMenuTriggerState({})]\n ]}>\n <SharedElementTransition>\n <CollectionRoot\n collection={state.collection}\n persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)}\n scrollRef={ref}\n />\n </SharedElementTransition>\n </Provider>\n {emptyState}\n </dom.div>\n </FocusScope>\n );\n}\n\nexport interface MenuSectionProps<T>\n extends\n SectionProps<T>,\n Omit<MultipleSelection, 'disabledKeys'>,\n DOMRenderProps<'section', undefined> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element.\n *\n * @default 'react-aria-MenuSection'\n */\n className?: string;\n /** Whether the menu should close when the menu item is selected. */\n shouldCloseOnSelect?: boolean;\n}\n\n// A subclass of SelectionManager that forwards focus-related properties to the parent,\n// but has its own local selection state.\nclass GroupSelectionManager extends SelectionManager {\n private parent: SelectionManager;\n\n constructor(parent: SelectionManager, state: MultipleSelectionState) {\n super(parent.collection, state);\n this.parent = parent;\n }\n\n get focusedKey() {\n return this.parent.focusedKey;\n }\n\n get isFocused() {\n return this.parent.isFocused;\n }\n\n setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy): void {\n return this.parent.setFocusedKey(key, childFocusStrategy);\n }\n\n setFocused(isFocused: boolean): void {\n this.parent.setFocused(isFocused);\n }\n\n get childFocusStrategy() {\n return this.parent.childFocusStrategy;\n }\n}\n\nfunction MenuSectionInner<T>(\n props: MenuSectionProps<T>,\n ref: ForwardedRef<HTMLElement>,\n section: Node<T>,\n className = 'react-aria-MenuSection'\n) {\n let state = useContext(MenuStateContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useMenuSection({\n heading,\n 'aria-label': section.props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: undefined,\n defaultClassName: className,\n className: section.props?.className,\n style: section.props?.style,\n values: undefined\n });\n\n let parent = useContext(SelectionManagerContext)!;\n let selectionState = useMultipleSelectionState(props);\n let manager =\n props.selectionMode != null ? new GroupSelectionManager(parent, selectionState) : parent;\n\n let closeOnSelect = useSlottedContext(MenuItemContext)?.shouldCloseOnSelect;\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n\n return (\n <dom.section {...mergeProps(DOMProps, renderProps, groupProps)} ref={ref}>\n <Provider\n values={[\n [HeaderContext, {...headingProps, ref: headingRef}],\n [SelectionManagerContext, manager],\n [MenuItemContext, {shouldCloseOnSelect: props.shouldCloseOnSelect ?? closeOnSelect}]\n ]}>\n <CollectionBranch collection={state.collection} parent={section} />\n </Provider>\n </dom.section>\n );\n}\n\n/**\n * A MenuSection represents a section within a Menu.\n */\nexport const MenuSection = /*#__PURE__*/ createBranchComponent(SectionNode, MenuSectionInner);\n\nexport interface MenuItemRenderProps extends ItemRenderProps {\n /**\n * Whether the item has a submenu.\n *\n * @selector [data-has-submenu]\n */\n hasSubmenu: boolean;\n /**\n * Whether the item's submenu is open.\n *\n * @selector [data-open]\n */\n isOpen: boolean;\n}\n\nexport interface MenuItemProps<T = object>\n extends\n Omit<RenderProps<MenuItemRenderProps>, 'render'>,\n PossibleLinkDOMRenderProps<'div', MenuItemRenderProps>,\n LinkDOMProps,\n HoverEvents,\n FocusEvents,\n PressEvents,\n Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-MenuItem'\n */\n className?: ClassNameOrFunction<MenuItemRenderProps>;\n /** The unique id of the item. */\n id?: Key;\n /**\n * The object value that this item represents. When using dynamic collections, this is set\n * automatically.\n */\n value?: T;\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string;\n /** An accessibility label for this item. */\n 'aria-label'?: string;\n /** Whether the item is disabled. */\n isDisabled?: boolean;\n /** Handler that is called when the item is selected. */\n onAction?: () => void;\n /** Whether the menu should close when the menu item is selected. */\n shouldCloseOnSelect?: boolean;\n}\n\nconst MenuItemContext = createContext<ContextValue<MenuItemProps, HTMLDivElement>>(null);\n\n/**\n * A MenuItem represents an individual action in a Menu.\n */\nexport const MenuItem = /*#__PURE__*/ createLeafComponent(ItemNode, function MenuItem<\n T\n>(props: MenuItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n [props, forwardedRef] = useContextProps(props, forwardedRef, MenuItemContext);\n let id = useSlottedContext(MenuItemContext)?.id as string;\n let state = useContext(MenuStateContext)!;\n let ref = useObjectRef<any>(forwardedRef);\n let selectionManager = useContext(SelectionManagerContext)!;\n let {isVirtualized} = useContext(CollectionRendererContext);\n let {menuItemProps, labelProps, descriptionProps, keyboardShortcutProps, ...states} = useMenuItem(\n {\n ...props,\n id,\n key: item.key,\n selectionManager,\n isVirtualized: isVirtualized\n },\n state,\n ref\n );\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: states.isDisabled\n });\n let renderProps = useRenderProps<MenuItemRenderProps, any>({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-MenuItem',\n values: {\n ...states,\n isHovered,\n isFocusVisible: states.isFocusVisible,\n selectionMode: selectionManager.selectionMode,\n selectionBehavior: selectionManager.selectionBehavior,\n hasSubmenu: !!props['aria-haspopup'],\n isOpen: props['aria-expanded'] === 'true'\n }\n });\n\n let ElementType = props.href ? dom.a : dom.div;\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <ElementType\n {...mergeProps(DOMProps, renderProps, menuItemProps, hoverProps)}\n ref={ref}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={states.isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-selected={states.isSelected || undefined}\n data-selection-mode={\n selectionManager.selectionMode === 'none' ? undefined : selectionManager.selectionMode\n }\n data-has-submenu={!!props['aria-haspopup'] || undefined}\n data-open={props['aria-expanded'] === 'true' || undefined}>\n <Provider\n values={[\n [\n TextContext,\n {\n slots: {\n [DEFAULT_SLOT]: labelProps,\n label: labelProps,\n description: descriptionProps\n }\n }\n ],\n [KeyboardContext, keyboardShortcutProps],\n [SelectionIndicatorContext, {isSelected: states.isSelected}]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n\nexport interface MenuLoadMoreItemProps\n extends\n Omit<LoadMoreSentinelProps, 'collection' | 'direction'>,\n StyleProps,\n DOMRenderProps<'div', undefined>,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element.\n *\n * @default 'react-aria-MenuLoadingIndicator'\n */\n className?: string;\n /**\n * The load more spinner to render when loading additional items.\n */\n children?: ReactNode;\n /**\n * Whether or not the loading spinner should be rendered or not.\n */\n isLoading?: boolean;\n}\n\nexport const MenuLoadMoreItem = createLeafComponent(\n LoaderNode,\n function MenuLoadingIndicator(\n props: MenuLoadMoreItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n item: Node<object>\n ) {\n let state = useContext(MenuStateContext)!;\n let {isLoading, onLoadMore, scrollOffset, ...otherProps} = props;\n\n let sentinelRef = useRef<HTMLDivElement>(null);\n let memoedLoadMoreProps = useMemo(\n () => ({\n onLoadMore,\n collection: state?.collection,\n sentinelRef,\n scrollOffset\n }),\n [onLoadMore, scrollOffset, state?.collection]\n );\n useLoadMoreSentinel(memoedLoadMoreProps, sentinelRef);\n let renderProps = useRenderProps({\n ...otherProps,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-MenuLoadingIndicator',\n values: undefined\n });\n\n let itemProps = {\n // For Android talkback\n tabIndex: -1\n };\n\n return (\n <>\n {/* Always render the sentinel. For now onus is on the user for styling when using flex + gap (this would introduce a gap even though it doesn't take room) */}\n {/* @ts-ignore - compatibility with React < 19 */}\n <div style={{position: 'relative', width: 0, height: 0}} inert={inertValue(true)}>\n <div\n data-testid=\"loadMoreSentinel\"\n ref={sentinelRef}\n style={{position: 'absolute', height: 1, width: 1}}\n />\n </div>\n {isLoading && renderProps.children && (\n <>\n {/* oxlint-disable jsx-a11y/role-has-required-aria-props -- loader row is not selectable */}\n <dom.div\n {...mergeProps(filterDOMProps(props, {global: true}), itemProps)}\n {...renderProps}\n role=\"menuitem\"\n ref={ref as ForwardedRef<HTMLDivElement>}>\n {renderProps.children}\n </dom.div>\n {/* oxlint-enable jsx-a11y/role-has-required-aria-props */}\n </>\n )}\n </>\n );\n }\n);\n"],"names":[],"version":3,"file":"Menu.cjs.map"}
|
package/dist/private/Menu.js
CHANGED
|
@@ -10,12 +10,14 @@ import {SeparatorContext as $469f9b725520971a$export$6615d83f6de245ce} from "./S
|
|
|
10
10
|
import {SharedElementTransition as $347bc273c4058e94$export$758399f318e6385a} from "./SharedElementTransition.js";
|
|
11
11
|
import {TextContext as $20d769b1e2b13352$export$9afb8bc826b033ea} from "./Text.js";
|
|
12
12
|
import {useMenuTrigger as $gKmcL$useMenuTrigger, useSubmenuTrigger as $gKmcL$useSubmenuTrigger, useMenu as $gKmcL$useMenu, useMenuSection as $gKmcL$useMenuSection, useMenuItem as $gKmcL$useMenuItem} from "react-aria/useMenu";
|
|
13
|
-
import {CollectionNode as $gKmcL$CollectionNode, SectionNode as $gKmcL$SectionNode, ItemNode as $gKmcL$ItemNode} from "react-aria/private/collections/BaseCollection";
|
|
13
|
+
import {CollectionNode as $gKmcL$CollectionNode, SectionNode as $gKmcL$SectionNode, ItemNode as $gKmcL$ItemNode, LoaderNode as $gKmcL$LoaderNode} from "react-aria/private/collections/BaseCollection";
|
|
14
14
|
import {useMenuTriggerState as $gKmcL$useMenuTriggerState, useSubmenuTriggerState as $gKmcL$useSubmenuTriggerState} from "react-stately/useMenuTriggerState";
|
|
15
15
|
import {Collection as $gKmcL$Collection} from "react-aria/Collection";
|
|
16
16
|
import {createBranchComponent as $gKmcL$createBranchComponent, CollectionBuilder as $gKmcL$CollectionBuilder, createLeafComponent as $gKmcL$createLeafComponent} from "react-aria/CollectionBuilder";
|
|
17
17
|
import {filterDOMProps as $gKmcL$filterDOMProps} from "react-aria/filterDOMProps";
|
|
18
18
|
import {FocusScope as $gKmcL$FocusScope} from "react-aria/FocusScope";
|
|
19
|
+
import {inertValue as $gKmcL$inertValue} from "react-aria/private/utils/inertValue";
|
|
20
|
+
import {useLoadMoreSentinel as $gKmcL$useLoadMoreSentinel} from "react-aria/private/utils/useLoadMoreSentinel";
|
|
19
21
|
import {mergeProps as $gKmcL$mergeProps} from "react-aria/mergeProps";
|
|
20
22
|
import {PressResponder as $gKmcL$PressResponder} from "react-aria/private/interactions/PressResponder";
|
|
21
23
|
import $gKmcL$react, {createContext as $gKmcL$createContext, useRef as $gKmcL$useRef, useContext as $gKmcL$useContext, forwardRef as $gKmcL$forwardRef, useMemo as $gKmcL$useMemo} from "react";
|
|
@@ -60,6 +62,8 @@ import {useObjectRef as $gKmcL$useObjectRef} from "react-aria/useObjectRef";
|
|
|
60
62
|
|
|
61
63
|
|
|
62
64
|
|
|
65
|
+
|
|
66
|
+
|
|
63
67
|
|
|
64
68
|
|
|
65
69
|
|
|
@@ -103,7 +107,8 @@ function $113aa0613e727c6c$export$27d2ad3c5815583e(props) {
|
|
|
103
107
|
triggerRef: ref,
|
|
104
108
|
scrollRef: scrollRef,
|
|
105
109
|
placement: 'bottom start',
|
|
106
|
-
'aria-labelledby': menuProps['aria-labelledby']
|
|
110
|
+
'aria-labelledby': menuProps['aria-labelledby'],
|
|
111
|
+
offset: props.trigger === 'contextMenu' ? 0 : undefined
|
|
107
112
|
}
|
|
108
113
|
]
|
|
109
114
|
]
|
|
@@ -277,7 +282,8 @@ function $113aa0613e727c6c$var$MenuInner({ props: props, collection: collection,
|
|
|
277
282
|
$113aa0613e727c6c$var$SelectionManagerContext,
|
|
278
283
|
state.selectionManager
|
|
279
284
|
],
|
|
280
|
-
/* Ensure root MenuTriggerState is defined, in case Menu is rendered outside a MenuTrigger. */ /* We assume the context can never change between defined and undefined. */
|
|
285
|
+
/* Ensure root MenuTriggerState is defined, in case Menu is rendered outside a MenuTrigger. */ /* We assume the context can never change between defined and undefined. */ // oxlint-disable-next-line react/react-compiler, react-hooks/rules-of-hooks
|
|
286
|
+
[
|
|
281
287
|
$113aa0613e727c6c$export$795aec4671cbae19,
|
|
282
288
|
triggerState !== null && triggerState !== void 0 ? triggerState : (0, $gKmcL$useMenuTriggerState)({})
|
|
283
289
|
]
|
|
@@ -445,7 +451,57 @@ const $113aa0613e727c6c$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $gKmcL$creat
|
|
|
445
451
|
]
|
|
446
452
|
}, renderProps.children));
|
|
447
453
|
});
|
|
454
|
+
const $113aa0613e727c6c$export$93aba29d3a678058 = (0, $gKmcL$createLeafComponent)((0, $gKmcL$LoaderNode), function MenuLoadingIndicator(props, ref, item) {
|
|
455
|
+
let state = (0, $gKmcL$useContext)($113aa0613e727c6c$export$24aad8519b95b41b);
|
|
456
|
+
let { isLoading: isLoading, onLoadMore: onLoadMore, scrollOffset: scrollOffset, ...otherProps } = props;
|
|
457
|
+
let sentinelRef = (0, $gKmcL$useRef)(null);
|
|
458
|
+
let memoedLoadMoreProps = (0, $gKmcL$useMemo)(()=>({
|
|
459
|
+
onLoadMore: onLoadMore,
|
|
460
|
+
collection: state === null || state === void 0 ? void 0 : state.collection,
|
|
461
|
+
sentinelRef: sentinelRef,
|
|
462
|
+
scrollOffset: scrollOffset
|
|
463
|
+
}), [
|
|
464
|
+
onLoadMore,
|
|
465
|
+
scrollOffset,
|
|
466
|
+
state === null || state === void 0 ? void 0 : state.collection
|
|
467
|
+
]);
|
|
468
|
+
(0, $gKmcL$useLoadMoreSentinel)(memoedLoadMoreProps, sentinelRef);
|
|
469
|
+
let renderProps = (0, $b7b7a92703138c9b$export$4d86445c2cf5e3)({
|
|
470
|
+
...otherProps,
|
|
471
|
+
id: undefined,
|
|
472
|
+
children: item.rendered,
|
|
473
|
+
defaultClassName: 'react-aria-MenuLoadingIndicator',
|
|
474
|
+
values: undefined
|
|
475
|
+
});
|
|
476
|
+
let itemProps = {
|
|
477
|
+
// For Android talkback
|
|
478
|
+
tabIndex: -1
|
|
479
|
+
};
|
|
480
|
+
return /*#__PURE__*/ (0, $gKmcL$react).createElement((0, $gKmcL$react).Fragment, null, /*#__PURE__*/ (0, $gKmcL$react).createElement("div", {
|
|
481
|
+
style: {
|
|
482
|
+
position: 'relative',
|
|
483
|
+
width: 0,
|
|
484
|
+
height: 0
|
|
485
|
+
},
|
|
486
|
+
inert: (0, $gKmcL$inertValue)(true)
|
|
487
|
+
}, /*#__PURE__*/ (0, $gKmcL$react).createElement("div", {
|
|
488
|
+
"data-testid": "loadMoreSentinel",
|
|
489
|
+
ref: sentinelRef,
|
|
490
|
+
style: {
|
|
491
|
+
position: 'absolute',
|
|
492
|
+
height: 1,
|
|
493
|
+
width: 1
|
|
494
|
+
}
|
|
495
|
+
})), isLoading && renderProps.children && /*#__PURE__*/ (0, $gKmcL$react).createElement((0, $gKmcL$react).Fragment, null, /*#__PURE__*/ (0, $gKmcL$react).createElement((0, $b7b7a92703138c9b$export$df3a06d6289f983e).div, {
|
|
496
|
+
...(0, $gKmcL$mergeProps)((0, $gKmcL$filterDOMProps)(props, {
|
|
497
|
+
global: true
|
|
498
|
+
}), itemProps),
|
|
499
|
+
...renderProps,
|
|
500
|
+
role: "menuitem",
|
|
501
|
+
ref: ref
|
|
502
|
+
}, renderProps.children)));
|
|
503
|
+
});
|
|
448
504
|
|
|
449
505
|
|
|
450
|
-
export {$113aa0613e727c6c$export$c7e742effb1c51e2 as MenuContext, $113aa0613e727c6c$export$24aad8519b95b41b as MenuStateContext, $113aa0613e727c6c$export$795aec4671cbae19 as RootMenuTriggerStateContext, $113aa0613e727c6c$export$27d2ad3c5815583e as MenuTrigger, $113aa0613e727c6c$export$ecabc99eeffab7ca as SubmenuTrigger, $113aa0613e727c6c$export$d9b273488cd8ce6f as Menu, $113aa0613e727c6c$export$4b1545b4f2016d26 as MenuSection, $113aa0613e727c6c$export$2ce376c2cc3355c8 as MenuItem};
|
|
506
|
+
export {$113aa0613e727c6c$export$c7e742effb1c51e2 as MenuContext, $113aa0613e727c6c$export$24aad8519b95b41b as MenuStateContext, $113aa0613e727c6c$export$795aec4671cbae19 as RootMenuTriggerStateContext, $113aa0613e727c6c$export$27d2ad3c5815583e as MenuTrigger, $113aa0613e727c6c$export$ecabc99eeffab7ca as SubmenuTrigger, $113aa0613e727c6c$export$d9b273488cd8ce6f as Menu, $113aa0613e727c6c$export$4b1545b4f2016d26 as MenuSection, $113aa0613e727c6c$export$2ce376c2cc3355c8 as MenuItem, $113aa0613e727c6c$export$93aba29d3a678058 as MenuLoadMoreItem};
|
|
451
507
|
//# sourceMappingURL=Menu.js.map
|