@solid2-aria/components 0.0.1 → 0.1.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.
Files changed (88) hide show
  1. package/README.md +6 -0
  2. package/dist/NOTICE.txt +33 -11
  3. package/dist/browser/collection-dnd.js +37 -40
  4. package/dist/browser/collection-dnd.js.map +1 -1
  5. package/dist/browser/color-field.js +12 -6
  6. package/dist/browser/color-field.js.map +1 -1
  7. package/dist/browser/drop-zone.js +6 -3
  8. package/dist/browser/drop-zone.js.map +1 -1
  9. package/dist/browser/grid-list.d.ts +2 -2
  10. package/dist/browser/grid-list.js +8 -7
  11. package/dist/browser/grid-list.js.map +1 -1
  12. package/dist/browser/list-box.js +31 -37
  13. package/dist/browser/list-box.js.map +1 -1
  14. package/dist/browser/menu.js +16 -19
  15. package/dist/browser/menu.js.map +1 -1
  16. package/dist/browser/modal.js +28 -31
  17. package/dist/browser/modal.js.map +1 -1
  18. package/dist/browser/number-field.js +5 -4
  19. package/dist/browser/number-field.js.map +1 -1
  20. package/dist/browser/popover.js +26 -29
  21. package/dist/browser/popover.js.map +1 -1
  22. package/dist/browser/shared-element-transition.js +19 -22
  23. package/dist/browser/shared-element-transition.js.map +1 -1
  24. package/dist/browser/sheet.d.ts +1 -1
  25. package/dist/browser/sheet.js +82 -7
  26. package/dist/browser/sheet.js.map +1 -1
  27. package/dist/browser/table.d.ts +2 -2
  28. package/dist/browser/table.js +5 -2
  29. package/dist/browser/table.js.map +1 -1
  30. package/dist/browser/tabs.d.ts +1 -1
  31. package/dist/browser/tabs.js +65 -26
  32. package/dist/browser/tabs.js.map +1 -1
  33. package/dist/browser/toast.js +43 -46
  34. package/dist/browser/toast.js.map +1 -1
  35. package/dist/browser/token-field.js +0 -1
  36. package/dist/browser/token-field.js.map +1 -1
  37. package/dist/browser/tooltip.js +22 -25
  38. package/dist/browser/tooltip.js.map +1 -1
  39. package/dist/browser/tree.js +21 -10
  40. package/dist/browser/tree.js.map +1 -1
  41. package/dist/server/calendar.js +3 -1
  42. package/dist/server/calendar.js.map +1 -1
  43. package/dist/server/checkbox.js +3 -1
  44. package/dist/server/checkbox.js.map +1 -1
  45. package/dist/server/collection-dnd.js +8 -36
  46. package/dist/server/collection-dnd.js.map +1 -1
  47. package/dist/server/color-field.js +7 -2
  48. package/dist/server/color-field.js.map +1 -1
  49. package/dist/server/color-thumb.js +6 -2
  50. package/dist/server/color-thumb.js.map +1 -1
  51. package/dist/server/drop-zone.js +12 -5
  52. package/dist/server/drop-zone.js.map +1 -1
  53. package/dist/server/grid-list.js +16 -32
  54. package/dist/server/grid-list.js.map +1 -1
  55. package/dist/server/hidden-date-input.js +3 -1
  56. package/dist/server/hidden-date-input.js.map +1 -1
  57. package/dist/server/list-box.js +25 -69
  58. package/dist/server/list-box.js.map +1 -1
  59. package/dist/server/menu.js +10 -31
  60. package/dist/server/menu.js.map +1 -1
  61. package/dist/server/modal.js +35 -67
  62. package/dist/server/modal.js.map +1 -1
  63. package/dist/server/popover.js +71 -98
  64. package/dist/server/popover.js.map +1 -1
  65. package/dist/server/radio-group.js +3 -1
  66. package/dist/server/radio-group.js.map +1 -1
  67. package/dist/server/shared-element-transition.js +13 -42
  68. package/dist/server/shared-element-transition.js.map +1 -1
  69. package/dist/server/sheet.js +135 -60
  70. package/dist/server/sheet.js.map +1 -1
  71. package/dist/server/slider.js +3 -1
  72. package/dist/server/slider.js.map +1 -1
  73. package/dist/server/switch.js +3 -1
  74. package/dist/server/switch.js.map +1 -1
  75. package/dist/server/table.js +8 -3
  76. package/dist/server/table.js.map +1 -1
  77. package/dist/server/tabs.js +180 -169
  78. package/dist/server/tabs.js.map +1 -1
  79. package/dist/server/toast.js +68 -101
  80. package/dist/server/toast.js.map +1 -1
  81. package/dist/server/token-field.js +2 -2
  82. package/dist/server/tooltip.js +34 -61
  83. package/dist/server/tooltip.js.map +1 -1
  84. package/dist/server/tree.js +156 -130
  85. package/dist/server/tree.js.map +1 -1
  86. package/dist/server/virtualizer.js +3 -1
  87. package/dist/server/virtualizer.js.map +1 -1
  88. package/package.json +12 -11
@@ -1 +1 @@
1
- {"version":3,"file":"list-box.js","names":["<ListBoxDropIndicator\n {...indicatorProps}\n ref={indicatorRef}\n />","ref={indicatorRef}","props={sectionProps}","node={sectionNode}","{dnd.preview}","{values.isEmpty && props.renderEmptyState ? (\n <div role=\"option\" style={{ display: \"contents\" }}>\n {props.renderEmptyState(values)}\n </div>\n ) : null}","{props.renderEmptyState(values)}","props.renderEmptyState(values)","<div role=\"option\" style={{ display: \"contents\" }}>\n {props.renderEmptyState(values)}\n </div>","style={{ display: \"contents\" }}","state.selectionManager.selectionMode === \"none\"\n ? undefined\n : state.selectionManager.selectionMode","dom.div","<dom.div\n {...filterDOMProps(props, { global: true })}\n {...render}\n role=\"option\"\n tabindex={-1}\n ref={(element: HTMLDivElement) => {\n assignRef(forwardedRef, element);\n }}\n >\n {render.children}\n </dom.div>","<dom.div\n {...aria.dropIndicatorProps}\n {...render}\n role=\"option\"\n ref={[\n (element: HTMLElement) => {\n setRef(element);\n },\n (element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n },\n ]}\n data-drop-target={aria.isDropTarget || undefined}\n />","listRef={setRef}","<dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.listBoxProps ?? {}),\n merge(() => dnd.collectionProps ?? {}),\n merge(() => focus.focusProps ?? {}),\n render\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={props.slot ?? undefined}\n data-drop-target={values.isDropTarget || undefined}\n data-empty={values.isEmpty || undefined}\n data-focused={focus.isFocused || undefined}\n data-focus-visible={focus.isFocusVisible || undefined}\n data-layout={values.layout}\n data-orientation={values.orientation}\n >\n <ListBoxContext value={props}>\n <ListStateContext value={state}>\n <SectionContext\n value={{\n name: \"ListBoxSection\",\n render: (sectionProps, sectionRef, sectionNode, defaultClass) => (\n <ListBoxSectionContent\n props={sectionProps}\n sectionRef={sectionRef}\n node={sectionNode}\n defaultClass={defaultClass}\n />\n ),\n }}\n >\n <DragAndDropContext value={dnd}>\n <DropIndicatorContext\n value={{\n render: (indicatorProps, indicatorRef) => (\n <ListBoxDropIndicator\n {...indicatorProps}\n ref={indicatorRef}\n />\n ),\n }}\n >\n <Root\n collection={state.collection}\n scrollRef={ref}\n persistedKeys={createDndPersistedKeys(\n state.selectionManager,\n props.dragAndDropHooks,\n dnd.dropState\n )}\n renderDropIndicator={createRenderDropIndicator(\n props.dragAndDropHooks,\n dnd.dropState\n )}\n />\n </DropIndicatorContext>\n </DragAndDropContext>\n </SectionContext>\n </ListStateContext>\n </ListBoxContext>\n {dnd.preview}\n {values.isEmpty && props.renderEmptyState ? (\n <div role=\"option\" style={{ display: \"contents\" }}>\n {props.renderEmptyState(values)}\n </div>\n ) : null}\n </dom.div>","dom.section","<dom.section\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\"),\n merge(() => aria.groupProps ?? {})\n )}\n class={props.class ?? defaultClass}\n style={props.style}\n render={props.render}\n ref={ref}\n >\n <HeaderContext\n value={mergeProps(\n merge(() => aria.headingProps ?? {}),\n { registerSlot: registerHeading }\n )}\n >\n <Branch collection={state.collection} parent={section} />\n </HeaderContext>\n </dom.section>","ref={ref}","<Element\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\"),\n render,\n merge(() => aria.optionProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n merge(() => keyboard.keyboardProps ?? {}),\n merge(() => focus.focusProps ?? {}),\n merge(() => drag?.dragProps ?? {}),\n merge(() => drop?.dropProps ?? {})\n )}\n ref={[\n (element: HTMLDivElement) => {\n setRef(element);\n },\n (element: HTMLDivElement) => {\n assignRef(forwardedRef, element);\n },\n ]}\n data-allows-dragging={values.allowsDragging ?? undefined}\n data-dragging={values.isDragging ?? undefined}\n data-drop-target={values.isDropTarget ?? undefined}\n data-selected={aria.isSelected || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-hovered={hover.isHovered || undefined}\n data-focused={aria.isFocused || undefined}\n data-focus-visible={aria.isFocusVisible || undefined}\n data-pressed={aria.isPressed || undefined}\n data-selection-mode={\n state.selectionManager.selectionMode === \"none\"\n ? undefined\n : state.selectionManager.selectionMode\n }\n >\n <TextContext\n value={{\n slots: {\n get [DEFAULT_SLOT]() {\n return aria.labelProps;\n },\n get description() {\n return aria.descriptionProps;\n },\n get label() {\n return aria.labelProps;\n },\n },\n }}\n >\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return aria.isSelected;\n },\n }}\n >\n {render.children}\n </SelectionIndicatorContext>\n </TextContext>\n </Element>","<div style={{ height: 0, position: \"relative\", width: 0 }} inert>\n <div\n data-testid=\"loadMoreSentinel\"\n ref={(element: HTMLDivElement) => {\n setSentinel(element);\n }}\n style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}\n />\n </div>","style={{ height: 0, position: \"relative\", width: 0 }}","style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}","<ListBoxItemCollection\n {...props}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />","ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}","<ListBoxSectionCollection\n {...props}\n ref={(element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />","ref={(element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}","<ListBoxLoadMoreItemCollection\n {...props}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />","_$mergeProps","_$applyRef","_$memo","_$ssrHydrationKey","_$scope","_$escape","_$ssr","_$ssrStyleProperty","_$ssrStyleProperties"],"sources":["../../src/list-box.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/*\n * Derived from Adobe React Spectrum: packages/react-aria-components/src/ListBox.tsx.\n * Modified for Solid Aria: adapted collection ownership, contexts, accessibility primitives, and reactive properties for Solid 2; uses Solid class props.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport {\n ItemNode,\n SectionNode,\n LoaderNode,\n BaseCollection,\n} from \"@solid2-aria/core/collections/base-collection\";\nimport {\n Collection,\n CollectionBuilder,\n createLeafComponent,\n createBranchComponent,\n} from \"@solid2-aria/core/collections/collection-builder\";\nimport { createFocusRing } from \"@solid2-aria/core/focus/create-focus-ring\";\nimport { createCollator } from \"@solid2-aria/core/i18n/create-collator\";\nimport { createLocale } from \"@solid2-aria/core/i18n/i18n-provider\";\nimport { createFocus } from \"@solid2-aria/core/interactions/create-focus\";\nimport { createHover } from \"@solid2-aria/core/interactions/create-hover\";\nimport { createKeyboard } from \"@solid2-aria/core/interactions/create-keyboard\";\nimport { createListBox } from \"@solid2-aria/core/listbox/create-list-box\";\nimport type { AriaListBoxProps } from \"@solid2-aria/core/listbox/create-list-box\";\nimport { createListBoxSection } from \"@solid2-aria/core/listbox/create-list-box-section\";\nimport { createOption } from \"@solid2-aria/core/listbox/create-option\";\nimport { ListKeyboardDelegate } from \"@solid2-aria/core/selection/list-keyboard-delegate\";\nimport { createLoadMoreSentinel } from \"@solid2-aria/core/utils/create-load-more-sentinel\";\nimport type { LoadMoreSentinelProps } from \"@solid2-aria/core/utils/create-load-more-sentinel\";\nimport { filterDOMProps } from \"@solid2-aria/core/utils/filter-dom-props\";\nimport { mergeProps } from \"@solid2-aria/core/utils/merge-props\";\nimport { isTruthy } from \"@solid2-aria/core/utils/truthy\";\nimport { createListState } from \"@solid2-aria/stately/list/create-list-state\";\nimport type { ListState } from \"@solid2-aria/stately/list/create-list-state\";\nimport type {\n Collection as SharedCollection,\n FocusEvents,\n HoverEvents,\n Key,\n KeyboardEvents,\n LinkDOMProps,\n PressEvents,\n Orientation,\n SelectionBehavior,\n Node,\n} from \"@solid2-aria/types-shared\";\nimport type { GlobalDOMAttributes } from \"@solid2-aria/types-shared-web\";\nimport { dynamic } from \"@solidjs/web\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n merge,\n untrack,\n createSignal,\n createContext,\n createMemo,\n useContext,\n omit,\n Show,\n} from \"solid-js\";\n\nimport { SelectableCollectionContext } from \"./autocomplete\";\nimport type { SelectableCollectionContextValue } from \"./autocomplete\";\nimport { CollectionRendererContext, SectionContext } from \"./collection\";\nimport type {\n CollectionProps,\n ItemRenderProps,\n SectionProps,\n} from \"./collection\";\nimport { createCollectionDragAndDrop } from \"./collection-dnd\";\nimport type { DragAndDropHooks } from \"./create-drag-and-drop\";\nimport {\n DragAndDropContext,\n DropIndicatorContext,\n createRenderDropIndicator,\n createDndPersistedKeys,\n} from \"./drag-and-drop\";\nimport type { DropIndicatorProps } from \"./drag-and-drop\";\nimport { HeaderContext } from \"./header\";\nimport { SelectionIndicatorContext } from \"./selection-indicator\";\nimport { TextContext } from \"./text\";\nimport {\n dom,\n createContextProps,\n createRenderProps,\n createSlot,\n DEFAULT_SLOT,\n assignRef,\n} from \"./utils\";\nimport type {\n Ref,\n ClassOrFunction,\n DOMRenderProps,\n PossibleLinkDOMRenderProps,\n RenderProps,\n SlotProps,\n StyleProps,\n StyleRenderProps,\n ContextValue,\n} from \"./utils\";\n\nexport const ListBoxContext =\n // oxlint-disable-next-line typescript/no-explicit-any -- Collection contexts erase item types; each typed factory restores its owner's item contract.\n createContext<ContextValue<ListBoxProps<any>, HTMLDivElement>>(null);\n\nexport const ListStateContext = createContext<ListState<unknown> | null>(null);\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 [class](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) 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 class?: ClassOrFunction<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 `createDragAndDrop` 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) => JSX.Element;\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 interface ListBoxSectionProps<T>\n extends SectionProps<T>, DOMRenderProps<\"section\", undefined> {\n /**\n * The CSS [class](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) for the\n * element.\n *\n * @default 'react-aria-ListBoxSection'\n */\n class?: JSX.ClassValue;\n}\n\nexport type ListBoxItemRenderProps = 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 [class](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) 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 class?: ClassOrFunction<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\nexport interface ListBoxLoadMoreItemProps\n extends\n Omit<LoadMoreSentinelProps, \"collection\" | \"direction\">,\n StyleProps,\n DOMRenderProps<\"div\", undefined>,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [class](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) for the\n * element.\n *\n * @default 'react-aria-ListBoxLoadingIndicator'\n */\n class?: JSX.ClassValue;\n /**\n * The load more spinner to render when loading additional items.\n */\n children?: JSX.Element;\n /**\n * Whether or not the loading spinner should be rendered or not.\n */\n isLoading?: boolean;\n}\n\nexport function ListBox<T extends object>(\n input: ListBoxProps<T> & { ref?: Ref<HTMLDivElement> }\n): JSX.Element {\n const [props, , setRef] = createContextProps(\n input,\n untrack(() => input.ref),\n ListBoxContext\n );\n\n const state = useContext(ListStateContext);\n\n if (state) {\n // oxlint-disable-next-line solid/components-return-once -- Static collection traversal and context registration are fixed when the owner is created.\n return <ListBoxInner props={props} state={state} listRef={setRef} />;\n }\n\n return (\n <CollectionBuilder\n createCollection={() => new BaseCollection<object>()}\n content={<Collection {...props} />}\n >\n {(collection) => (\n <StandaloneListBox\n props={props}\n collection={collection}\n listRef={setRef}\n />\n )}\n </CollectionBuilder>\n );\n}\n\nfunction StandaloneListBox<T extends object>(input: {\n props: ListBoxProps<T>;\n collection: BaseCollection<object>;\n listRef: (element: HTMLDivElement) => void;\n}): JSX.Element {\n const state = createListState(\n mergeProps(\n merge(() => input.props ?? {}),\n {\n children: null,\n get collection() {\n return input.collection;\n },\n items: undefined,\n }\n )\n );\n\n return (\n <ListBoxInner props={input.props} state={state} listRef={input.listRef} />\n );\n}\n\nfunction ListBoxInner<T>(input: {\n props: ListBoxProps<T> & SelectableCollectionContextValue<unknown>;\n state: ListState<unknown>;\n listRef: (element: HTMLDivElement) => void;\n}): JSX.Element {\n const [props, ref, setRef] = createContextProps(\n untrack(() => input.props),\n untrack(() => input.listRef),\n SelectableCollectionContext\n );\n\n const renderer = useContext(CollectionRendererContext);\n\n const filtered = createMemo(() =>\n props.filter && input.state.collection.filter\n ? input.state.collection.filter(props.filter)\n : input.state.collection\n );\n\n const state: ListState<unknown> = {\n get collection() {\n return filtered();\n },\n get disabledKeys() {\n return input.state.disabledKeys;\n },\n get selectionManager() {\n return input.state.selectionManager.withCollection(filtered());\n },\n };\n\n const locale = createLocale();\n const collator = createCollator({ sensitivity: \"base\", usage: \"search\" });\n\n const keyboardDelegate = createMemo(\n () =>\n new ListKeyboardDelegate({\n collator,\n collection: state.collection,\n direction: locale.direction,\n disabledBehavior: state.selectionManager.disabledBehavior,\n disabledKeys: state.disabledKeys,\n layout: props.layout ?? \"stack\",\n layoutDelegate: renderer.layoutDelegate,\n orientation: props.orientation ?? \"vertical\",\n ref,\n })\n );\n\n const dnd = createCollectionDragAndDrop<T>({\n get collection() {\n // SAFETY: This state was constructed from the same ListBox<T> collection passed to the drag adapter.\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- The shared selection context erases T between the owner and its descendants.\n return state.collection as SharedCollection<Node<T>>;\n },\n get direction() {\n return locale.direction;\n },\n get dropTargetDelegate() {\n return renderer.dropTargetDelegate;\n },\n get hooks() {\n return props.dragAndDropHooks;\n },\n get keyboardDelegate() {\n return keyboardDelegate();\n },\n get layout() {\n return props.layout;\n },\n get orientation() {\n return props.orientation;\n },\n ref,\n get selectionManager() {\n return state.selectionManager;\n },\n });\n\n const aria = createListBox(\n mergeProps(props, {\n get isVirtualized() {\n return renderer.isVirtualized;\n },\n get keyboardDelegate() {\n return keyboardDelegate();\n },\n }),\n state,\n ref\n );\n\n const focus = createFocusRing();\n\n const values: ListBoxRenderProps = {\n get isDropTarget() {\n return dnd.dropState?.isDropTarget({ type: \"root\" }) === true;\n },\n get isEmpty() {\n return state.collection.size === 0;\n },\n get isFocusVisible() {\n return focus.isFocusVisible;\n },\n get isFocused() {\n return focus.isFocused;\n },\n get layout() {\n return props.layout ?? \"stack\";\n },\n get orientation() {\n return props.orientation ?? \"vertical\";\n },\n state,\n };\n\n const render = createRenderProps(\n mergeProps(props, {\n children: undefined,\n defaultClass: \"solid2-aria-ListBox\",\n values,\n })\n );\n\n const Root = renderer.CollectionRoot;\n\n return (\n <dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.listBoxProps ?? {}),\n merge(() => dnd.collectionProps ?? {}),\n merge(() => focus.focusProps ?? {}),\n render\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={props.slot ?? undefined}\n data-drop-target={values.isDropTarget || undefined}\n data-empty={values.isEmpty || undefined}\n data-focused={focus.isFocused || undefined}\n data-focus-visible={focus.isFocusVisible || undefined}\n data-layout={values.layout}\n data-orientation={values.orientation}\n >\n <ListBoxContext value={props}>\n <ListStateContext value={state}>\n <SectionContext\n value={{\n name: \"ListBoxSection\",\n render: (sectionProps, sectionRef, sectionNode, defaultClass) => (\n <ListBoxSectionContent\n props={sectionProps}\n sectionRef={sectionRef}\n node={sectionNode}\n defaultClass={defaultClass}\n />\n ),\n }}\n >\n <DragAndDropContext value={dnd}>\n <DropIndicatorContext\n value={{\n render: (indicatorProps, indicatorRef) => (\n <ListBoxDropIndicator\n {...indicatorProps}\n ref={indicatorRef}\n />\n ),\n }}\n >\n <Root\n collection={state.collection}\n scrollRef={ref}\n persistedKeys={createDndPersistedKeys(\n state.selectionManager,\n props.dragAndDropHooks,\n dnd.dropState\n )}\n renderDropIndicator={createRenderDropIndicator(\n props.dragAndDropHooks,\n dnd.dropState\n )}\n />\n </DropIndicatorContext>\n </DragAndDropContext>\n </SectionContext>\n </ListStateContext>\n </ListBoxContext>\n {dnd.preview}\n {values.isEmpty && props.renderEmptyState ? (\n <div role=\"option\" style={{ display: \"contents\" }}>\n {props.renderEmptyState(values)}\n </div>\n ) : null}\n </dom.div>\n );\n}\n\nfunction ListBoxSectionInner(\n // oxlint-disable-next-line typescript/no-explicit-any -- Collection contexts erase item types; each typed factory restores its owner's item contract.\n props: ListBoxSectionProps<any>,\n ref: Ref<HTMLElement>,\n section: Node<unknown>,\n defaultClass = \"solid2-aria-ListBoxSection\"\n): JSX.Element {\n const state = useContext(ListStateContext);\n\n if (!state) {\n throw new Error(\"ListBoxSection must be rendered in a ListBox.\");\n }\n\n const renderer = useContext(CollectionRendererContext);\n const Branch = renderer.CollectionBranch;\n const [registerHeading, heading] = createSlot();\n\n const aria = createListBoxSection({\n get \"aria-label\"() {\n return props[\"aria-label\"] ?? undefined;\n },\n get heading() {\n return heading();\n },\n });\n\n return (\n <dom.section\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\"),\n merge(() => aria.groupProps ?? {})\n )}\n class={props.class ?? defaultClass}\n style={props.style}\n render={props.render}\n ref={ref}\n >\n <HeaderContext\n value={mergeProps(\n merge(() => aria.headingProps ?? {}),\n { registerSlot: registerHeading }\n )}\n >\n <Branch collection={state.collection} parent={section} />\n </HeaderContext>\n </dom.section>\n );\n}\n\nconst ListBoxSectionCollection = createBranchComponent(\n SectionNode,\n ListBoxSectionInner\n);\n\nconst ListBoxItemCollection = createLeafComponent(\n ItemNode,\n <T,>(\n props: ListBoxItemProps<T>,\n forwardedRef: Ref<HTMLDivElement>,\n item: Node<T>\n ): JSX.Element => {\n const state = useContext(ListStateContext);\n\n if (!state) {\n throw new Error(\"ListBoxItem must be rendered in a ListBox.\");\n }\n\n const [ref, setRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const aria = createOption(\n {\n get \"aria-label\"() {\n return props[\"aria-label\"];\n },\n key: item.key,\n },\n state,\n ref\n );\n\n const hover = createHover(\n mergeProps(props, {\n get isDisabled() {\n return aria.isDisabled;\n },\n })\n );\n\n const dnd = useContext(DragAndDropContext);\n\n const drag = dnd.dragState\n ? dnd.dragAndDropHooks?.createDraggableItem?.(\n { hasAction: aria.hasAction, key: item.key },\n dnd.dragState\n )\n : undefined;\n\n const drop = dnd.dropState\n ? dnd.dragAndDropHooks?.createDroppableItem?.(\n { target: { dropPosition: \"on\", key: item.key, type: \"item\" } },\n dnd.dropState,\n ref\n )\n : undefined;\n\n const keyboard = createKeyboard(props);\n const focus = createFocus(props);\n\n const values: ListBoxItemRenderProps = {\n get allowsDragging() {\n return !!dnd.dragState;\n },\n get isDisabled() {\n return aria.isDisabled;\n },\n get isDragging() {\n return dnd.dragState?.isDragging(item.key) === true;\n },\n get isDropTarget() {\n return drop?.isDropTarget === true;\n },\n get isFocusVisible() {\n return aria.isFocusVisible;\n },\n get isFocused() {\n return aria.isFocused;\n },\n get isHovered() {\n return hover.isHovered;\n },\n get isPressed() {\n return aria.isPressed;\n },\n get isSelected() {\n return aria.isSelected;\n },\n get selectionBehavior() {\n return state.selectionManager.selectionBehavior;\n },\n get selectionMode() {\n return state.selectionManager.selectionMode;\n },\n };\n\n const render = createRenderProps(\n mergeProps(props, { defaultClass: \"solid2-aria-ListBoxItem\", values })\n );\n\n const Element = dynamic(() => (isTruthy(props.href) ? dom.a : dom.div));\n\n return (\n <Element\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\"),\n render,\n merge(() => aria.optionProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n merge(() => keyboard.keyboardProps ?? {}),\n merge(() => focus.focusProps ?? {}),\n merge(() => drag?.dragProps ?? {}),\n merge(() => drop?.dropProps ?? {})\n )}\n ref={[\n (element: HTMLDivElement) => {\n setRef(element);\n },\n (element: HTMLDivElement) => {\n assignRef(forwardedRef, element);\n },\n ]}\n data-allows-dragging={values.allowsDragging ?? undefined}\n data-dragging={values.isDragging ?? undefined}\n data-drop-target={values.isDropTarget ?? undefined}\n data-selected={aria.isSelected || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-hovered={hover.isHovered || undefined}\n data-focused={aria.isFocused || undefined}\n data-focus-visible={aria.isFocusVisible || undefined}\n data-pressed={aria.isPressed || undefined}\n data-selection-mode={\n state.selectionManager.selectionMode === \"none\"\n ? undefined\n : state.selectionManager.selectionMode\n }\n >\n <TextContext\n value={{\n slots: {\n get [DEFAULT_SLOT]() {\n return aria.labelProps;\n },\n get description() {\n return aria.descriptionProps;\n },\n get label() {\n return aria.labelProps;\n },\n },\n }}\n >\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return aria.isSelected;\n },\n }}\n >\n {render.children}\n </SelectionIndicatorContext>\n </TextContext>\n </Element>\n );\n }\n);\n\nconst ListBoxLoadMoreItemCollection = createLeafComponent(\n LoaderNode,\n (\n props: ListBoxLoadMoreItemProps,\n forwardedRef: Ref<HTMLDivElement>,\n _node: Node<unknown>\n ): JSX.Element => {\n const state = useContext(ListStateContext);\n\n if (!state) {\n throw new Error(\"ListBoxLoadMoreItem must be rendered in a ListBox.\");\n }\n\n const [sentinel, setSentinel] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n createLoadMoreSentinel(\n mergeProps(props, {\n get collection() {\n return state.collection;\n },\n }),\n sentinel\n );\n\n const render = createRenderProps(\n mergeProps(props, {\n defaultClass: \"solid2-aria-ListBoxLoadingIndicator\",\n values: undefined,\n })\n );\n\n return (\n <>\n <div style={{ height: 0, position: \"relative\", width: 0 }} inert>\n <div\n data-testid=\"loadMoreSentinel\"\n ref={(element: HTMLDivElement) => {\n setSentinel(element);\n }}\n style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}\n />\n </div>\n <Show when={props.isLoading}>\n <dom.div\n {...filterDOMProps(props, { global: true })}\n {...render}\n role=\"option\"\n tabindex={-1}\n ref={(element: HTMLDivElement) => {\n assignRef(forwardedRef, element);\n }}\n >\n {render.children}\n </dom.div>\n </Show>\n </>\n );\n }\n);\n\nfunction ListBoxSectionContent(input: {\n props: SectionProps<unknown>;\n sectionRef: Ref<HTMLElement>;\n node: Node<unknown>;\n defaultClass?: string;\n}): JSX.Element {\n return ListBoxSectionInner(\n input.props,\n input.sectionRef,\n input.node,\n input.defaultClass\n );\n}\n\nexport function ListBoxItem<T>(\n props: ListBoxItemProps<T> & { ref?: Ref<HTMLDivElement> }\n): JSX.Element {\n return (\n <ListBoxItemCollection\n {...props}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />\n );\n}\n\nexport function ListBoxSection<T>(\n props: ListBoxSectionProps<T> & { ref?: Ref<HTMLElement> }\n): JSX.Element {\n return (\n <ListBoxSectionCollection\n {...props}\n ref={(element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />\n );\n}\n\nexport function ListBoxLoadMoreItem(\n props: ListBoxLoadMoreItemProps & { ref?: Ref<HTMLDivElement> }\n): JSX.Element {\n return (\n <ListBoxLoadMoreItemCollection\n {...props}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />\n );\n}\n\nfunction ListBoxDropIndicator(props: DropIndicatorProps): JSX.Element {\n const context = useContext(DragAndDropContext);\n\n const [ref, setRef] = createSignal<HTMLElement | null>(null, {\n ownedWrite: true,\n });\n\n if (!context.dragAndDropHooks?.createDropIndicator || !context.dropState) {\n // oxlint-disable-next-line solid/components-return-once -- Static collection traversal and context registration are fixed when the owner is created.\n return null;\n }\n\n const aria = context.dragAndDropHooks.createDropIndicator(\n props,\n context.dropState,\n ref\n );\n\n const render = createRenderProps(\n mergeProps(props, {\n defaultClass: \"solid2-aria-DropIndicator\",\n values: {\n get isDropTarget() {\n return aria.isDropTarget;\n },\n },\n })\n );\n\n return (\n <Show when={!aria.isHidden}>\n <dom.div\n {...aria.dropIndicatorProps}\n {...render}\n role=\"option\"\n ref={[\n (element: HTMLElement) => {\n setRef(element);\n },\n (element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n },\n ]}\n data-drop-target={aria.isDropTarget || undefined}\n />\n </Show>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwSM,OAAA,WAAyB,KAAQ;;;;;;;;;;;;;;EAgCrB,O,SAAO,CAAM;;;;;;;EAAqB,O,SAAS,CAAM;;;;;;;;;;;;;;EAiLjD,O,SAAY,CAAM;;;;;;;;;;EAElB,OAAe,uBACb,MAAM,kBACN,MAAM,kBACN,IAAI,SACN;;;;;;;;;EACA,OAAqB,0BACnB,MAAM,kBACN,IAAI,SACN;;;;;;;;;;;;;;;;;;;;;;EAXF,OAAA,KAAA,IAAA,KACc,OAIV,OACA,KAJS,GAUZ,CAAA;;;;;;;;;;;;;;;;;;;;;;EAtBH,OAAA,qBAAA,IAAA,KAAA,MAWgB,OAIV,OACA,KAJS,KAXN,EACL,SAAS,gBAAgB,iBAAA,qBACvBA,aACM,gBADN,EAEE,IAAA,IAAA;GAAK,IAAA,QAAA;GAAL,OAAA,UAAA,cAAA,MAAA,QAAA,KAAiB,IAAjBC,SAAAA,OAA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cAAc;EACd,QAAQ,EACN,IAAI,eAAe;GACjB,OAAO,KAAK;EACd,EACF;CACF,CAAC,CACH;CAEA,OAAA,KACE,IAAA,MAAa,MAGL,QAIA,QAIgB,KAOlB,CAAA;AAEV"}
1
+ {"version":3,"file":"list-box.js","names":["<ListBoxDropIndicator\n {...indicatorProps}\n ref={indicatorRef}\n />","ref={indicatorRef}","props={sectionProps}","node={sectionNode}","{dnd.preview}","{values.isEmpty && props.renderEmptyState ? (\n <div role=\"option\" style={{ display: \"contents\" }}>\n {props.renderEmptyState(values)}\n </div>\n ) : null}","{props.renderEmptyState(values)}","props.renderEmptyState(values)","<div role=\"option\" style={{ display: \"contents\" }}>\n {props.renderEmptyState(values)}\n </div>","style={{ display: \"contents\" }}","state.selectionManager.selectionMode === \"none\"\n ? undefined\n : state.selectionManager.selectionMode","listRef={setRef}","dom.div","<dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.listBoxProps ?? {}),\n merge(() => dnd.collectionProps ?? {}),\n merge(() => focus.focusProps ?? {}),\n render\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={props.slot ?? undefined}\n data-drop-target={values.isDropTarget || undefined}\n data-empty={values.isEmpty || undefined}\n data-focused={focus.isFocused || undefined}\n data-focus-visible={focus.isFocusVisible || undefined}\n data-layout={values.layout}\n data-orientation={values.orientation}\n >\n <ListBoxContext value={props}>\n <ListStateContext value={state}>\n <SectionContext\n value={{\n name: \"ListBoxSection\",\n render: (sectionProps, sectionRef, sectionNode, defaultClass) => (\n <ListBoxSectionContent\n props={sectionProps}\n sectionRef={sectionRef}\n node={sectionNode}\n defaultClass={defaultClass}\n />\n ),\n }}\n >\n <DragAndDropContext value={dnd}>\n <DropIndicatorContext\n value={{\n render: (indicatorProps, indicatorRef) => (\n <ListBoxDropIndicator\n {...indicatorProps}\n ref={indicatorRef}\n />\n ),\n }}\n >\n <Root\n collection={state.collection}\n scrollRef={ref}\n persistedKeys={createDndPersistedKeys(\n state.selectionManager,\n props.dragAndDropHooks,\n dnd.dropState\n )}\n renderDropIndicator={createRenderDropIndicator(\n props.dragAndDropHooks,\n dnd.dropState\n )}\n />\n </DropIndicatorContext>\n </DragAndDropContext>\n </SectionContext>\n </ListStateContext>\n </ListBoxContext>\n {dnd.preview}\n {values.isEmpty && props.renderEmptyState ? (\n <div role=\"option\" style={{ display: \"contents\" }}>\n {props.renderEmptyState(values)}\n </div>\n ) : null}\n </dom.div>","dom.section","<dom.section\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\"),\n merge(() => aria.groupProps ?? {})\n )}\n class={props.class ?? defaultClass}\n style={props.style}\n render={props.render}\n ref={ref}\n >\n <HeaderContext\n value={mergeProps(\n merge(() => aria.headingProps ?? {}),\n { registerSlot: registerHeading }\n )}\n >\n <Branch collection={state.collection} parent={section} />\n </HeaderContext>\n </dom.section>","ref={ref}","<Element\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\"),\n render,\n merge(() => aria.optionProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n merge(() => keyboard.keyboardProps ?? {}),\n merge(() => focus.focusProps ?? {}),\n merge(() => drag?.dragProps ?? {}),\n merge(() => drop?.dropProps ?? {})\n )}\n ref={[\n (element: HTMLDivElement) => {\n setRef(element);\n },\n (element: HTMLDivElement) => {\n assignRef(forwardedRef, element);\n },\n ]}\n data-allows-dragging={values.allowsDragging ?? undefined}\n data-dragging={values.isDragging ?? undefined}\n data-drop-target={values.isDropTarget ?? undefined}\n data-selected={aria.isSelected || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-hovered={hover.isHovered || undefined}\n data-focused={aria.isFocused || undefined}\n data-focus-visible={aria.isFocusVisible || undefined}\n data-pressed={aria.isPressed || undefined}\n data-selection-mode={\n state.selectionManager.selectionMode === \"none\"\n ? undefined\n : state.selectionManager.selectionMode\n }\n >\n <TextContext\n value={{\n slots: {\n get [DEFAULT_SLOT]() {\n return aria.labelProps;\n },\n get description() {\n return aria.descriptionProps;\n },\n get label() {\n return aria.labelProps;\n },\n },\n }}\n >\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return aria.isSelected;\n },\n }}\n >\n {render.children}\n </SelectionIndicatorContext>\n </TextContext>\n </Element>","<div style={{ height: 0, position: \"relative\", width: 0 }} inert>\n <div\n data-testid=\"loadMoreSentinel\"\n ref={(element: HTMLDivElement) => {\n setSentinel(element);\n }}\n style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}\n />\n </div>","style={{ height: 0, position: \"relative\", width: 0 }}","style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}","<Show when={props.isLoading}>\n <dom.div\n {...filterDOMProps(props, { global: true })}\n {...render}\n role=\"option\"\n tabindex={-1}\n ref={(element: HTMLDivElement) => {\n assignRef(forwardedRef, element);\n }}\n >\n {render.children}\n </dom.div>\n </Show>","<dom.div\n {...filterDOMProps(props, { global: true })}\n {...render}\n role=\"option\"\n tabindex={-1}\n ref={(element: HTMLDivElement) => {\n assignRef(forwardedRef, element);\n }}\n >\n {render.children}\n </dom.div>","<ListBoxItemCollection\n {...props}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />","ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}","<ListBoxSectionCollection\n {...props}\n ref={(element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />","ref={(element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}","<ListBoxLoadMoreItemCollection\n {...props}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />","<Show when={!aria.isHidden}>\n <dom.div\n {...aria.dropIndicatorProps}\n {...render}\n role=\"option\"\n ref={[\n (element: HTMLElement) => {\n setRef(element);\n },\n (element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n },\n ]}\n data-drop-target={aria.isDropTarget || undefined}\n />\n </Show>","<dom.div\n {...aria.dropIndicatorProps}\n {...render}\n role=\"option\"\n ref={[\n (element: HTMLElement) => {\n setRef(element);\n },\n (element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n },\n ]}\n data-drop-target={aria.isDropTarget || undefined}\n />","_$mergeProps","_$applyRef","_$memo","_$ssrHydrationKey","_$scope","_$escape","_$ssr","_$ssrStyleProperty","_$ssrStyleProperties"],"sources":["../../src/list-box.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/*\n * Derived from Adobe React Spectrum: packages/react-aria-components/src/ListBox.tsx.\n * Modified for Solid Aria: adapted collection ownership, contexts, accessibility primitives, and reactive properties for Solid 2; uses Solid class props.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport {\n ItemNode,\n SectionNode,\n LoaderNode,\n BaseCollection,\n} from \"@solid2-aria/core/collections/base-collection\";\nimport {\n Collection,\n CollectionBuilder,\n createLeafComponent,\n createBranchComponent,\n} from \"@solid2-aria/core/collections/collection-builder\";\nimport { createFocusRing } from \"@solid2-aria/core/focus/create-focus-ring\";\nimport { createCollator } from \"@solid2-aria/core/i18n/create-collator\";\nimport { createLocale } from \"@solid2-aria/core/i18n/i18n-provider\";\nimport { createFocus } from \"@solid2-aria/core/interactions/create-focus\";\nimport { createHover } from \"@solid2-aria/core/interactions/create-hover\";\nimport { createKeyboard } from \"@solid2-aria/core/interactions/create-keyboard\";\nimport { createListBox } from \"@solid2-aria/core/listbox/create-list-box\";\nimport type { AriaListBoxProps } from \"@solid2-aria/core/listbox/create-list-box\";\nimport { createListBoxSection } from \"@solid2-aria/core/listbox/create-list-box-section\";\nimport { createOption } from \"@solid2-aria/core/listbox/create-option\";\nimport { ListKeyboardDelegate } from \"@solid2-aria/core/selection/list-keyboard-delegate\";\nimport { createLoadMoreSentinel } from \"@solid2-aria/core/utils/create-load-more-sentinel\";\nimport type { LoadMoreSentinelProps } from \"@solid2-aria/core/utils/create-load-more-sentinel\";\nimport { filterDOMProps } from \"@solid2-aria/core/utils/filter-dom-props\";\nimport { mergeProps } from \"@solid2-aria/core/utils/merge-props\";\nimport { isTruthy } from \"@solid2-aria/core/utils/truthy\";\nimport { createListState } from \"@solid2-aria/stately/list/create-list-state\";\nimport type { ListState } from \"@solid2-aria/stately/list/create-list-state\";\nimport type {\n Collection as SharedCollection,\n FocusEvents,\n HoverEvents,\n Key,\n KeyboardEvents,\n LinkDOMProps,\n PressEvents,\n Orientation,\n SelectionBehavior,\n Node,\n} from \"@solid2-aria/types-shared\";\nimport type { GlobalDOMAttributes } from \"@solid2-aria/types-shared-web\";\nimport { dynamic } from \"@solidjs/web\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n merge,\n untrack,\n createSignal,\n createContext,\n createMemo,\n useContext,\n omit,\n Show,\n} from \"solid-js\";\n\nimport { SelectableCollectionContext } from \"./autocomplete\";\nimport type { SelectableCollectionContextValue } from \"./autocomplete\";\nimport { CollectionRendererContext, SectionContext } from \"./collection\";\nimport type {\n CollectionProps,\n ItemRenderProps,\n SectionProps,\n} from \"./collection\";\nimport { createCollectionDragAndDrop } from \"./collection-dnd\";\nimport type { DragAndDropHooks } from \"./create-drag-and-drop\";\nimport {\n DragAndDropContext,\n DropIndicatorContext,\n createRenderDropIndicator,\n createDndPersistedKeys,\n} from \"./drag-and-drop\";\nimport type { DropIndicatorProps } from \"./drag-and-drop\";\nimport { HeaderContext } from \"./header\";\nimport { SelectionIndicatorContext } from \"./selection-indicator\";\nimport { TextContext } from \"./text\";\nimport {\n dom,\n createContextProps,\n createRenderProps,\n createSlot,\n DEFAULT_SLOT,\n assignRef,\n} from \"./utils\";\nimport type {\n Ref,\n ClassOrFunction,\n DOMRenderProps,\n PossibleLinkDOMRenderProps,\n RenderProps,\n SlotProps,\n StyleProps,\n StyleRenderProps,\n ContextValue,\n} from \"./utils\";\n\nexport const ListBoxContext =\n // oxlint-disable-next-line typescript/no-explicit-any -- Collection contexts erase item types; each typed factory restores its owner's item contract.\n createContext<ContextValue<ListBoxProps<any>, HTMLDivElement>>(null);\n\nexport const ListStateContext = createContext<ListState<unknown> | null>(null);\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 [class](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) 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 class?: ClassOrFunction<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 `createDragAndDrop` 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) => JSX.Element;\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 interface ListBoxSectionProps<T>\n extends SectionProps<T>, DOMRenderProps<\"section\", undefined> {\n /**\n * The CSS [class](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) for the\n * element.\n *\n * @default 'react-aria-ListBoxSection'\n */\n class?: JSX.ClassValue;\n}\n\nexport type ListBoxItemRenderProps = 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 [class](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) 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 class?: ClassOrFunction<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\nexport interface ListBoxLoadMoreItemProps\n extends\n Omit<LoadMoreSentinelProps, \"collection\" | \"direction\">,\n StyleProps,\n DOMRenderProps<\"div\", undefined>,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [class](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) for the\n * element.\n *\n * @default 'react-aria-ListBoxLoadingIndicator'\n */\n class?: JSX.ClassValue;\n /**\n * The load more spinner to render when loading additional items.\n */\n children?: JSX.Element;\n /**\n * Whether or not the loading spinner should be rendered or not.\n */\n isLoading?: boolean;\n}\n\nexport function ListBox<T extends object>(\n input: ListBoxProps<T> & { ref?: Ref<HTMLDivElement> }\n): JSX.Element {\n const [props, , setRef] = createContextProps(\n input,\n untrack(() => input.ref),\n ListBoxContext\n );\n\n const state = useContext(ListStateContext);\n\n if (state) {\n // oxlint-disable-next-line solid/components-return-once -- Static collection traversal and context registration are fixed when the owner is created.\n return <ListBoxInner props={props} state={state} listRef={setRef} />;\n }\n\n return (\n <CollectionBuilder\n createCollection={() => new BaseCollection<object>()}\n content={<Collection {...props} />}\n >\n {(collection) => (\n <StandaloneListBox\n props={props}\n collection={collection}\n listRef={setRef}\n />\n )}\n </CollectionBuilder>\n );\n}\n\nfunction StandaloneListBox<T extends object>(input: {\n props: ListBoxProps<T>;\n collection: BaseCollection<object>;\n listRef: (element: HTMLDivElement) => void;\n}): JSX.Element {\n const state = createListState(\n mergeProps(\n merge(() => input.props ?? {}),\n {\n children: null,\n get collection() {\n return input.collection;\n },\n items: undefined,\n }\n )\n );\n\n return (\n <ListBoxInner props={input.props} state={state} listRef={input.listRef} />\n );\n}\n\nfunction ListBoxInner<T>(input: {\n props: ListBoxProps<T> & SelectableCollectionContextValue<unknown>;\n state: ListState<unknown>;\n listRef: (element: HTMLDivElement) => void;\n}): JSX.Element {\n const [props, ref, setRef] = createContextProps(\n untrack(() => input.props),\n untrack(() => input.listRef),\n SelectableCollectionContext\n );\n\n const renderer = useContext(CollectionRendererContext);\n\n const filtered = createMemo(() =>\n props.filter && input.state.collection.filter\n ? input.state.collection.filter(props.filter)\n : input.state.collection\n );\n\n const state: ListState<unknown> = {\n get collection() {\n return filtered();\n },\n get disabledKeys() {\n return input.state.disabledKeys;\n },\n get selectionManager() {\n return input.state.selectionManager.withCollection(filtered());\n },\n };\n\n const locale = createLocale();\n const collator = createCollator({ sensitivity: \"base\", usage: \"search\" });\n\n const keyboardDelegate = createMemo(\n () =>\n new ListKeyboardDelegate({\n collator,\n collection: state.collection,\n direction: locale.direction,\n disabledBehavior: state.selectionManager.disabledBehavior,\n disabledKeys: state.disabledKeys,\n layout: props.layout ?? \"stack\",\n layoutDelegate: renderer.layoutDelegate,\n orientation: props.orientation ?? \"vertical\",\n ref,\n })\n );\n\n const dnd = createCollectionDragAndDrop<T>({\n get collection() {\n // SAFETY: This state was constructed from the same ListBox<T> collection passed to the drag adapter.\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- The shared selection context erases T between the owner and its descendants.\n return state.collection as SharedCollection<Node<T>>;\n },\n get direction() {\n return locale.direction;\n },\n get dropTargetDelegate() {\n return renderer.dropTargetDelegate;\n },\n get hooks() {\n return props.dragAndDropHooks;\n },\n get keyboardDelegate() {\n return keyboardDelegate();\n },\n get layout() {\n return props.layout;\n },\n get orientation() {\n return props.orientation;\n },\n ref,\n get selectionManager() {\n return state.selectionManager;\n },\n });\n\n const aria = createListBox(\n mergeProps(props, {\n get isVirtualized() {\n return renderer.isVirtualized;\n },\n get keyboardDelegate() {\n return keyboardDelegate();\n },\n }),\n state,\n ref\n );\n\n const focus = createFocusRing();\n\n const values: ListBoxRenderProps = {\n get isDropTarget() {\n return dnd.dropState?.isDropTarget({ type: \"root\" }) === true;\n },\n get isEmpty() {\n return state.collection.size === 0;\n },\n get isFocusVisible() {\n return focus.isFocusVisible;\n },\n get isFocused() {\n return focus.isFocused;\n },\n get layout() {\n return props.layout ?? \"stack\";\n },\n get orientation() {\n return props.orientation ?? \"vertical\";\n },\n state,\n };\n\n const render = createRenderProps(\n mergeProps(props, {\n children: undefined,\n defaultClass: \"solid2-aria-ListBox\",\n values,\n })\n );\n\n const Root = renderer.CollectionRoot;\n\n return (\n <dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n merge(() => aria.listBoxProps ?? {}),\n merge(() => dnd.collectionProps ?? {}),\n merge(() => focus.focusProps ?? {}),\n render\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={props.slot ?? undefined}\n data-drop-target={values.isDropTarget || undefined}\n data-empty={values.isEmpty || undefined}\n data-focused={focus.isFocused || undefined}\n data-focus-visible={focus.isFocusVisible || undefined}\n data-layout={values.layout}\n data-orientation={values.orientation}\n >\n <ListBoxContext value={props}>\n <ListStateContext value={state}>\n <SectionContext\n value={{\n name: \"ListBoxSection\",\n render: (sectionProps, sectionRef, sectionNode, defaultClass) => (\n <ListBoxSectionContent\n props={sectionProps}\n sectionRef={sectionRef}\n node={sectionNode}\n defaultClass={defaultClass}\n />\n ),\n }}\n >\n <DragAndDropContext value={dnd}>\n <DropIndicatorContext\n value={{\n render: (indicatorProps, indicatorRef) => (\n <ListBoxDropIndicator\n {...indicatorProps}\n ref={indicatorRef}\n />\n ),\n }}\n >\n <Root\n collection={state.collection}\n scrollRef={ref}\n persistedKeys={createDndPersistedKeys(\n state.selectionManager,\n props.dragAndDropHooks,\n dnd.dropState\n )}\n renderDropIndicator={createRenderDropIndicator(\n props.dragAndDropHooks,\n dnd.dropState\n )}\n />\n </DropIndicatorContext>\n </DragAndDropContext>\n </SectionContext>\n </ListStateContext>\n </ListBoxContext>\n {dnd.preview}\n {values.isEmpty && props.renderEmptyState ? (\n <div role=\"option\" style={{ display: \"contents\" }}>\n {props.renderEmptyState(values)}\n </div>\n ) : null}\n </dom.div>\n );\n}\n\nfunction ListBoxSectionInner(\n // oxlint-disable-next-line typescript/no-explicit-any -- Collection contexts erase item types; each typed factory restores its owner's item contract.\n props: ListBoxSectionProps<any>,\n ref: Ref<HTMLElement>,\n section: Node<unknown>,\n defaultClass = \"solid2-aria-ListBoxSection\"\n): JSX.Element {\n const state = useContext(ListStateContext);\n\n if (!state) {\n throw new Error(\"ListBoxSection must be rendered in a ListBox.\");\n }\n\n const renderer = useContext(CollectionRendererContext);\n const Branch = renderer.CollectionBranch;\n const [registerHeading, heading] = createSlot();\n\n const aria = createListBoxSection({\n get \"aria-label\"() {\n return props[\"aria-label\"] ?? undefined;\n },\n get heading() {\n return heading();\n },\n });\n\n return (\n <dom.section\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\"),\n merge(() => aria.groupProps ?? {})\n )}\n class={props.class ?? defaultClass}\n style={props.style}\n render={props.render}\n ref={ref}\n >\n <HeaderContext\n value={mergeProps(\n merge(() => aria.headingProps ?? {}),\n { registerSlot: registerHeading }\n )}\n >\n <Branch collection={state.collection} parent={section} />\n </HeaderContext>\n </dom.section>\n );\n}\n\nconst ListBoxSectionCollection = createBranchComponent(\n SectionNode,\n ListBoxSectionInner\n);\n\nconst ListBoxItemCollection = createLeafComponent(\n ItemNode,\n <T,>(\n props: ListBoxItemProps<T>,\n forwardedRef: Ref<HTMLDivElement>,\n item: Node<T>\n ): JSX.Element => {\n const state = useContext(ListStateContext);\n\n if (!state) {\n throw new Error(\"ListBoxItem must be rendered in a ListBox.\");\n }\n\n const [ref, setRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const aria = createOption(\n {\n get \"aria-label\"() {\n return props[\"aria-label\"];\n },\n key: item.key,\n },\n state,\n ref\n );\n\n const hover = createHover(\n mergeProps(props, {\n get isDisabled() {\n return aria.isDisabled;\n },\n })\n );\n\n const dnd = useContext(DragAndDropContext);\n\n const drag = dnd.dragState\n ? dnd.dragAndDropHooks?.createDraggableItem?.(\n { hasAction: aria.hasAction, key: item.key },\n dnd.dragState\n )\n : undefined;\n\n const drop = dnd.dropState\n ? dnd.dragAndDropHooks?.createDroppableItem?.(\n { target: { dropPosition: \"on\", key: item.key, type: \"item\" } },\n dnd.dropState,\n ref\n )\n : undefined;\n\n const keyboard = createKeyboard(props);\n const focus = createFocus(props);\n\n const values: ListBoxItemRenderProps = {\n get allowsDragging() {\n return !!dnd.dragState;\n },\n get isDisabled() {\n return aria.isDisabled;\n },\n get isDragging() {\n return dnd.dragState?.isDragging(item.key) === true;\n },\n get isDropTarget() {\n return drop?.isDropTarget === true;\n },\n get isFocusVisible() {\n return aria.isFocusVisible;\n },\n get isFocused() {\n return aria.isFocused;\n },\n get isHovered() {\n return hover.isHovered;\n },\n get isPressed() {\n return aria.isPressed;\n },\n get isSelected() {\n return aria.isSelected;\n },\n get selectionBehavior() {\n return state.selectionManager.selectionBehavior;\n },\n get selectionMode() {\n return state.selectionManager.selectionMode;\n },\n };\n\n const render = createRenderProps(\n mergeProps(props, { defaultClass: \"solid2-aria-ListBoxItem\", values })\n );\n\n const Element = dynamic(() => (isTruthy(props.href) ? dom.a : dom.div));\n\n return (\n <Element\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\"),\n render,\n merge(() => aria.optionProps ?? {}),\n merge(() => hover.hoverProps ?? {}),\n merge(() => keyboard.keyboardProps ?? {}),\n merge(() => focus.focusProps ?? {}),\n merge(() => drag?.dragProps ?? {}),\n merge(() => drop?.dropProps ?? {})\n )}\n ref={[\n (element: HTMLDivElement) => {\n setRef(element);\n },\n (element: HTMLDivElement) => {\n assignRef(forwardedRef, element);\n },\n ]}\n data-allows-dragging={values.allowsDragging ?? undefined}\n data-dragging={values.isDragging ?? undefined}\n data-drop-target={values.isDropTarget ?? undefined}\n data-selected={aria.isSelected || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-hovered={hover.isHovered || undefined}\n data-focused={aria.isFocused || undefined}\n data-focus-visible={aria.isFocusVisible || undefined}\n data-pressed={aria.isPressed || undefined}\n data-selection-mode={\n state.selectionManager.selectionMode === \"none\"\n ? undefined\n : state.selectionManager.selectionMode\n }\n >\n <TextContext\n value={{\n slots: {\n get [DEFAULT_SLOT]() {\n return aria.labelProps;\n },\n get description() {\n return aria.descriptionProps;\n },\n get label() {\n return aria.labelProps;\n },\n },\n }}\n >\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return aria.isSelected;\n },\n }}\n >\n {render.children}\n </SelectionIndicatorContext>\n </TextContext>\n </Element>\n );\n }\n);\n\nconst ListBoxLoadMoreItemCollection = createLeafComponent(\n LoaderNode,\n (\n props: ListBoxLoadMoreItemProps,\n forwardedRef: Ref<HTMLDivElement>,\n _node: Node<unknown>\n ): JSX.Element => {\n const state = useContext(ListStateContext);\n\n if (!state) {\n throw new Error(\"ListBoxLoadMoreItem must be rendered in a ListBox.\");\n }\n\n const [sentinel, setSentinel] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n createLoadMoreSentinel(\n mergeProps(props, {\n get collection() {\n return state.collection;\n },\n }),\n sentinel\n );\n\n const render = createRenderProps(\n mergeProps(props, {\n defaultClass: \"solid2-aria-ListBoxLoadingIndicator\",\n values: undefined,\n })\n );\n\n return (\n <>\n <div style={{ height: 0, position: \"relative\", width: 0 }} inert>\n <div\n data-testid=\"loadMoreSentinel\"\n ref={(element: HTMLDivElement) => {\n setSentinel(element);\n }}\n style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}\n />\n </div>\n <Show when={props.isLoading}>\n <dom.div\n {...filterDOMProps(props, { global: true })}\n {...render}\n role=\"option\"\n tabindex={-1}\n ref={(element: HTMLDivElement) => {\n assignRef(forwardedRef, element);\n }}\n >\n {render.children}\n </dom.div>\n </Show>\n </>\n );\n }\n);\n\nfunction ListBoxSectionContent(input: {\n props: SectionProps<unknown>;\n sectionRef: Ref<HTMLElement>;\n node: Node<unknown>;\n defaultClass?: string;\n}): JSX.Element {\n return ListBoxSectionInner(\n input.props,\n input.sectionRef,\n input.node,\n input.defaultClass\n );\n}\n\nexport function ListBoxItem<T>(\n props: ListBoxItemProps<T> & { ref?: Ref<HTMLDivElement> }\n): JSX.Element {\n return (\n <ListBoxItemCollection\n {...props}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />\n );\n}\n\nexport function ListBoxSection<T>(\n props: ListBoxSectionProps<T> & { ref?: Ref<HTMLElement> }\n): JSX.Element {\n return (\n <ListBoxSectionCollection\n {...props}\n ref={(element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />\n );\n}\n\nexport function ListBoxLoadMoreItem(\n props: ListBoxLoadMoreItemProps & { ref?: Ref<HTMLDivElement> }\n): JSX.Element {\n return (\n <ListBoxLoadMoreItemCollection\n {...props}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />\n );\n}\n\nfunction ListBoxDropIndicator(props: DropIndicatorProps): JSX.Element {\n const context = useContext(DragAndDropContext);\n\n const [ref, setRef] = createSignal<HTMLElement | null>(null, {\n ownedWrite: true,\n });\n\n if (!context.dragAndDropHooks?.createDropIndicator || !context.dropState) {\n // oxlint-disable-next-line solid/components-return-once -- Static collection traversal and context registration are fixed when the owner is created.\n return null;\n }\n\n const aria = context.dragAndDropHooks.createDropIndicator(\n props,\n context.dropState,\n ref\n );\n\n const render = createRenderProps(\n mergeProps(props, {\n defaultClass: \"solid2-aria-DropIndicator\",\n values: {\n get isDropTarget() {\n return aria.isDropTarget;\n },\n },\n })\n );\n\n return (\n <Show when={!aria.isHidden}>\n <dom.div\n {...aria.dropIndicatorProps}\n {...render}\n role=\"option\"\n ref={[\n (element: HTMLElement) => {\n setRef(element);\n },\n (element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n },\n ]}\n data-drop-target={aria.isDropTarget || undefined}\n />\n </Show>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwSM,OAAA,WAAyB,KAAQ;;;;;;;;;;;;;;EAgCrB,O,SAAO,CAAM;;;;;;;EAAqB,O,SAAS,CAAM;;;;;;;;;;;;;;EAiLjD,O,SAAY,CAAM;;;;;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,QAAQ,kBAAkB,uBAAuB,CAAC,QAAQ,WAE7D,OAAO;CAGT,MAAM,OAAO,QAAQ,iBAAiB,oBACpC,OACA,QAAQ,WACR,GACF;CAEA,MAAM,SAAS,kBACb,WAAW,OAAO;EAChB,cAAc;EACd,QAAQ,EACN,IAAI,eAAe;GACjB,OAAO,KAAK;EACd,EACF;CACF,CAAC,CACH;CAEA,OACEI,WAAAA;;GAAY,OAAA,CAAC,KAAK;EAkBZ,CAAA,CAAC,CAAD,IAAA,IAjBHhB,IAADiB,mBACE;GAAI,OAAA,KAAK;EAAkB,GACvB,QAFN,IAAA,MAeoB,MAZlB,UACK,EACF,YAAyB;GACxB,OAAO,OAAO;EAChB,IACC,YAAyB;GACxB,UACE,cAAc,MAAM,GAAG,GACvB,OACF;EACF,CACF,CAED,CAAA,CAAA,IAjBH,KAAA;CAkBM,CAAA;AAEV"}
@@ -24,7 +24,7 @@ import { OverlayTriggerStateContext } from "./overlay-contexts.js";
24
24
  import { PopoverContext } from "./popover.js";
25
25
  import { KeyboardContext } from "./keyboard.js";
26
26
  import { mergeProps } from "@solid2-aria/core/utils/merge-props";
27
- import { Show, createContext, createMemo, createSignal, merge, omit, untrack, useContext } from "solid-js";
27
+ import { createContext, createMemo, createSignal, merge, omit, untrack, useContext } from "solid-js";
28
28
  import { applyRef, dynamic, escape, memo, mergeProps as mergeProps$1, scope, ssr, ssrHydrationKey, ssrStyleProperties, ssrStyleProperty } from "@solidjs/web";
29
29
  import { BaseCollection, CollectionNode, ItemNode, LoaderNode, SectionNode } from "@solid2-aria/core/collections/base-collection";
30
30
  import { Collection, CollectionBuilder, createBranchComponent, createLeafComponent } from "@solid2-aria/core/collections/collection-builder";
@@ -913,35 +913,6 @@ function _P$31(_p144, _p145, _p146, _p147) {
913
913
  Object.defineProperty(this, "children", _d$52);
914
914
  }
915
915
  _P$31.prototype = Object.prototype;
916
- var _d$53 = {
917
- get() {
918
- return this[_m$].isLoading;
919
- },
920
- enumerable: true,
921
- configurable: true
922
- };
923
- var _d$54 = {
924
- get() {
925
- const props = this[_m$];
926
- const render = this[_m$2];
927
- const forwardedRef = this[_m$3];
928
- return dom.div(mergeProps$1(() => {
929
- return filterDOMProps(props, { global: true });
930
- }, render, new _P$31(render, (element) => {
931
- assignRef(forwardedRef, element);
932
- }, "menuitem", -1)));
933
- },
934
- enumerable: true,
935
- configurable: true
936
- };
937
- function _P$32(_p148, _p149, _p150) {
938
- this[_m$] = _p148;
939
- this[_m$2] = _p149;
940
- this[_m$3] = _p150;
941
- Object.defineProperty(this, "when", _d$53);
942
- Object.defineProperty(this, "children", _d$54);
943
- }
944
- _P$32.prototype = Object.prototype;
945
916
  const MenuContext = createContext(null);
946
917
  const MenuStateContext = createContext(null);
947
918
  const RootMenuTriggerStateContext = createContext(null);
@@ -1157,7 +1128,15 @@ const MenuLoadMoreItemCollection = createLeafComponent(LoaderNode, (props, forwa
1157
1128
  defaultClass: "solid2-aria-MenuLoadingIndicator",
1158
1129
  values: void 0
1159
1130
  }));
1160
- return [(_v$3 = ssrHydrationKey(), ssr(_tmpl$2, _v$3, ssrStyleProperties("height:", 0, "position:", "relative", "width:", 0), ssrStyleProperties("height:", "1px", "position:", "absolute", "width:", "1px"))), Show(new _P$32(props, render, forwardedRef))];
1131
+ return [(_v$3 = ssrHydrationKey(), ssr(_tmpl$2, _v$3, ssrStyleProperties("height:", 0, "position:", "relative", "width:", 0), ssrStyleProperties("height:", "1px", "position:", "absolute", "width:", "1px"))), memo(() => {
1132
+ return memo(() => {
1133
+ return !!props.isLoading;
1134
+ })() ? dom.div(mergeProps$1(() => {
1135
+ return filterDOMProps(props, { global: true });
1136
+ }, render, new _P$31(render, (element) => {
1137
+ assignRef(forwardedRef, element);
1138
+ }, "menuitem", -1))) : void 0;
1139
+ })];
1161
1140
  });
1162
1141
  function MenuSection(props) {
1163
1142
  return MenuSectionCollection(mergeProps$1(props, { ref: (element) => {
@@ -1 +1 @@
1
- {"version":3,"file":"menu.js","names":["{state.collection.size === 0 && props.renderEmptyState ? (\n <div role=\"menuitem\" style={{ display: \"contents\" }}>\n {props.renderEmptyState()}\n </div>\n ) : null}","{props.renderEmptyState()}","props.renderEmptyState()","<div role=\"menuitem\" style={{ display: \"contents\" }}>\n {props.renderEmptyState()}\n </div>","style={{ display: \"contents\" }}","manager.selectionMode === \"none\" ? undefined : manager.selectionMode","dom.div","<dom.div\n {...filterDOMProps(props, { global: true })}\n {...render}\n ref={(element: HTMLDivElement) => {\n assignRef(forwardedRef, element);\n }}\n role=\"menuitem\"\n tabindex={-1}\n >\n {render.children}\n </dom.div>","menuRef={setRef}","<dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n render,\n merge(() => aria.menuProps ?? {})\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={props.slot ?? undefined}\n data-empty={state.collection.size === 0 || undefined}\n >\n <MenuStateContext value={state}>\n <SelectionManagerContext value={untrack(() => state.selectionManager)}>\n <RootMenuTriggerStateContext value={trigger}>\n <SubmenuContext\n value={{\n parentMenuRef: ref,\n get shouldUseVirtualFocus() {\n return props.shouldUseVirtualFocus;\n },\n }}\n >\n <MenuItemContext\n value={{\n get shouldCloseOnSelect() {\n return props.shouldCloseOnSelect;\n },\n }}\n >\n <SelectableCollectionContext value={null}>\n <FieldInputContext value={null}>\n <SectionContext\n value={{\n name: \"MenuSection\",\n render: (\n sectionProps,\n sectionRef,\n node,\n defaultClass\n ) =>\n MenuSectionInner(\n sectionProps,\n sectionRef,\n node,\n defaultClass\n ),\n }}\n >\n <Root collection={state.collection} scrollRef={ref} />\n </SectionContext>\n </FieldInputContext>\n </SelectableCollectionContext>\n </MenuItemContext>\n </SubmenuContext>\n </RootMenuTriggerStateContext>\n </SelectionManagerContext>\n </MenuStateContext>\n {state.collection.size === 0 && props.renderEmptyState ? (\n <div role=\"menuitem\" style={{ display: \"contents\" }}>\n {props.renderEmptyState()}\n </div>\n ) : null}\n </dom.div>","dom.section","<dom.section\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\"),\n merge(() => aria.groupProps ?? {})\n )}\n ref={ref}\n render={props.render}\n class={props.class ?? defaultClass}\n style={props.style}\n >\n <HeaderContext\n value={mergeProps(\n merge(() => aria.headingProps ?? {}),\n { registerSlot: registerHeading }\n )}\n >\n <SelectionManagerContext value={untrack(manager)}>\n <MenuItemContext\n value={{\n get shouldCloseOnSelect() {\n return (\n props.shouldCloseOnSelect ?? context?.shouldCloseOnSelect\n );\n },\n }}\n >\n <Branch collection={state.collection} parent={node} />\n </MenuItemContext>\n </SelectionManagerContext>\n </HeaderContext>\n </dom.section>","ref={ref}","<Element\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\"),\n render,\n merge(() => aria.menuItemProps ?? {}),\n merge(() => hover.hoverProps ?? {})\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n data-selected={aria.isSelected || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-hovered={hover.isHovered || undefined}\n data-focused={aria.isFocused || undefined}\n data-focus-visible={aria.isFocusVisible || undefined}\n data-pressed={aria.isPressed || undefined}\n data-has-submenu={values.hasSubmenu || undefined}\n data-open={values.isOpen || undefined}\n data-selection-mode={\n manager.selectionMode === \"none\" ? undefined : manager.selectionMode\n }\n >\n <TextContext\n value={{\n slots: {\n get [DEFAULT_SLOT]() {\n return aria.labelProps;\n },\n get description() {\n return aria.descriptionProps;\n },\n get label() {\n return aria.labelProps;\n },\n },\n }}\n >\n <KeyboardContext value={aria.keyboardShortcutProps}>\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return aria.isSelected;\n },\n }}\n >\n {render.children}\n </SelectionIndicatorContext>\n </KeyboardContext>\n </TextContext>\n </Element>","<div style={{ height: 0, position: \"relative\", width: 0 }} inert>\n <div\n data-testid=\"loadMoreSentinel\"\n ref={(element: HTMLDivElement) => {\n setSentinel(element);\n }}\n style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}\n />\n </div>","style={{ height: 0, position: \"relative\", width: 0 }}","style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}","<MenuSectionCollection\n {...props}\n ref={(element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />","ref={(element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}","<MenuItemCollection\n {...props}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />","ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}","<SubmenuTriggerCollection\n {...props}\n renderPopover={() => props.children[1]}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />","renderPopover={() => props.children[1]}","<MenuLoadMoreItemCollection\n {...props}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />","_$mergeProps","_$memo","_$ssrHydrationKey","_$scope","_$escape","_$ssr","_$ssrStyleProperty","_$applyRef","_$ssrStyleProperties"],"sources":["../../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/*\n * Derived from Adobe React Spectrum: packages/react-aria-components/src/Menu.tsx.\n * Modified for Solid Aria: adapted collection ownership, contexts, accessibility primitives, and reactive properties for Solid 2; uses Solid class props and press responders for custom triggers.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport {\n ItemNode,\n SectionNode,\n LoaderNode,\n CollectionNode,\n BaseCollection,\n} from \"@solid2-aria/core/collections/base-collection\";\nimport {\n Collection,\n CollectionBuilder,\n createLeafComponent,\n createBranchComponent,\n} from \"@solid2-aria/core/collections/collection-builder\";\nimport { createIsHidden } from \"@solid2-aria/core/collections/hidden\";\nimport { createHover } from \"@solid2-aria/core/interactions/create-hover\";\nimport { PressResponder } from \"@solid2-aria/core/interactions/press-responder\";\nimport { createMenu } from \"@solid2-aria/core/menu/create-menu\";\nimport type { AriaMenuProps } from \"@solid2-aria/core/menu/create-menu\";\nimport { createMenuItem } from \"@solid2-aria/core/menu/create-menu-item\";\nimport { createMenuSection } from \"@solid2-aria/core/menu/create-menu-section\";\nimport { createMenuTrigger } from \"@solid2-aria/core/menu/create-menu-trigger\";\nimport { createSubmenuTrigger } from \"@solid2-aria/core/menu/create-submenu-trigger\";\nimport { createLoadMoreSentinel } from \"@solid2-aria/core/utils/create-load-more-sentinel\";\nimport type { LoadMoreSentinelProps } from \"@solid2-aria/core/utils/create-load-more-sentinel\";\nimport { filterDOMProps } from \"@solid2-aria/core/utils/filter-dom-props\";\nimport { mergeProps } from \"@solid2-aria/core/utils/merge-props\";\nimport { isTruthy } from \"@solid2-aria/core/utils/truthy\";\nimport { createMenuTriggerState } from \"@solid2-aria/stately/menu/create-menu-trigger-state\";\nimport type {\n MenuTriggerProps as BaseMenuTriggerProps,\n RootMenuTriggerState,\n} from \"@solid2-aria/stately/menu/create-menu-trigger-state\";\nimport { createSubmenuTriggerState } from \"@solid2-aria/stately/menu/create-submenu-trigger-state\";\nimport { createMultipleSelectionState } from \"@solid2-aria/stately/selection/create-multiple-selection-state\";\nimport { SelectionManager } from \"@solid2-aria/stately/selection/selection-manager\";\nimport type { MultipleSelectionState } from \"@solid2-aria/stately/selection/types\";\nimport { createTreeState } from \"@solid2-aria/stately/tree/create-tree-state\";\nimport type { TreeState } from \"@solid2-aria/stately/tree/create-tree-state\";\nimport type {\n FocusableElement,\n FocusEvents,\n HoverEvents,\n Key,\n LinkDOMProps,\n MultipleSelection,\n PressEvents,\n Node,\n FocusStrategy,\n} from \"@solid2-aria/types-shared\";\nimport type { GlobalDOMAttributes } from \"@solid2-aria/types-shared-web\";\nimport { dynamic } from \"@solidjs/web\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n merge,\n untrack,\n createSignal,\n createContext,\n createMemo,\n useContext,\n omit,\n Show,\n} from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\n\nimport { SelectableCollectionContext, FieldInputContext } from \"./autocomplete\";\nimport type { SelectableCollectionContextValue } from \"./autocomplete\";\nimport { CollectionRendererContext, SectionContext } from \"./collection\";\nimport type {\n CollectionProps,\n ItemRenderProps,\n SectionProps,\n} from \"./collection\";\nimport { OverlayTriggerStateContext } from \"./dialog\";\nimport { HeaderContext } from \"./header\";\nimport { KeyboardContext } from \"./keyboard\";\nimport { PopoverContext } from \"./popover\";\nimport { SelectionIndicatorContext } from \"./selection-indicator\";\nimport { TextContext } from \"./text\";\nimport {\n dom,\n createContextProps,\n createRenderProps,\n createSlot,\n DEFAULT_SLOT,\n createSlottedContext,\n assignRef,\n} from \"./utils\";\nimport type {\n Ref,\n ClassOrFunction,\n DOMRenderProps,\n PossibleLinkDOMRenderProps,\n RenderProps,\n SlotProps,\n StyleProps,\n StyleRenderProps,\n ContextValue,\n} from \"./utils\";\n\nexport const MenuContext =\n createContext<ContextValue<MenuProps<unknown>, HTMLDivElement>>(null);\n\nexport const MenuStateContext = createContext<TreeState<unknown> | null>(null);\n\nexport const RootMenuTriggerStateContext =\n createContext<RootMenuTriggerState | null>(null);\n\nconst SelectionManagerContext = createContext<SelectionManager | null>(null);\n\nconst MenuItemContext = createContext<\n ContextValue<\n MenuItemProps<unknown> & {\n isOpen?: boolean;\n \"aria-haspopup\"?: \"menu\" | \"dialog\";\n \"aria-expanded\"?: boolean | \"true\" | \"false\";\n \"aria-controls\"?: string;\n },\n HTMLDivElement\n >\n>(null);\n\nconst SubmenuContext = createContext<{\n parentMenuRef: Accessor<HTMLElement | null>;\n shouldUseVirtualFocus?: boolean;\n} | null>(null);\n\nconst SubmenuCaptureContext = createContext(false);\n\nexport interface MenuTriggerProps extends BaseMenuTriggerProps {\n children: JSX.Element;\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: JSX.Element[];\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\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 [class](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) 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 class?: ClassOrFunction<MenuRenderProps>;\n /** Provides content to display when there are no items in the menu. */\n renderEmptyState?: () => JSX.Element;\n /** Whether the menu should close when the menu item is selected. */\n shouldCloseOnSelect?: boolean;\n}\n\nexport interface MenuSectionProps<T>\n extends\n SectionProps<T>,\n Omit<MultipleSelection, \"disabledKeys\">,\n DOMRenderProps<\"section\", undefined> {\n /**\n * The CSS [class](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) for the\n * element.\n *\n * @default 'react-aria-MenuSection'\n */\n class?: JSX.ClassValue;\n /** Whether the menu should close when the menu item is selected. */\n shouldCloseOnSelect?: boolean;\n}\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 [class](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) 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 class?: ClassOrFunction<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\nexport interface MenuLoadMoreItemProps\n extends\n Omit<LoadMoreSentinelProps, \"collection\" | \"direction\">,\n StyleProps,\n DOMRenderProps<\"div\", undefined>,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [class](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) for the\n * element.\n *\n * @default 'react-aria-MenuLoadingIndicator'\n */\n class?: JSX.ClassValue;\n /**\n * The load more spinner to render when loading additional items.\n */\n children?: JSX.Element;\n /**\n * Whether or not the loading spinner should be rendered or not.\n */\n isLoading?: boolean;\n}\n\nexport function MenuTrigger(props: MenuTriggerProps): JSX.Element {\n const [scrollRef, setScrollRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n if (createIsHidden()) {\n // oxlint-disable-next-line solid/components-return-once -- Static collection traversal and context registration are fixed when the owner is created.\n return null;\n }\n\n const state = createMenuTriggerState(props);\n\n const [ref, setRef] = createSignal<FocusableElement | null>(null, {\n ownedWrite: true,\n });\n\n const aria = createMenuTrigger(\n mergeProps(props, {\n get type(): \"menu\" {\n return \"menu\";\n },\n }),\n state,\n ref\n );\n\n return (\n <MenuContext\n value={mergeProps(\n merge(() => aria.menuProps ?? {}),\n {\n ref: (element: HTMLDivElement) => {\n setScrollRef(element);\n },\n }\n )}\n >\n <OverlayTriggerStateContext value={state}>\n <RootMenuTriggerStateContext value={state}>\n <PopoverContext\n value={mergeProps(\n {\n get placement(): \"bottom start\" {\n return \"bottom start\";\n },\n scrollRef,\n trigger: \"MenuTrigger\",\n triggerRef: ref,\n },\n {\n get \"aria-labelledby\"() {\n return aria.menuProps[\"aria-labelledby\"];\n },\n get offset() {\n return props.trigger === \"contextMenu\" ? 0 : undefined;\n },\n }\n )}\n >\n <PressResponder\n {\n // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n ...merge(() => aria.menuTriggerProps ?? {})\n // oxlint-enable solid/reactivity\n }\n isPressed={state.isOpen}\n ref={(element) => {\n setRef(element);\n }}\n >\n {props.children}\n </PressResponder>\n </PopoverContext>\n </RootMenuTriggerStateContext>\n </OverlayTriggerStateContext>\n </MenuContext>\n );\n}\n\nexport function Menu<T extends object>(\n input: MenuProps<T> & { ref?: Ref<HTMLDivElement> }\n): JSX.Element {\n const [props, , setRef] = createContextProps(\n input,\n untrack(() => input.ref),\n MenuContext\n );\n\n return (\n <CollectionBuilder\n createCollection={() => new BaseCollection<T>()}\n content={<Collection {...props} />}\n >\n {(collection) => (\n <MenuInner props={props} collection={collection} menuRef={setRef} />\n )}\n </CollectionBuilder>\n );\n}\n\nfunction MenuInner<T extends object>(input: {\n props: MenuProps<T> & SelectableCollectionContextValue<T>;\n collection: BaseCollection<T>;\n menuRef: (element: HTMLDivElement) => void;\n}): JSX.Element {\n const [props, ref, setRef] = createContextProps(\n untrack(() => input.props),\n untrack(() => input.menuRef),\n SelectableCollectionContext\n );\n\n const renderer = useContext(CollectionRendererContext);\n const Root = renderer.CollectionRoot;\n\n const state = createTreeState(\n mergeProps(omit(props, \"items\", \"filter\"), {\n children: undefined,\n get collection() {\n return props.filter\n ? input.collection.filter(props.filter)\n : input.collection;\n },\n })\n );\n\n const trigger =\n useContext(RootMenuTriggerStateContext) ?? createMenuTriggerState({});\n\n const aria = createMenu(\n mergeProps(omit(props, \"items\", \"children\"), {\n get isVirtualized() {\n return renderer.isVirtualized;\n },\n get onClose() {\n return props.onClose ?? trigger.close;\n },\n }),\n state,\n ref\n );\n\n const render = createRenderProps(\n mergeProps(props, {\n children: undefined,\n defaultClass: \"solid2-aria-Menu\",\n values: {\n get isEmpty() {\n return state.collection.size === 0;\n },\n },\n })\n );\n\n return (\n <dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n render,\n merge(() => aria.menuProps ?? {})\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={props.slot ?? undefined}\n data-empty={state.collection.size === 0 || undefined}\n >\n <MenuStateContext value={state}>\n <SelectionManagerContext value={untrack(() => state.selectionManager)}>\n <RootMenuTriggerStateContext value={trigger}>\n <SubmenuContext\n value={{\n parentMenuRef: ref,\n get shouldUseVirtualFocus() {\n return props.shouldUseVirtualFocus;\n },\n }}\n >\n <MenuItemContext\n value={{\n get shouldCloseOnSelect() {\n return props.shouldCloseOnSelect;\n },\n }}\n >\n <SelectableCollectionContext value={null}>\n <FieldInputContext value={null}>\n <SectionContext\n value={{\n name: \"MenuSection\",\n render: (\n sectionProps,\n sectionRef,\n node,\n defaultClass\n ) =>\n MenuSectionInner(\n sectionProps,\n sectionRef,\n node,\n defaultClass\n ),\n }}\n >\n <Root collection={state.collection} scrollRef={ref} />\n </SectionContext>\n </FieldInputContext>\n </SelectableCollectionContext>\n </MenuItemContext>\n </SubmenuContext>\n </RootMenuTriggerStateContext>\n </SelectionManagerContext>\n </MenuStateContext>\n {state.collection.size === 0 && props.renderEmptyState ? (\n <div role=\"menuitem\" style={{ display: \"contents\" }}>\n {props.renderEmptyState()}\n </div>\n ) : null}\n </dom.div>\n );\n}\n\nclass GroupSelectionManager extends SelectionManager {\n private readonly parent: SelectionManager;\n constructor(parent: SelectionManager, state: MultipleSelectionState) {\n super(parent.collection, state);\n this.parent = parent;\n }\n override get focusedKey() {\n return this.parent.focusedKey;\n }\n override get isFocused() {\n return this.parent.isFocused;\n }\n override setFocusedKey(key: Key | null, strategy?: FocusStrategy) {\n this.parent.setFocusedKey(key, strategy);\n }\n override setFocused(value: boolean) {\n this.parent.setFocused(value);\n }\n override get childFocusStrategy() {\n return this.parent.childFocusStrategy;\n }\n}\n\nfunction MenuSectionInner(\n // oxlint-disable-next-line typescript/no-explicit-any -- Collection contexts erase item types; each typed factory restores its owner's item contract.\n props: MenuSectionProps<any>,\n ref: Ref<HTMLElement>,\n node: Node<unknown>,\n defaultClass = \"solid2-aria-MenuSection\"\n): JSX.Element {\n const state = useContext(MenuStateContext);\n const parent = useContext(SelectionManagerContext);\n\n if (!state || !parent) {\n throw new Error(\"MenuSection must be rendered in a Menu.\");\n }\n\n const renderer = useContext(CollectionRendererContext);\n const Branch = renderer.CollectionBranch;\n const [registerHeading, heading] = createSlot();\n\n const aria = createMenuSection({\n get \"aria-label\"() {\n return props[\"aria-label\"] ?? undefined;\n },\n get heading() {\n return heading();\n },\n });\n\n const selection = createMultipleSelectionState(props);\n\n const manager = createMemo(() =>\n props.selectionMode === null || props.selectionMode === undefined\n ? parent\n : new GroupSelectionManager(parent, selection)\n );\n\n const context = createSlottedContext(MenuItemContext);\n\n return (\n <dom.section\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\"),\n merge(() => aria.groupProps ?? {})\n )}\n ref={ref}\n render={props.render}\n class={props.class ?? defaultClass}\n style={props.style}\n >\n <HeaderContext\n value={mergeProps(\n merge(() => aria.headingProps ?? {}),\n { registerSlot: registerHeading }\n )}\n >\n <SelectionManagerContext value={untrack(manager)}>\n <MenuItemContext\n value={{\n get shouldCloseOnSelect() {\n return (\n props.shouldCloseOnSelect ?? context?.shouldCloseOnSelect\n );\n },\n }}\n >\n <Branch collection={state.collection} parent={node} />\n </MenuItemContext>\n </SelectionManagerContext>\n </HeaderContext>\n </dom.section>\n );\n}\n\nconst MenuSectionCollection = createBranchComponent(\n SectionNode,\n MenuSectionInner\n);\n\nconst MenuItemCollection = createLeafComponent(\n ItemNode,\n <T,>(\n input: MenuItemProps<T>,\n forwardedRef: Ref<HTMLDivElement>,\n node: Node<T>\n ): JSX.Element => {\n const [props, ref, setRef] = createContextProps(\n input,\n forwardedRef,\n MenuItemContext\n );\n\n const context = createSlottedContext(MenuItemContext);\n const state = useContext(MenuStateContext);\n\n if (!state) {\n throw new Error(\"MenuItem must be rendered in a Menu.\");\n }\n\n const manager =\n useContext(SelectionManagerContext) ?? state.selectionManager;\n\n const renderer = useContext(CollectionRendererContext);\n\n const aria = createMenuItem(\n mergeProps(\n omit(props, \"id\", \"onAction\"),\n context\n ? // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n omit(context, \"id\", \"onAction\")\n : // oxlint-enable solid/reactivity\n undefined,\n {\n get isVirtualized() {\n return renderer.isVirtualized;\n },\n get key() {\n return node.key;\n },\n selectionManager: manager,\n }\n ),\n state,\n ref\n );\n\n const hover = createHover(\n mergeProps(props, {\n get isDisabled() {\n return aria.isDisabled;\n },\n })\n );\n\n const values: MenuItemRenderProps = {\n get hasSubmenu() {\n return !!context?.[\"aria-haspopup\"];\n },\n get isDisabled() {\n return aria.isDisabled;\n },\n get isFocusVisible() {\n return aria.isFocusVisible;\n },\n get isFocused() {\n return aria.isFocused;\n },\n get isHovered() {\n return hover.isHovered;\n },\n get isOpen() {\n return context?.isOpen === true;\n },\n get isPressed() {\n return aria.isPressed;\n },\n get isSelected() {\n return aria.isSelected;\n },\n get selectionBehavior() {\n return manager.selectionBehavior;\n },\n get selectionMode() {\n return manager.selectionMode;\n },\n };\n\n const render = createRenderProps(\n mergeProps(props, { defaultClass: \"solid2-aria-MenuItem\", values })\n );\n\n const Element = dynamic(() => (isTruthy(props.href) ? dom.a : dom.div));\n\n return (\n <Element\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\"),\n render,\n merge(() => aria.menuItemProps ?? {}),\n merge(() => hover.hoverProps ?? {})\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n data-selected={aria.isSelected || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-hovered={hover.isHovered || undefined}\n data-focused={aria.isFocused || undefined}\n data-focus-visible={aria.isFocusVisible || undefined}\n data-pressed={aria.isPressed || undefined}\n data-has-submenu={values.hasSubmenu || undefined}\n data-open={values.isOpen || undefined}\n data-selection-mode={\n manager.selectionMode === \"none\" ? undefined : manager.selectionMode\n }\n >\n <TextContext\n value={{\n slots: {\n get [DEFAULT_SLOT]() {\n return aria.labelProps;\n },\n get description() {\n return aria.descriptionProps;\n },\n get label() {\n return aria.labelProps;\n },\n },\n }}\n >\n <KeyboardContext value={aria.keyboardShortcutProps}>\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return aria.isSelected;\n },\n }}\n >\n {render.children}\n </SelectionIndicatorContext>\n </KeyboardContext>\n </TextContext>\n </Element>\n );\n }\n);\n\nclass SubmenuTriggerNode extends CollectionNode<unknown> {\n static override readonly type = \"submenutrigger\";\n override filter(\n collection: BaseCollection<unknown>,\n target: BaseCollection<unknown>,\n filter: (text: string, node: Node<unknown>) => boolean\n ): this | null {\n const item =\n this.firstChildKey === null || this.firstChildKey === undefined\n ? null\n : collection.getItem(this.firstChildKey);\n\n if (item && filter(item.textValue, this)) {\n const clone = this.clone();\n target.addDescendants(clone, collection);\n\n return clone;\n }\n\n return null;\n }\n}\n\nconst SubmenuTriggerCollection = createBranchComponent(\n SubmenuTriggerNode,\n (\n props: SubmenuTriggerProps & { renderPopover: () => JSX.Element },\n forwardedRef: Ref<HTMLDivElement>,\n item: Node<unknown>\n ): JSX.Element => {\n const [submenuRef, setSubmenuRef] = createSignal<HTMLDivElement | null>(\n null,\n { ownedWrite: true }\n );\n\n const state = useContext(MenuStateContext);\n const root = useContext(RootMenuTriggerStateContext);\n const parent = useContext(SubmenuContext);\n\n if (!state || !root || !parent) {\n throw new Error(\"SubmenuTrigger must be rendered in a Menu.\");\n }\n\n const renderer = useContext(CollectionRendererContext);\n const Branch = renderer.CollectionBranch;\n const trigger = createSubmenuTriggerState({ triggerKey: item.key }, root);\n\n const [itemRef, setItemRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const aria = createSubmenuTrigger(\n mergeProps(props, parent, { submenuRef }),\n trigger,\n itemRef\n );\n\n return (\n <MenuItemContext\n value={mergeProps(\n merge(() => aria.submenuTriggerProps ?? {}),\n {\n onAction: undefined,\n ref: (element: HTMLDivElement) => {\n setItemRef(element);\n },\n }\n )}\n >\n <MenuContext\n value={mergeProps(\n merge(() => aria.submenuProps ?? {}),\n {\n ref: (element: HTMLDivElement) => {\n setSubmenuRef(element);\n },\n }\n )}\n >\n <OverlayTriggerStateContext value={trigger}>\n <PopoverContext\n value={mergeProps(\n merge(() => aria.popoverProps ?? {}),\n {\n get \"aria-labelledby\"() {\n return aria.submenuProps[\"aria-labelledby\"];\n },\n get placement(): \"end top\" {\n return \"end top\";\n },\n trigger: \"SubmenuTrigger\",\n triggerRef: itemRef,\n }\n )}\n >\n <Branch collection={state.collection} parent={item} />\n <SubmenuCaptureContext value={true}>\n {props.renderPopover()}\n </SubmenuCaptureContext>\n </PopoverContext>\n </OverlayTriggerStateContext>\n </MenuContext>\n </MenuItemContext>\n );\n },\n (props) => untrack(() => props.children[0])\n);\n\nconst MenuLoadMoreItemCollection = createLeafComponent(\n LoaderNode,\n (\n props: MenuLoadMoreItemProps,\n forwardedRef: Ref<HTMLDivElement>,\n _node: Node<unknown>\n ): JSX.Element => {\n const state = useContext(MenuStateContext);\n\n if (!state) {\n throw new Error(\"MenuLoadMoreItem must be rendered in a Menu.\");\n }\n\n const [sentinel, setSentinel] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n createLoadMoreSentinel(\n mergeProps(props, {\n get collection() {\n return state.collection;\n },\n }),\n sentinel\n );\n\n const render = createRenderProps(\n mergeProps(props, {\n defaultClass: \"solid2-aria-MenuLoadingIndicator\",\n values: undefined,\n })\n );\n\n return (\n <>\n <div style={{ height: 0, position: \"relative\", width: 0 }} inert>\n <div\n data-testid=\"loadMoreSentinel\"\n ref={(element: HTMLDivElement) => {\n setSentinel(element);\n }}\n style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}\n />\n </div>\n <Show when={props.isLoading}>\n <dom.div\n {...filterDOMProps(props, { global: true })}\n {...render}\n ref={(element: HTMLDivElement) => {\n assignRef(forwardedRef, element);\n }}\n role=\"menuitem\"\n tabindex={-1}\n >\n {render.children}\n </dom.div>\n </Show>\n </>\n );\n }\n);\n\nexport function MenuSection<T>(\n props: MenuSectionProps<T> & { ref?: Ref<HTMLElement> }\n): JSX.Element {\n return (\n <MenuSectionCollection\n {...props}\n ref={(element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />\n );\n}\n\nexport function MenuItem<T>(\n props: MenuItemProps<T> & { ref?: Ref<HTMLDivElement> }\n): JSX.Element {\n if (useContext(SubmenuCaptureContext) && !createIsHidden()) {\n // oxlint-disable-next-line solid/components-return-once -- Static collection traversal and context registration are fixed when the owner is created.\n return null;\n }\n\n return (\n <MenuItemCollection\n {...props}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />\n );\n}\n\nexport function SubmenuTrigger(\n props: SubmenuTriggerProps & { ref?: Ref<HTMLDivElement> }\n): JSX.Element {\n return (\n <SubmenuTriggerCollection\n {...props}\n renderPopover={() => props.children[1]}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />\n );\n}\n\nexport function MenuLoadMoreItem(\n props: MenuLoadMoreItemProps & { ref?: Ref<HTMLDivElement> }\n): JSX.Element {\n return (\n <MenuLoadMoreItemCollection\n {...props}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />\n );\n}\n"],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YAA4B;EAChC,UACE,cAAc,MAAM,GAAG,GACvB,OACF;CACF,EACD,CAAA,CAAA;AAEL"}
1
+ {"version":3,"file":"menu.js","names":["{state.collection.size === 0 && props.renderEmptyState ? (\n <div role=\"menuitem\" style={{ display: \"contents\" }}>\n {props.renderEmptyState()}\n </div>\n ) : null}","{props.renderEmptyState()}","props.renderEmptyState()","<div role=\"menuitem\" style={{ display: \"contents\" }}>\n {props.renderEmptyState()}\n </div>","style={{ display: \"contents\" }}","manager.selectionMode === \"none\" ? undefined : manager.selectionMode","menuRef={setRef}","dom.div","<dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n render,\n merge(() => aria.menuProps ?? {})\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={props.slot ?? undefined}\n data-empty={state.collection.size === 0 || undefined}\n >\n <MenuStateContext value={state}>\n <SelectionManagerContext value={untrack(() => state.selectionManager)}>\n <RootMenuTriggerStateContext value={trigger}>\n <SubmenuContext\n value={{\n parentMenuRef: ref,\n get shouldUseVirtualFocus() {\n return props.shouldUseVirtualFocus;\n },\n }}\n >\n <MenuItemContext\n value={{\n get shouldCloseOnSelect() {\n return props.shouldCloseOnSelect;\n },\n }}\n >\n <SelectableCollectionContext value={null}>\n <FieldInputContext value={null}>\n <SectionContext\n value={{\n name: \"MenuSection\",\n render: (\n sectionProps,\n sectionRef,\n node,\n defaultClass\n ) =>\n MenuSectionInner(\n sectionProps,\n sectionRef,\n node,\n defaultClass\n ),\n }}\n >\n <Root collection={state.collection} scrollRef={ref} />\n </SectionContext>\n </FieldInputContext>\n </SelectableCollectionContext>\n </MenuItemContext>\n </SubmenuContext>\n </RootMenuTriggerStateContext>\n </SelectionManagerContext>\n </MenuStateContext>\n {state.collection.size === 0 && props.renderEmptyState ? (\n <div role=\"menuitem\" style={{ display: \"contents\" }}>\n {props.renderEmptyState()}\n </div>\n ) : null}\n </dom.div>","dom.section","<dom.section\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\"),\n merge(() => aria.groupProps ?? {})\n )}\n ref={ref}\n render={props.render}\n class={props.class ?? defaultClass}\n style={props.style}\n >\n <HeaderContext\n value={mergeProps(\n merge(() => aria.headingProps ?? {}),\n { registerSlot: registerHeading }\n )}\n >\n <SelectionManagerContext value={untrack(manager)}>\n <MenuItemContext\n value={{\n get shouldCloseOnSelect() {\n return (\n props.shouldCloseOnSelect ?? context?.shouldCloseOnSelect\n );\n },\n }}\n >\n <Branch collection={state.collection} parent={node} />\n </MenuItemContext>\n </SelectionManagerContext>\n </HeaderContext>\n </dom.section>","ref={ref}","<Element\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\"),\n render,\n merge(() => aria.menuItemProps ?? {}),\n merge(() => hover.hoverProps ?? {})\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n data-selected={aria.isSelected || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-hovered={hover.isHovered || undefined}\n data-focused={aria.isFocused || undefined}\n data-focus-visible={aria.isFocusVisible || undefined}\n data-pressed={aria.isPressed || undefined}\n data-has-submenu={values.hasSubmenu || undefined}\n data-open={values.isOpen || undefined}\n data-selection-mode={\n manager.selectionMode === \"none\" ? undefined : manager.selectionMode\n }\n >\n <TextContext\n value={{\n slots: {\n get [DEFAULT_SLOT]() {\n return aria.labelProps;\n },\n get description() {\n return aria.descriptionProps;\n },\n get label() {\n return aria.labelProps;\n },\n },\n }}\n >\n <KeyboardContext value={aria.keyboardShortcutProps}>\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return aria.isSelected;\n },\n }}\n >\n {render.children}\n </SelectionIndicatorContext>\n </KeyboardContext>\n </TextContext>\n </Element>","<div style={{ height: 0, position: \"relative\", width: 0 }} inert>\n <div\n data-testid=\"loadMoreSentinel\"\n ref={(element: HTMLDivElement) => {\n setSentinel(element);\n }}\n style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}\n />\n </div>","style={{ height: 0, position: \"relative\", width: 0 }}","style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}","<Show when={props.isLoading}>\n <dom.div\n {...filterDOMProps(props, { global: true })}\n {...render}\n ref={(element: HTMLDivElement) => {\n assignRef(forwardedRef, element);\n }}\n role=\"menuitem\"\n tabindex={-1}\n >\n {render.children}\n </dom.div>\n </Show>","<dom.div\n {...filterDOMProps(props, { global: true })}\n {...render}\n ref={(element: HTMLDivElement) => {\n assignRef(forwardedRef, element);\n }}\n role=\"menuitem\"\n tabindex={-1}\n >\n {render.children}\n </dom.div>","<MenuSectionCollection\n {...props}\n ref={(element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />","ref={(element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}","<MenuItemCollection\n {...props}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />","ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}","<SubmenuTriggerCollection\n {...props}\n renderPopover={() => props.children[1]}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />","renderPopover={() => props.children[1]}","<MenuLoadMoreItemCollection\n {...props}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />","_$mergeProps","_$memo","_$ssrHydrationKey","_$scope","_$escape","_$ssr","_$ssrStyleProperty","_$applyRef","_$ssrStyleProperties"],"sources":["../../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/*\n * Derived from Adobe React Spectrum: packages/react-aria-components/src/Menu.tsx.\n * Modified for Solid Aria: adapted collection ownership, contexts, accessibility primitives, and reactive properties for Solid 2; uses Solid class props and press responders for custom triggers.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport {\n ItemNode,\n SectionNode,\n LoaderNode,\n CollectionNode,\n BaseCollection,\n} from \"@solid2-aria/core/collections/base-collection\";\nimport {\n Collection,\n CollectionBuilder,\n createLeafComponent,\n createBranchComponent,\n} from \"@solid2-aria/core/collections/collection-builder\";\nimport { createIsHidden } from \"@solid2-aria/core/collections/hidden\";\nimport { createHover } from \"@solid2-aria/core/interactions/create-hover\";\nimport { PressResponder } from \"@solid2-aria/core/interactions/press-responder\";\nimport { createMenu } from \"@solid2-aria/core/menu/create-menu\";\nimport type { AriaMenuProps } from \"@solid2-aria/core/menu/create-menu\";\nimport { createMenuItem } from \"@solid2-aria/core/menu/create-menu-item\";\nimport { createMenuSection } from \"@solid2-aria/core/menu/create-menu-section\";\nimport { createMenuTrigger } from \"@solid2-aria/core/menu/create-menu-trigger\";\nimport { createSubmenuTrigger } from \"@solid2-aria/core/menu/create-submenu-trigger\";\nimport { createLoadMoreSentinel } from \"@solid2-aria/core/utils/create-load-more-sentinel\";\nimport type { LoadMoreSentinelProps } from \"@solid2-aria/core/utils/create-load-more-sentinel\";\nimport { filterDOMProps } from \"@solid2-aria/core/utils/filter-dom-props\";\nimport { mergeProps } from \"@solid2-aria/core/utils/merge-props\";\nimport { isTruthy } from \"@solid2-aria/core/utils/truthy\";\nimport { createMenuTriggerState } from \"@solid2-aria/stately/menu/create-menu-trigger-state\";\nimport type {\n MenuTriggerProps as BaseMenuTriggerProps,\n RootMenuTriggerState,\n} from \"@solid2-aria/stately/menu/create-menu-trigger-state\";\nimport { createSubmenuTriggerState } from \"@solid2-aria/stately/menu/create-submenu-trigger-state\";\nimport { createMultipleSelectionState } from \"@solid2-aria/stately/selection/create-multiple-selection-state\";\nimport { SelectionManager } from \"@solid2-aria/stately/selection/selection-manager\";\nimport type { MultipleSelectionState } from \"@solid2-aria/stately/selection/types\";\nimport { createTreeState } from \"@solid2-aria/stately/tree/create-tree-state\";\nimport type { TreeState } from \"@solid2-aria/stately/tree/create-tree-state\";\nimport type {\n FocusableElement,\n FocusEvents,\n HoverEvents,\n Key,\n LinkDOMProps,\n MultipleSelection,\n PressEvents,\n Node,\n FocusStrategy,\n} from \"@solid2-aria/types-shared\";\nimport type { GlobalDOMAttributes } from \"@solid2-aria/types-shared-web\";\nimport { dynamic } from \"@solidjs/web\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n merge,\n untrack,\n createSignal,\n createContext,\n createMemo,\n useContext,\n omit,\n Show,\n} from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\n\nimport { SelectableCollectionContext, FieldInputContext } from \"./autocomplete\";\nimport type { SelectableCollectionContextValue } from \"./autocomplete\";\nimport { CollectionRendererContext, SectionContext } from \"./collection\";\nimport type {\n CollectionProps,\n ItemRenderProps,\n SectionProps,\n} from \"./collection\";\nimport { OverlayTriggerStateContext } from \"./dialog\";\nimport { HeaderContext } from \"./header\";\nimport { KeyboardContext } from \"./keyboard\";\nimport { PopoverContext } from \"./popover\";\nimport { SelectionIndicatorContext } from \"./selection-indicator\";\nimport { TextContext } from \"./text\";\nimport {\n dom,\n createContextProps,\n createRenderProps,\n createSlot,\n DEFAULT_SLOT,\n createSlottedContext,\n assignRef,\n} from \"./utils\";\nimport type {\n Ref,\n ClassOrFunction,\n DOMRenderProps,\n PossibleLinkDOMRenderProps,\n RenderProps,\n SlotProps,\n StyleProps,\n StyleRenderProps,\n ContextValue,\n} from \"./utils\";\n\nexport const MenuContext =\n createContext<ContextValue<MenuProps<unknown>, HTMLDivElement>>(null);\n\nexport const MenuStateContext = createContext<TreeState<unknown> | null>(null);\n\nexport const RootMenuTriggerStateContext =\n createContext<RootMenuTriggerState | null>(null);\n\nconst SelectionManagerContext = createContext<SelectionManager | null>(null);\n\nconst MenuItemContext = createContext<\n ContextValue<\n MenuItemProps<unknown> & {\n isOpen?: boolean;\n \"aria-haspopup\"?: \"menu\" | \"dialog\";\n \"aria-expanded\"?: boolean | \"true\" | \"false\";\n \"aria-controls\"?: string;\n },\n HTMLDivElement\n >\n>(null);\n\nconst SubmenuContext = createContext<{\n parentMenuRef: Accessor<HTMLElement | null>;\n shouldUseVirtualFocus?: boolean;\n} | null>(null);\n\nconst SubmenuCaptureContext = createContext(false);\n\nexport interface MenuTriggerProps extends BaseMenuTriggerProps {\n children: JSX.Element;\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: JSX.Element[];\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\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 [class](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) 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 class?: ClassOrFunction<MenuRenderProps>;\n /** Provides content to display when there are no items in the menu. */\n renderEmptyState?: () => JSX.Element;\n /** Whether the menu should close when the menu item is selected. */\n shouldCloseOnSelect?: boolean;\n}\n\nexport interface MenuSectionProps<T>\n extends\n SectionProps<T>,\n Omit<MultipleSelection, \"disabledKeys\">,\n DOMRenderProps<\"section\", undefined> {\n /**\n * The CSS [class](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) for the\n * element.\n *\n * @default 'react-aria-MenuSection'\n */\n class?: JSX.ClassValue;\n /** Whether the menu should close when the menu item is selected. */\n shouldCloseOnSelect?: boolean;\n}\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 [class](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) 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 class?: ClassOrFunction<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\nexport interface MenuLoadMoreItemProps\n extends\n Omit<LoadMoreSentinelProps, \"collection\" | \"direction\">,\n StyleProps,\n DOMRenderProps<\"div\", undefined>,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [class](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) for the\n * element.\n *\n * @default 'react-aria-MenuLoadingIndicator'\n */\n class?: JSX.ClassValue;\n /**\n * The load more spinner to render when loading additional items.\n */\n children?: JSX.Element;\n /**\n * Whether or not the loading spinner should be rendered or not.\n */\n isLoading?: boolean;\n}\n\nexport function MenuTrigger(props: MenuTriggerProps): JSX.Element {\n const [scrollRef, setScrollRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n if (createIsHidden()) {\n // oxlint-disable-next-line solid/components-return-once -- Static collection traversal and context registration are fixed when the owner is created.\n return null;\n }\n\n const state = createMenuTriggerState(props);\n\n const [ref, setRef] = createSignal<FocusableElement | null>(null, {\n ownedWrite: true,\n });\n\n const aria = createMenuTrigger(\n mergeProps(props, {\n get type(): \"menu\" {\n return \"menu\";\n },\n }),\n state,\n ref\n );\n\n return (\n <MenuContext\n value={mergeProps(\n merge(() => aria.menuProps ?? {}),\n {\n ref: (element: HTMLDivElement) => {\n setScrollRef(element);\n },\n }\n )}\n >\n <OverlayTriggerStateContext value={state}>\n <RootMenuTriggerStateContext value={state}>\n <PopoverContext\n value={mergeProps(\n {\n get placement(): \"bottom start\" {\n return \"bottom start\";\n },\n scrollRef,\n trigger: \"MenuTrigger\",\n triggerRef: ref,\n },\n {\n get \"aria-labelledby\"() {\n return aria.menuProps[\"aria-labelledby\"];\n },\n get offset() {\n return props.trigger === \"contextMenu\" ? 0 : undefined;\n },\n }\n )}\n >\n <PressResponder\n {\n // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n ...merge(() => aria.menuTriggerProps ?? {})\n // oxlint-enable solid/reactivity\n }\n isPressed={state.isOpen}\n ref={(element) => {\n setRef(element);\n }}\n >\n {props.children}\n </PressResponder>\n </PopoverContext>\n </RootMenuTriggerStateContext>\n </OverlayTriggerStateContext>\n </MenuContext>\n );\n}\n\nexport function Menu<T extends object>(\n input: MenuProps<T> & { ref?: Ref<HTMLDivElement> }\n): JSX.Element {\n const [props, , setRef] = createContextProps(\n input,\n untrack(() => input.ref),\n MenuContext\n );\n\n return (\n <CollectionBuilder\n createCollection={() => new BaseCollection<T>()}\n content={<Collection {...props} />}\n >\n {(collection) => (\n <MenuInner props={props} collection={collection} menuRef={setRef} />\n )}\n </CollectionBuilder>\n );\n}\n\nfunction MenuInner<T extends object>(input: {\n props: MenuProps<T> & SelectableCollectionContextValue<T>;\n collection: BaseCollection<T>;\n menuRef: (element: HTMLDivElement) => void;\n}): JSX.Element {\n const [props, ref, setRef] = createContextProps(\n untrack(() => input.props),\n untrack(() => input.menuRef),\n SelectableCollectionContext\n );\n\n const renderer = useContext(CollectionRendererContext);\n const Root = renderer.CollectionRoot;\n\n const state = createTreeState(\n mergeProps(omit(props, \"items\", \"filter\"), {\n children: undefined,\n get collection() {\n return props.filter\n ? input.collection.filter(props.filter)\n : input.collection;\n },\n })\n );\n\n const trigger =\n useContext(RootMenuTriggerStateContext) ?? createMenuTriggerState({});\n\n const aria = createMenu(\n mergeProps(omit(props, \"items\", \"children\"), {\n get isVirtualized() {\n return renderer.isVirtualized;\n },\n get onClose() {\n return props.onClose ?? trigger.close;\n },\n }),\n state,\n ref\n );\n\n const render = createRenderProps(\n mergeProps(props, {\n children: undefined,\n defaultClass: \"solid2-aria-Menu\",\n values: {\n get isEmpty() {\n return state.collection.size === 0;\n },\n },\n })\n );\n\n return (\n <dom.div\n {...mergeProps(\n filterDOMProps(props, { global: true }),\n render,\n merge(() => aria.menuProps ?? {})\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n slot={props.slot ?? undefined}\n data-empty={state.collection.size === 0 || undefined}\n >\n <MenuStateContext value={state}>\n <SelectionManagerContext value={untrack(() => state.selectionManager)}>\n <RootMenuTriggerStateContext value={trigger}>\n <SubmenuContext\n value={{\n parentMenuRef: ref,\n get shouldUseVirtualFocus() {\n return props.shouldUseVirtualFocus;\n },\n }}\n >\n <MenuItemContext\n value={{\n get shouldCloseOnSelect() {\n return props.shouldCloseOnSelect;\n },\n }}\n >\n <SelectableCollectionContext value={null}>\n <FieldInputContext value={null}>\n <SectionContext\n value={{\n name: \"MenuSection\",\n render: (\n sectionProps,\n sectionRef,\n node,\n defaultClass\n ) =>\n MenuSectionInner(\n sectionProps,\n sectionRef,\n node,\n defaultClass\n ),\n }}\n >\n <Root collection={state.collection} scrollRef={ref} />\n </SectionContext>\n </FieldInputContext>\n </SelectableCollectionContext>\n </MenuItemContext>\n </SubmenuContext>\n </RootMenuTriggerStateContext>\n </SelectionManagerContext>\n </MenuStateContext>\n {state.collection.size === 0 && props.renderEmptyState ? (\n <div role=\"menuitem\" style={{ display: \"contents\" }}>\n {props.renderEmptyState()}\n </div>\n ) : null}\n </dom.div>\n );\n}\n\nclass GroupSelectionManager extends SelectionManager {\n private readonly parent: SelectionManager;\n constructor(parent: SelectionManager, state: MultipleSelectionState) {\n super(parent.collection, state);\n this.parent = parent;\n }\n override get focusedKey() {\n return this.parent.focusedKey;\n }\n override get isFocused() {\n return this.parent.isFocused;\n }\n override setFocusedKey(key: Key | null, strategy?: FocusStrategy) {\n this.parent.setFocusedKey(key, strategy);\n }\n override setFocused(value: boolean) {\n this.parent.setFocused(value);\n }\n override get childFocusStrategy() {\n return this.parent.childFocusStrategy;\n }\n}\n\nfunction MenuSectionInner(\n // oxlint-disable-next-line typescript/no-explicit-any -- Collection contexts erase item types; each typed factory restores its owner's item contract.\n props: MenuSectionProps<any>,\n ref: Ref<HTMLElement>,\n node: Node<unknown>,\n defaultClass = \"solid2-aria-MenuSection\"\n): JSX.Element {\n const state = useContext(MenuStateContext);\n const parent = useContext(SelectionManagerContext);\n\n if (!state || !parent) {\n throw new Error(\"MenuSection must be rendered in a Menu.\");\n }\n\n const renderer = useContext(CollectionRendererContext);\n const Branch = renderer.CollectionBranch;\n const [registerHeading, heading] = createSlot();\n\n const aria = createMenuSection({\n get \"aria-label\"() {\n return props[\"aria-label\"] ?? undefined;\n },\n get heading() {\n return heading();\n },\n });\n\n const selection = createMultipleSelectionState(props);\n\n const manager = createMemo(() =>\n props.selectionMode === null || props.selectionMode === undefined\n ? parent\n : new GroupSelectionManager(parent, selection)\n );\n\n const context = createSlottedContext(MenuItemContext);\n\n return (\n <dom.section\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\"),\n merge(() => aria.groupProps ?? {})\n )}\n ref={ref}\n render={props.render}\n class={props.class ?? defaultClass}\n style={props.style}\n >\n <HeaderContext\n value={mergeProps(\n merge(() => aria.headingProps ?? {}),\n { registerSlot: registerHeading }\n )}\n >\n <SelectionManagerContext value={untrack(manager)}>\n <MenuItemContext\n value={{\n get shouldCloseOnSelect() {\n return (\n props.shouldCloseOnSelect ?? context?.shouldCloseOnSelect\n );\n },\n }}\n >\n <Branch collection={state.collection} parent={node} />\n </MenuItemContext>\n </SelectionManagerContext>\n </HeaderContext>\n </dom.section>\n );\n}\n\nconst MenuSectionCollection = createBranchComponent(\n SectionNode,\n MenuSectionInner\n);\n\nconst MenuItemCollection = createLeafComponent(\n ItemNode,\n <T,>(\n input: MenuItemProps<T>,\n forwardedRef: Ref<HTMLDivElement>,\n node: Node<T>\n ): JSX.Element => {\n const [props, ref, setRef] = createContextProps(\n input,\n forwardedRef,\n MenuItemContext\n );\n\n const context = createSlottedContext(MenuItemContext);\n const state = useContext(MenuStateContext);\n\n if (!state) {\n throw new Error(\"MenuItem must be rendered in a Menu.\");\n }\n\n const manager =\n useContext(SelectionManagerContext) ?? state.selectionManager;\n\n const renderer = useContext(CollectionRendererContext);\n\n const aria = createMenuItem(\n mergeProps(\n omit(props, \"id\", \"onAction\"),\n context\n ? // oxlint-disable solid/reactivity -- Keep prop filtering in the renderer's lazy evaluation.\n omit(context, \"id\", \"onAction\")\n : // oxlint-enable solid/reactivity\n undefined,\n {\n get isVirtualized() {\n return renderer.isVirtualized;\n },\n get key() {\n return node.key;\n },\n selectionManager: manager,\n }\n ),\n state,\n ref\n );\n\n const hover = createHover(\n mergeProps(props, {\n get isDisabled() {\n return aria.isDisabled;\n },\n })\n );\n\n const values: MenuItemRenderProps = {\n get hasSubmenu() {\n return !!context?.[\"aria-haspopup\"];\n },\n get isDisabled() {\n return aria.isDisabled;\n },\n get isFocusVisible() {\n return aria.isFocusVisible;\n },\n get isFocused() {\n return aria.isFocused;\n },\n get isHovered() {\n return hover.isHovered;\n },\n get isOpen() {\n return context?.isOpen === true;\n },\n get isPressed() {\n return aria.isPressed;\n },\n get isSelected() {\n return aria.isSelected;\n },\n get selectionBehavior() {\n return manager.selectionBehavior;\n },\n get selectionMode() {\n return manager.selectionMode;\n },\n };\n\n const render = createRenderProps(\n mergeProps(props, { defaultClass: \"solid2-aria-MenuItem\", values })\n );\n\n const Element = dynamic(() => (isTruthy(props.href) ? dom.a : dom.div));\n\n return (\n <Element\n {...mergeProps(\n omit(filterDOMProps(props, { global: true }), \"id\", \"onClick\"),\n render,\n merge(() => aria.menuItemProps ?? {}),\n merge(() => hover.hoverProps ?? {})\n )}\n ref={(element: HTMLDivElement) => {\n setRef(element);\n }}\n data-selected={aria.isSelected || undefined}\n data-disabled={aria.isDisabled || undefined}\n data-hovered={hover.isHovered || undefined}\n data-focused={aria.isFocused || undefined}\n data-focus-visible={aria.isFocusVisible || undefined}\n data-pressed={aria.isPressed || undefined}\n data-has-submenu={values.hasSubmenu || undefined}\n data-open={values.isOpen || undefined}\n data-selection-mode={\n manager.selectionMode === \"none\" ? undefined : manager.selectionMode\n }\n >\n <TextContext\n value={{\n slots: {\n get [DEFAULT_SLOT]() {\n return aria.labelProps;\n },\n get description() {\n return aria.descriptionProps;\n },\n get label() {\n return aria.labelProps;\n },\n },\n }}\n >\n <KeyboardContext value={aria.keyboardShortcutProps}>\n <SelectionIndicatorContext\n value={{\n get isSelected() {\n return aria.isSelected;\n },\n }}\n >\n {render.children}\n </SelectionIndicatorContext>\n </KeyboardContext>\n </TextContext>\n </Element>\n );\n }\n);\n\nclass SubmenuTriggerNode extends CollectionNode<unknown> {\n static override readonly type = \"submenutrigger\";\n override filter(\n collection: BaseCollection<unknown>,\n target: BaseCollection<unknown>,\n filter: (text: string, node: Node<unknown>) => boolean\n ): this | null {\n const item =\n this.firstChildKey === null || this.firstChildKey === undefined\n ? null\n : collection.getItem(this.firstChildKey);\n\n if (item && filter(item.textValue, this)) {\n const clone = this.clone();\n target.addDescendants(clone, collection);\n\n return clone;\n }\n\n return null;\n }\n}\n\nconst SubmenuTriggerCollection = createBranchComponent(\n SubmenuTriggerNode,\n (\n props: SubmenuTriggerProps & { renderPopover: () => JSX.Element },\n forwardedRef: Ref<HTMLDivElement>,\n item: Node<unknown>\n ): JSX.Element => {\n const [submenuRef, setSubmenuRef] = createSignal<HTMLDivElement | null>(\n null,\n { ownedWrite: true }\n );\n\n const state = useContext(MenuStateContext);\n const root = useContext(RootMenuTriggerStateContext);\n const parent = useContext(SubmenuContext);\n\n if (!state || !root || !parent) {\n throw new Error(\"SubmenuTrigger must be rendered in a Menu.\");\n }\n\n const renderer = useContext(CollectionRendererContext);\n const Branch = renderer.CollectionBranch;\n const trigger = createSubmenuTriggerState({ triggerKey: item.key }, root);\n\n const [itemRef, setItemRef] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n const aria = createSubmenuTrigger(\n mergeProps(props, parent, { submenuRef }),\n trigger,\n itemRef\n );\n\n return (\n <MenuItemContext\n value={mergeProps(\n merge(() => aria.submenuTriggerProps ?? {}),\n {\n onAction: undefined,\n ref: (element: HTMLDivElement) => {\n setItemRef(element);\n },\n }\n )}\n >\n <MenuContext\n value={mergeProps(\n merge(() => aria.submenuProps ?? {}),\n {\n ref: (element: HTMLDivElement) => {\n setSubmenuRef(element);\n },\n }\n )}\n >\n <OverlayTriggerStateContext value={trigger}>\n <PopoverContext\n value={mergeProps(\n merge(() => aria.popoverProps ?? {}),\n {\n get \"aria-labelledby\"() {\n return aria.submenuProps[\"aria-labelledby\"];\n },\n get placement(): \"end top\" {\n return \"end top\";\n },\n trigger: \"SubmenuTrigger\",\n triggerRef: itemRef,\n }\n )}\n >\n <Branch collection={state.collection} parent={item} />\n <SubmenuCaptureContext value={true}>\n {props.renderPopover()}\n </SubmenuCaptureContext>\n </PopoverContext>\n </OverlayTriggerStateContext>\n </MenuContext>\n </MenuItemContext>\n );\n },\n (props) => untrack(() => props.children[0])\n);\n\nconst MenuLoadMoreItemCollection = createLeafComponent(\n LoaderNode,\n (\n props: MenuLoadMoreItemProps,\n forwardedRef: Ref<HTMLDivElement>,\n _node: Node<unknown>\n ): JSX.Element => {\n const state = useContext(MenuStateContext);\n\n if (!state) {\n throw new Error(\"MenuLoadMoreItem must be rendered in a Menu.\");\n }\n\n const [sentinel, setSentinel] = createSignal<HTMLDivElement | null>(null, {\n ownedWrite: true,\n });\n\n createLoadMoreSentinel(\n mergeProps(props, {\n get collection() {\n return state.collection;\n },\n }),\n sentinel\n );\n\n const render = createRenderProps(\n mergeProps(props, {\n defaultClass: \"solid2-aria-MenuLoadingIndicator\",\n values: undefined,\n })\n );\n\n return (\n <>\n <div style={{ height: 0, position: \"relative\", width: 0 }} inert>\n <div\n data-testid=\"loadMoreSentinel\"\n ref={(element: HTMLDivElement) => {\n setSentinel(element);\n }}\n style={{ height: \"1px\", position: \"absolute\", width: \"1px\" }}\n />\n </div>\n <Show when={props.isLoading}>\n <dom.div\n {...filterDOMProps(props, { global: true })}\n {...render}\n ref={(element: HTMLDivElement) => {\n assignRef(forwardedRef, element);\n }}\n role=\"menuitem\"\n tabindex={-1}\n >\n {render.children}\n </dom.div>\n </Show>\n </>\n );\n }\n);\n\nexport function MenuSection<T>(\n props: MenuSectionProps<T> & { ref?: Ref<HTMLElement> }\n): JSX.Element {\n return (\n <MenuSectionCollection\n {...props}\n ref={(element: HTMLElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />\n );\n}\n\nexport function MenuItem<T>(\n props: MenuItemProps<T> & { ref?: Ref<HTMLDivElement> }\n): JSX.Element {\n if (useContext(SubmenuCaptureContext) && !createIsHidden()) {\n // oxlint-disable-next-line solid/components-return-once -- Static collection traversal and context registration are fixed when the owner is created.\n return null;\n }\n\n return (\n <MenuItemCollection\n {...props}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />\n );\n}\n\nexport function SubmenuTrigger(\n props: SubmenuTriggerProps & { ref?: Ref<HTMLDivElement> }\n): JSX.Element {\n return (\n <SubmenuTriggerCollection\n {...props}\n renderPopover={() => props.children[1]}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />\n );\n}\n\nexport function MenuLoadMoreItem(\n props: MenuLoadMoreItemProps & { ref?: Ref<HTMLDivElement> }\n): JSX.Element {\n return (\n <MenuLoadMoreItemCollection\n {...props}\n ref={(element: HTMLDivElement) => {\n assignRef(\n untrack(() => props.ref),\n element\n );\n }}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0Vc,O,SAAW,CAAM;;;;;;;EAKjB,O,UAAC,CAAM;;;;;;;;;;;;;;;;;;;EA9BT,OAAO,WACL;GACE,IAAI,YAA4B;IAC9B,OAAO;GACT;GACA;GACA,SAAS;GACT,YAAY;EACd,GACA;GACE,IAAI,oBAAoB;IACtB,OAAO,KAAK,UAAU;GACxB;GACA,IAAI,SAAS;IACX,OAAO,MAAM,YAAY,gBAAgB,IAAI,KAAA;GAC/C;EACF,CACF;;;;;;;;;;;EAEA,OAAA,eAAAyB,mBACE;GAEK,OAAA,YAAY,KAAK,oBAAoB,CAAC,CAAC;EAE5C,GALF,IAAA,IAMa,OAKV,QAJK,YAAY;GAChB,OAAO,OAAO;EAChB,CAGc,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;EAhClB,OAAA,eAAA,IAAA,KAMM,WAEY,KAIH,MAGA,OAWA,OAET,MAKU,CAAA;;;;;;;;;;;;;;;;;;;;;;;;EAlClB,OAAA,4BAAA,IAAA,KAOQ,WAEY,KAIH,MAGA,OAWA,OAET,QA7B4B,KAmCP,CAAA;;;;;;;;;;;;;;;;;;;;EA7C/B,OAAO,WACL,YAAY,KAAK,aAAa,CAAC,CAAC,GAChC,EACE,MAAM,YAA4B;GAChC,aAAa,OAAO;EACtB,EACF,CACF;;;;;;;;;;;;;EAEA,OAAA,2BAAA,IAAA,KAQU,WAEY,KAIH,MAGA,OAWA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