react-aria-components 3.0.0-nightly-4baa1b08e-241029 → 3.0.0-nightly-dcc0752f8-241031

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Menu.main.js CHANGED
@@ -10,6 +10,7 @@ var $2JTht$reactaria = require("react-aria");
10
10
  var $2JTht$reactstately = require("react-stately");
11
11
  var $2JTht$reactariacollections = require("@react-aria/collections");
12
12
  var $2JTht$reactariautils = require("@react-aria/utils");
13
+ var $2JTht$reactstatelyselection = require("@react-stately/selection");
13
14
  var $2JTht$reactariainteractions = require("@react-aria/interactions");
14
15
  var $2JTht$react = require("react");
15
16
  var $2JTht$reactstatelymenu = require("@react-stately/menu");
@@ -30,6 +31,7 @@ $parcel$export(module.exports, "RootMenuTriggerStateContext", () => $a8f6e7d095d
30
31
  $parcel$export(module.exports, "MenuTrigger", () => $a8f6e7d095d1cc86$export$27d2ad3c5815583e);
31
32
  $parcel$export(module.exports, "SubmenuTrigger", () => $a8f6e7d095d1cc86$export$ecabc99eeffab7ca);
32
33
  $parcel$export(module.exports, "Menu", () => $a8f6e7d095d1cc86$export$d9b273488cd8ce6f);
34
+ $parcel$export(module.exports, "MenuSection", () => $a8f6e7d095d1cc86$export$4b1545b4f2016d26);
33
35
  $parcel$export(module.exports, "MenuItem", () => $a8f6e7d095d1cc86$export$2ce376c2cc3355c8);
34
36
  /*
35
37
  * Copyright 2022 Adobe. All rights reserved.
@@ -57,9 +59,11 @@ $parcel$export(module.exports, "MenuItem", () => $a8f6e7d095d1cc86$export$2ce376
57
59
 
58
60
 
59
61
 
62
+
60
63
  const $a8f6e7d095d1cc86$export$c7e742effb1c51e2 = /*#__PURE__*/ (0, $2JTht$react.createContext)(null);
61
64
  const $a8f6e7d095d1cc86$export$24aad8519b95b41b = /*#__PURE__*/ (0, $2JTht$react.createContext)(null);
62
65
  const $a8f6e7d095d1cc86$export$795aec4671cbae19 = /*#__PURE__*/ (0, $2JTht$react.createContext)(null);
66
+ const $a8f6e7d095d1cc86$var$SelectionManagerContext = /*#__PURE__*/ (0, $2JTht$react.createContext)(null);
63
67
  function $a8f6e7d095d1cc86$export$27d2ad3c5815583e(props) {
64
68
  let state = (0, $2JTht$reactstately.useMenuTriggerState)(props);
65
69
  let ref = (0, $2JTht$react.useRef)(null);
@@ -250,6 +254,7 @@ function $a8f6e7d095d1cc86$var$MenuInner({ props: props, collection: collection,
250
254
  [
251
255
  (0, $3114c2382242bdc0$exports.SectionContext),
252
256
  {
257
+ name: 'MenuSection',
253
258
  render: $a8f6e7d095d1cc86$var$MenuSection
254
259
  }
255
260
  ],
@@ -262,6 +267,10 @@ function $a8f6e7d095d1cc86$var$MenuInner({ props: props, collection: collection,
262
267
  [
263
268
  $a8f6e7d095d1cc86$var$MenuItemContext,
264
269
  null
270
+ ],
271
+ [
272
+ $a8f6e7d095d1cc86$var$SelectionManagerContext,
273
+ state.selectionManager
265
274
  ]
266
275
  ]
267
276
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($2JTht$react))).createElement(CollectionRoot, {
@@ -281,7 +290,30 @@ function $a8f6e7d095d1cc86$var$MenuInner({ props: props, collection: collection,
281
290
  /**
282
291
  * A menu displays a list of actions or options that a user can choose.
283
292
  */ const $a8f6e7d095d1cc86$export$d9b273488cd8ce6f = /*#__PURE__*/ (0, $2JTht$react.forwardRef)($a8f6e7d095d1cc86$var$Menu);
284
- function $a8f6e7d095d1cc86$var$MenuSection(props, ref, section) {
293
+ // A subclass of SelectionManager that forwards focus-related properties to the parent,
294
+ // but has its own local selection state.
295
+ class $a8f6e7d095d1cc86$var$GroupSelectionManager extends (0, $2JTht$reactstatelyselection.SelectionManager) {
296
+ get focusedKey() {
297
+ return this.parent.focusedKey;
298
+ }
299
+ get isFocused() {
300
+ return this.parent.isFocused;
301
+ }
302
+ setFocusedKey(key, childFocusStrategy) {
303
+ return this.parent.setFocusedKey(key, childFocusStrategy);
304
+ }
305
+ setFocused(isFocused) {
306
+ this.parent.setFocused(isFocused);
307
+ }
308
+ get childFocusStrategy() {
309
+ return this.parent.childFocusStrategy;
310
+ }
311
+ constructor(parent, state){
312
+ super(parent.collection, state);
313
+ this.parent = parent;
314
+ }
315
+ }
316
+ function $a8f6e7d095d1cc86$var$MenuSection(props, ref, section, className = 'react-aria-MenuSection') {
285
317
  var _section_props, _section_props1;
286
318
  let state = (0, $2JTht$react.useContext)($a8f6e7d095d1cc86$export$24aad8519b95b41b);
287
319
  let { CollectionBranch: CollectionBranch } = (0, $2JTht$react.useContext)((0, $3114c2382242bdc0$exports.CollectionRendererContext));
@@ -292,26 +324,41 @@ function $a8f6e7d095d1cc86$var$MenuSection(props, ref, section) {
292
324
  'aria-label': (_section_props_arialabel = section.props['aria-label']) !== null && _section_props_arialabel !== void 0 ? _section_props_arialabel : undefined
293
325
  });
294
326
  let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
295
- defaultClassName: 'react-aria-Section',
327
+ defaultClassName: className,
296
328
  className: (_section_props = section.props) === null || _section_props === void 0 ? void 0 : _section_props.className,
297
329
  style: (_section_props1 = section.props) === null || _section_props1 === void 0 ? void 0 : _section_props1.style,
298
330
  values: {}
299
331
  });
332
+ let parent = (0, $2JTht$react.useContext)($a8f6e7d095d1cc86$var$SelectionManagerContext);
333
+ let selectionState = (0, $2JTht$reactstatelyselection.useMultipleSelectionState)(props);
334
+ let manager = props.selectionMode != null ? new $a8f6e7d095d1cc86$var$GroupSelectionManager(parent, selectionState) : parent;
300
335
  return /*#__PURE__*/ (0, ($parcel$interopDefault($2JTht$react))).createElement("section", {
301
336
  ...(0, $2JTht$reactariautils.filterDOMProps)(props),
302
337
  ...groupProps,
303
338
  ...renderProps,
304
339
  ref: ref
305
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($2JTht$react))).createElement((0, $c7efb75a1a3fe2d2$exports.HeaderContext).Provider, {
306
- value: {
307
- ...headingProps,
308
- ref: headingRef
309
- }
340
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($2JTht$react))).createElement((0, $c5ccf687772c0422$exports.Provider), {
341
+ values: [
342
+ [
343
+ (0, $c7efb75a1a3fe2d2$exports.HeaderContext),
344
+ {
345
+ ...headingProps,
346
+ ref: headingRef
347
+ }
348
+ ],
349
+ [
350
+ $a8f6e7d095d1cc86$var$SelectionManagerContext,
351
+ manager
352
+ ]
353
+ ]
310
354
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($2JTht$react))).createElement(CollectionBranch, {
311
355
  collection: state.collection,
312
356
  parent: section
313
357
  })));
314
358
  }
359
+ /**
360
+ * A MenuSection represents a section within a Menu.
361
+ */ const $a8f6e7d095d1cc86$export$4b1545b4f2016d26 = /*#__PURE__*/ (0, $2JTht$reactariacollections.createBranchComponent)('section', $a8f6e7d095d1cc86$var$MenuSection);
315
362
  const $a8f6e7d095d1cc86$var$MenuItemContext = /*#__PURE__*/ (0, $2JTht$react.createContext)(null);
316
363
  const $a8f6e7d095d1cc86$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $2JTht$reactariacollections.createLeafComponent)('item', function MenuItem(props, forwardedRef, item) {
317
364
  var _useSlottedContext;
@@ -319,10 +366,12 @@ const $a8f6e7d095d1cc86$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $2JTht$react
319
366
  let id = (_useSlottedContext = (0, $c5ccf687772c0422$exports.useSlottedContext)($a8f6e7d095d1cc86$var$MenuItemContext)) === null || _useSlottedContext === void 0 ? void 0 : _useSlottedContext.id;
320
367
  let state = (0, $2JTht$react.useContext)($a8f6e7d095d1cc86$export$24aad8519b95b41b);
321
368
  let ref = (0, $2JTht$reactariautils.useObjectRef)(forwardedRef);
369
+ let selectionManager = (0, $2JTht$react.useContext)($a8f6e7d095d1cc86$var$SelectionManagerContext);
322
370
  let { menuItemProps: menuItemProps, labelProps: labelProps, descriptionProps: descriptionProps, keyboardShortcutProps: keyboardShortcutProps, ...states } = (0, $2JTht$reactaria.useMenuItem)({
323
371
  ...props,
324
372
  id: id,
325
- key: item.key
373
+ key: item.key,
374
+ selectionManager: selectionManager
326
375
  }, state, ref);
327
376
  let { isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $2JTht$reactaria.useFocusRing)();
328
377
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $2JTht$reactariainteractions.useHover)({
@@ -337,8 +386,8 @@ const $a8f6e7d095d1cc86$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $2JTht$react
337
386
  ...states,
338
387
  isHovered: isHovered,
339
388
  isFocusVisible: isFocusVisible,
340
- selectionMode: state.selectionManager.selectionMode,
341
- selectionBehavior: state.selectionManager.selectionBehavior,
389
+ selectionMode: selectionManager.selectionMode,
390
+ selectionBehavior: selectionManager.selectionBehavior,
342
391
  hasSubmenu: !!props['aria-haspopup'],
343
392
  isOpen: props['aria-expanded'] === 'true'
344
393
  }
@@ -354,7 +403,7 @@ const $a8f6e7d095d1cc86$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $2JTht$react
354
403
  "data-focus-visible": isFocusVisible || undefined,
355
404
  "data-pressed": states.isPressed || undefined,
356
405
  "data-selected": states.isSelected || undefined,
357
- "data-selection-mode": state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode,
406
+ "data-selection-mode": selectionManager.selectionMode === 'none' ? undefined : selectionManager.selectionMode,
358
407
  "data-has-submenu": !!props['aria-haspopup'] || undefined,
359
408
  "data-open": props['aria-expanded'] === 'true' || undefined
360
409
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($2JTht$react))).createElement((0, $c5ccf687772c0422$exports.Provider), {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;AAiCM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAAgD;AAChF,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAAyB;AAC9D,MAAM,0DAA8B,CAAA,GAAA,0BAAY,EAA+B;AAM/E,SAAS,0C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BACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAc;gBAAG;aAAsB;SACzC;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Menu.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n\nimport {AriaMenuProps, FocusScope, mergeProps, useFocusRing, useMenu, useMenuItem, useMenuSection, useMenuTrigger} from 'react-aria';\nimport {MenuTriggerProps as BaseMenuTriggerProps, Collection as ICollection, Node, TreeState, useMenuTriggerState, useTreeState} from 'react-stately';\nimport {Collection, CollectionBuilder, createBranchComponent, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, ItemRenderProps, SectionContext, SectionProps, usePersistedKeys} from './Collection';\nimport {ContextValue, Provider, RenderProps, ScrollableProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {filterDOMProps, useObjectRef, useResizeObserver} from '@react-aria/utils';\nimport {forwardRefType, HoverEvents, Key, LinkDOMProps} from '@react-types/shared';\nimport {HeaderContext} from './Header';\nimport {KeyboardContext} from './Keyboard';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext, PopoverProps} from './Popover';\nimport {PressResponder, useHover, useInteractOutside} from '@react-aria/interactions';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n ReactElement,\n ReactNode,\n RefObject,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport {RootMenuTriggerState, useSubmenuTriggerState} from '@react-stately/menu';\nimport {SeparatorContext} from './Separator';\nimport {TextContext} from './Text';\nimport {useSubmenuTrigger} from '@react-aria/menu';\n\nexport const MenuContext = createContext<ContextValue<MenuProps<any>, HTMLDivElement>>(null);\nexport const MenuStateContext = createContext<TreeState<any> | null>(null);\nexport const RootMenuTriggerStateContext = createContext<RootMenuTriggerState | null>(null);\n\nexport interface MenuTriggerProps extends BaseMenuTriggerProps {\n children: ReactNode\n}\n\nexport function MenuTrigger(props: MenuTriggerProps) {\n let state = useMenuTriggerState(props);\n let ref = useRef<HTMLButtonElement>(null);\n let {menuTriggerProps, menuProps} = useMenuTrigger({\n ...props,\n type: 'menu'\n }, state, ref);\n // Allows menu width to match button\n let [buttonWidth, setButtonWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (ref.current) {\n setButtonWidth(ref.current.offsetWidth + 'px');\n }\n }, [ref]);\n\n useResizeObserver({\n ref: ref,\n onResize: onResize\n });\n\n let scrollRef = useRef(null);\n\n return (\n <Provider\n values={[\n [MenuContext, {...menuProps, ref: scrollRef}],\n [OverlayTriggerStateContext, state],\n [RootMenuTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'MenuTrigger',\n triggerRef: ref,\n scrollRef,\n placement: 'bottom start',\n style: {'--trigger-width': buttonWidth} as React.CSSProperties\n }]\n ]}>\n <PressResponder {...menuTriggerProps} ref={ref} isPressed={state.isOpen}>\n {props.children}\n </PressResponder>\n </Provider>\n );\n}\n\nexport interface SubmenuTriggerProps {\n /**\n * The contents of the SubmenuTrigger. The first child should be an Item (the trigger) and the second child should be the Popover (for the submenu).\n */\n children: ReactElement[],\n /**\n * The delay time in milliseconds for the submenu to appear after hovering over the trigger.\n * @default 200\n */\n delay?: number\n}\n\nconst SubmenuTriggerContext = createContext<{parentMenuRef: RefObject<HTMLElement | null>} | null>(null);\n\n/**\n * A submenu trigger is used to wrap a submenu's trigger item and the submenu itself.\n *\n * @version alpha\n */\nexport const SubmenuTrigger = /*#__PURE__*/ createBranchComponent('submenutrigger', (props: SubmenuTriggerProps, ref: ForwardedRef<HTMLDivElement>, item) => {\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let state = useContext(MenuStateContext)!;\n let rootMenuTriggerState = useContext(RootMenuTriggerStateContext)!;\n let submenuTriggerState = useSubmenuTriggerState({triggerKey: item.key}, rootMenuTriggerState);\n let submenuRef = useRef<HTMLDivElement>(null);\n let itemRef = useObjectRef(ref);\n let popoverContext = useSlottedContext(PopoverContext)!;\n let {parentMenuRef} = useContext(SubmenuTriggerContext)!;\n let {submenuTriggerProps, submenuProps, popoverProps} = useSubmenuTrigger({\n parentMenuRef,\n submenuRef,\n delay: props.delay\n }, submenuTriggerState, itemRef);\n\n return (\n <Provider\n values={[\n [MenuItemContext, {...submenuTriggerProps, onAction: undefined, ref: itemRef}],\n [MenuContext, submenuProps],\n [OverlayTriggerStateContext, submenuTriggerState],\n [PopoverContext, {\n ref: submenuRef,\n trigger: 'SubmenuTrigger',\n triggerRef: itemRef,\n placement: 'end top',\n UNSTABLE_portalContainer: popoverContext.UNSTABLE_portalContainer || undefined,\n ...popoverProps\n }]\n ]}>\n <CollectionBranch collection={state.collection} parent={item} />\n {props.children[1]}\n </Provider>\n );\n}, props => props.children[0]);\n\nexport interface MenuProps<T> extends Omit<AriaMenuProps<T>, 'children'>, CollectionProps<T>, StyleProps, SlotProps, ScrollableProps<HTMLDivElement> {}\n\nfunction Menu<T extends object>(props: MenuProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, MenuContext);\n\n // Delay rendering the actual menu until we have the collection so that auto focus works properly.\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => collection.size > 0 && <MenuInner props={props} collection={collection} menuRef={ref} />}\n </CollectionBuilder>\n );\n}\n\ninterface MenuInnerProps<T> {\n props: MenuProps<T>,\n collection: ICollection<Node<object>>,\n menuRef: RefObject<HTMLDivElement | null>\n}\n\nfunction MenuInner<T extends object>({props, collection, menuRef: ref}: MenuInnerProps<T>) {\n let state = useTreeState({\n ...props,\n collection,\n children: undefined\n });\n let [popoverContainer, setPopoverContainer] = useState<HTMLDivElement | null>(null);\n let {isVirtualized, CollectionRoot} = useContext(CollectionRendererContext);\n let {menuProps} = useMenu({...props, isVirtualized}, state, ref);\n let rootMenuTriggerState = useContext(RootMenuTriggerStateContext)!;\n let popoverContext = useContext(PopoverContext)!;\n\n let isSubmenu = (popoverContext as PopoverProps)?.trigger === 'SubmenuTrigger';\n useInteractOutside({\n ref,\n onInteractOutside: (e) => {\n if (rootMenuTriggerState && !popoverContainer?.contains(e.target as HTMLElement)) {\n rootMenuTriggerState.close();\n }\n },\n isDisabled: isSubmenu || rootMenuTriggerState?.expandedKeysStack.length === 0\n });\n\n let prevPopoverContainer = useRef<HTMLDivElement | null>(null) ;\n let [leftOffset, setLeftOffset] = useState({left: 0});\n useEffect(() => {\n if (popoverContainer && prevPopoverContainer.current !== popoverContainer && leftOffset.left === 0) {\n prevPopoverContainer.current = popoverContainer;\n let {left} = popoverContainer.getBoundingClientRect();\n setLeftOffset({left: -1 * left});\n }\n }, [leftOffset, popoverContainer]);\n\n let renderProps = useRenderProps({\n defaultClassName: 'react-aria-Menu',\n className: props.className,\n style: props.style,\n values: {}\n });\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...menuProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n onScroll={props.onScroll}>\n <Provider\n values={[\n [MenuStateContext, state],\n [SeparatorContext, {elementType: 'div'}],\n [PopoverContext, {UNSTABLE_portalContainer: popoverContainer || undefined}],\n [SectionContext, {render: MenuSection}],\n [SubmenuTriggerContext, {parentMenuRef: ref}],\n [MenuItemContext, null]\n ]}>\n <CollectionRoot\n collection={collection}\n persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)}\n scrollRef={ref} />\n </Provider>\n </div>\n <div ref={setPopoverContainer} style={{width: '100vw', position: 'absolute', top: 0, ...leftOffset}} />\n </FocusScope>\n );\n}\n\n/**\n * A menu displays a list of actions or options that a user can choose.\n */\nconst _Menu = /*#__PURE__*/ (forwardRef as forwardRefType)(Menu);\nexport {_Menu as Menu};\n\nfunction MenuSection<T extends object>(props: SectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>) {\n let state = useContext(MenuStateContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useMenuSection({\n heading,\n 'aria-label': section.props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n defaultClassName: 'react-aria-Section',\n className: section.props?.className,\n style: section.props?.style,\n values: {}\n });\n\n return (\n <section\n {...filterDOMProps(props as any)}\n {...groupProps}\n {...renderProps}\n ref={ref}>\n <HeaderContext.Provider value={{...headingProps, ref: headingRef}}>\n <CollectionBranch collection={state.collection} parent={section} />\n </HeaderContext.Provider>\n </section>\n );\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> extends RenderProps<MenuItemRenderProps>, LinkDOMProps, HoverEvents {\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\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}\n\nconst MenuItemContext = createContext<ContextValue<MenuItemProps, HTMLDivElement>>(null);\n\n/**\n * A MenuItem represents an individual action in a Menu.\n */\nexport const MenuItem = /*#__PURE__*/ createLeafComponent('item', function MenuItem<T extends object>(props: MenuItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n [props, forwardedRef] = useContextProps(props, forwardedRef, MenuItemContext);\n let id = useSlottedContext(MenuItemContext)?.id as string;\n let state = useContext(MenuStateContext)!;\n let ref = useObjectRef<any>(forwardedRef);\n\n let {menuItemProps, labelProps, descriptionProps, keyboardShortcutProps, ...states} = useMenuItem({...props, id, key: item.key}, state, ref);\n\n let {isFocusVisible, focusProps} = useFocusRing();\n let {hoverProps, isHovered} = useHover({\n isDisabled: states.isDisabled\n });\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-MenuItem',\n values: {\n ...states,\n isHovered,\n isFocusVisible,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n hasSubmenu: !!props['aria-haspopup'],\n isOpen: props['aria-expanded'] === 'true'\n }\n });\n\n let ElementType: React.ElementType = props.href ? 'a' : 'div';\n\n return (\n <ElementType\n {...mergeProps(menuItemProps, focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-selected={states.isSelected || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}\n data-has-submenu={!!props['aria-haspopup'] || undefined}\n data-open={props['aria-expanded'] === 'true' || undefined}>\n <Provider\n values={[\n [TextContext, {\n slots: {\n label: labelProps,\n description: descriptionProps\n }\n }],\n [KeyboardContext, keyboardShortcutProps]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n"],"names":[],"version":3,"file":"Menu.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAkCM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAAgD;AAChF,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAAyB;AAC9D,MAAM,0DAA8B,CAAA,GAAA,0BAAY,EAA+B;AACtF,MAAM,8DAA0B,CAAA,GAAA,0BAAY,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AAC,GAAG,CAAA,GAAA,qCAAO,EAAE;QACrC,YAAY,OAAO,UAAU;IAC/B;IACA,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,IAAI;QACJ,UAAU,KAAK,QAAQ;QACvB,kBAAkB;QAClB,QAAQ;YACN,GAAG,MAAM;uBACT;4BACA;YACA,eAAe,iBAAiB,aAAa;YAC7C,mBAAmB,iBAAiB,iBAAiB;YACrD,YAAY,CAAC,CAAC,KAAK,CAAC,gBAAgB;YACpC,QAAQ,KAAK,CAAC,gBAAgB,KAAK;QACrC;IACF;IAEA,IAAI,cAAiC,MAAM,IAAI,GAAG,MAAM;IAExD,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,eAAe,YAAY,WAAW;QACpD,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,OAAO,UAAU,IAAI;QACpC,gBAAc,aAAa;QAC3B,gBAAc,OAAO,SAAS,IAAI;QAClC,sBAAoB,kBAAkB;QACtC,gBAAc,OAAO,SAAS,IAAI;QAClC,iBAAe,OAAO,UAAU,IAAI;QACpC,uBAAqB,iBAAiB,aAAa,KAAK,SAAS,YAAY,iBAAiB,aAAa;QAC3G,oBAAkB,CAAC,CAAC,KAAK,CAAC,gBAAgB,IAAI;QAC9C,aAAW,KAAK,CAAC,gBAAgB,KAAK,UAAU;qBAChD,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBACZ,OAAO;wBACL,OAAO;wBACP,aAAa;oBACf;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAc;gBAAG;aAAsB;SACzC;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Menu.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n\nimport {AriaMenuProps, FocusScope, mergeProps, useFocusRing, useMenu, useMenuItem, useMenuSection, useMenuTrigger} from 'react-aria';\nimport {MenuTriggerProps as BaseMenuTriggerProps, Collection as ICollection, Node, TreeState, useMenuTriggerState, useTreeState} from 'react-stately';\nimport {Collection, CollectionBuilder, createBranchComponent, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, ItemRenderProps, SectionContext, SectionProps, usePersistedKeys} from './Collection';\nimport {ContextValue, Provider, RenderProps, ScrollableProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {filterDOMProps, useObjectRef, useResizeObserver} from '@react-aria/utils';\nimport {FocusStrategy, forwardRefType, HoverEvents, Key, LinkDOMProps, MultipleSelection} from '@react-types/shared';\nimport {HeaderContext} from './Header';\nimport {KeyboardContext} from './Keyboard';\nimport {MultipleSelectionState, SelectionManager, useMultipleSelectionState} from '@react-stately/selection';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext, PopoverProps} from './Popover';\nimport {PressResponder, useHover, useInteractOutside} from '@react-aria/interactions';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n ReactElement,\n ReactNode,\n RefObject,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport {RootMenuTriggerState, useSubmenuTriggerState} from '@react-stately/menu';\nimport {SeparatorContext} from './Separator';\nimport {TextContext} from './Text';\nimport {useSubmenuTrigger} from '@react-aria/menu';\n\nexport const MenuContext = createContext<ContextValue<MenuProps<any>, HTMLDivElement>>(null);\nexport const MenuStateContext = createContext<TreeState<any> | null>(null);\nexport const RootMenuTriggerStateContext = createContext<RootMenuTriggerState | null>(null);\nconst SelectionManagerContext = createContext<SelectionManager | null>(null);\n\nexport interface MenuTriggerProps extends BaseMenuTriggerProps {\n children: ReactNode\n}\n\nexport function MenuTrigger(props: MenuTriggerProps) {\n let state = useMenuTriggerState(props);\n let ref = useRef<HTMLButtonElement>(null);\n let {menuTriggerProps, menuProps} = useMenuTrigger({\n ...props,\n type: 'menu'\n }, state, ref);\n // Allows menu width to match button\n let [buttonWidth, setButtonWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (ref.current) {\n setButtonWidth(ref.current.offsetWidth + 'px');\n }\n }, [ref]);\n\n useResizeObserver({\n ref: ref,\n onResize: onResize\n });\n\n let scrollRef = useRef(null);\n\n return (\n <Provider\n values={[\n [MenuContext, {...menuProps, ref: scrollRef}],\n [OverlayTriggerStateContext, state],\n [RootMenuTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'MenuTrigger',\n triggerRef: ref,\n scrollRef,\n placement: 'bottom start',\n style: {'--trigger-width': buttonWidth} as React.CSSProperties\n }]\n ]}>\n <PressResponder {...menuTriggerProps} ref={ref} isPressed={state.isOpen}>\n {props.children}\n </PressResponder>\n </Provider>\n );\n}\n\nexport interface SubmenuTriggerProps {\n /**\n * The contents of the SubmenuTrigger. The first child should be an Item (the trigger) and the second child should be the Popover (for the submenu).\n */\n children: ReactElement[],\n /**\n * The delay time in milliseconds for the submenu to appear after hovering over the trigger.\n * @default 200\n */\n delay?: number\n}\n\nconst SubmenuTriggerContext = createContext<{parentMenuRef: RefObject<HTMLElement | null>} | null>(null);\n\n/**\n * A submenu trigger is used to wrap a submenu's trigger item and the submenu itself.\n *\n * @version alpha\n */\nexport const SubmenuTrigger = /*#__PURE__*/ createBranchComponent('submenutrigger', (props: SubmenuTriggerProps, ref: ForwardedRef<HTMLDivElement>, item) => {\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let state = useContext(MenuStateContext)!;\n let rootMenuTriggerState = useContext(RootMenuTriggerStateContext)!;\n let submenuTriggerState = useSubmenuTriggerState({triggerKey: item.key}, rootMenuTriggerState);\n let submenuRef = useRef<HTMLDivElement>(null);\n let itemRef = useObjectRef(ref);\n let popoverContext = useSlottedContext(PopoverContext)!;\n let {parentMenuRef} = useContext(SubmenuTriggerContext)!;\n let {submenuTriggerProps, submenuProps, popoverProps} = useSubmenuTrigger({\n parentMenuRef,\n submenuRef,\n delay: props.delay\n }, submenuTriggerState, itemRef);\n\n return (\n <Provider\n values={[\n [MenuItemContext, {...submenuTriggerProps, onAction: undefined, ref: itemRef}],\n [MenuContext, submenuProps],\n [OverlayTriggerStateContext, submenuTriggerState],\n [PopoverContext, {\n ref: submenuRef,\n trigger: 'SubmenuTrigger',\n triggerRef: itemRef,\n placement: 'end top',\n UNSTABLE_portalContainer: popoverContext.UNSTABLE_portalContainer || undefined,\n ...popoverProps\n }]\n ]}>\n <CollectionBranch collection={state.collection} parent={item} />\n {props.children[1]}\n </Provider>\n );\n}, props => props.children[0]);\n\nexport interface MenuProps<T> extends Omit<AriaMenuProps<T>, 'children'>, CollectionProps<T>, StyleProps, SlotProps, ScrollableProps<HTMLDivElement> {}\n\nfunction Menu<T extends object>(props: MenuProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, MenuContext);\n\n // Delay rendering the actual menu until we have the collection so that auto focus works properly.\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => collection.size > 0 && <MenuInner props={props} collection={collection} menuRef={ref} />}\n </CollectionBuilder>\n );\n}\n\ninterface MenuInnerProps<T> {\n props: MenuProps<T>,\n collection: ICollection<Node<object>>,\n menuRef: RefObject<HTMLDivElement | null>\n}\n\nfunction MenuInner<T extends object>({props, collection, menuRef: ref}: MenuInnerProps<T>) {\n let state = useTreeState({\n ...props,\n collection,\n children: undefined\n });\n let [popoverContainer, setPopoverContainer] = useState<HTMLDivElement | null>(null);\n let {isVirtualized, CollectionRoot} = useContext(CollectionRendererContext);\n let {menuProps} = useMenu({...props, isVirtualized}, state, ref);\n let rootMenuTriggerState = useContext(RootMenuTriggerStateContext)!;\n let popoverContext = useContext(PopoverContext)!;\n\n let isSubmenu = (popoverContext as PopoverProps)?.trigger === 'SubmenuTrigger';\n useInteractOutside({\n ref,\n onInteractOutside: (e) => {\n if (rootMenuTriggerState && !popoverContainer?.contains(e.target as HTMLElement)) {\n rootMenuTriggerState.close();\n }\n },\n isDisabled: isSubmenu || rootMenuTriggerState?.expandedKeysStack.length === 0\n });\n\n let prevPopoverContainer = useRef<HTMLDivElement | null>(null) ;\n let [leftOffset, setLeftOffset] = useState({left: 0});\n useEffect(() => {\n if (popoverContainer && prevPopoverContainer.current !== popoverContainer && leftOffset.left === 0) {\n prevPopoverContainer.current = popoverContainer;\n let {left} = popoverContainer.getBoundingClientRect();\n setLeftOffset({left: -1 * left});\n }\n }, [leftOffset, popoverContainer]);\n\n let renderProps = useRenderProps({\n defaultClassName: 'react-aria-Menu',\n className: props.className,\n style: props.style,\n values: {}\n });\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...menuProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n onScroll={props.onScroll}>\n <Provider\n values={[\n [MenuStateContext, state],\n [SeparatorContext, {elementType: 'div'}],\n [PopoverContext, {UNSTABLE_portalContainer: popoverContainer || undefined}],\n [SectionContext, {name: 'MenuSection', render: MenuSection}],\n [SubmenuTriggerContext, {parentMenuRef: ref}],\n [MenuItemContext, null],\n [SelectionManagerContext, state.selectionManager]\n ]}>\n <CollectionRoot\n collection={collection}\n persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)}\n scrollRef={ref} />\n </Provider>\n </div>\n <div ref={setPopoverContainer} style={{width: '100vw', position: 'absolute', top: 0, ...leftOffset}} />\n </FocusScope>\n );\n}\n\n/**\n * A menu displays a list of actions or options that a user can choose.\n */\nconst _Menu = /*#__PURE__*/ (forwardRef as forwardRefType)(Menu);\nexport {_Menu as Menu};\n\nexport interface MenuSectionProps<T> extends SectionProps<T>, MultipleSelection {}\n\n// A subclass of SelectionManager that forwards focus-related properties to the parent,\n// but has its own local selection state.\nclass GroupSelectionManager extends SelectionManager {\n private parent: SelectionManager;\n\n constructor(parent: SelectionManager, state: MultipleSelectionState) {\n super(parent.collection, state);\n this.parent = parent;\n }\n\n get focusedKey() {\n return this.parent.focusedKey;\n }\n\n get isFocused() {\n return this.parent.isFocused;\n }\n\n setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy): void {\n return this.parent.setFocusedKey(key, childFocusStrategy);\n }\n\n setFocused(isFocused: boolean): void {\n this.parent.setFocused(isFocused);\n }\n\n get childFocusStrategy() {\n return this.parent.childFocusStrategy;\n }\n}\n\nfunction MenuSection<T extends object>(props: MenuSectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>, className = 'react-aria-MenuSection') {\n let state = useContext(MenuStateContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useMenuSection({\n heading,\n 'aria-label': section.props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n defaultClassName: className,\n className: section.props?.className,\n style: section.props?.style,\n values: {}\n });\n\n let parent = useContext(SelectionManagerContext)!;\n let selectionState = useMultipleSelectionState(props);\n let manager = props.selectionMode != null ? new GroupSelectionManager(parent, selectionState) : parent;\n\n return (\n <section\n {...filterDOMProps(props as any)}\n {...groupProps}\n {...renderProps}\n ref={ref}>\n <Provider\n values={[\n [HeaderContext, {...headingProps, ref: headingRef}],\n [SelectionManagerContext, manager]\n ]}>\n <CollectionBranch collection={state.collection} parent={section} />\n </Provider>\n </section>\n );\n}\n\n/**\n * A MenuSection represents a section within a Menu.\n */\nconst _MenuSection = /*#__PURE__*/ createBranchComponent('section', MenuSection);\nexport {_MenuSection as MenuSection};\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> extends RenderProps<MenuItemRenderProps>, LinkDOMProps, HoverEvents {\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\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}\n\nconst MenuItemContext = createContext<ContextValue<MenuItemProps, HTMLDivElement>>(null);\n\n/**\n * A MenuItem represents an individual action in a Menu.\n */\nexport const MenuItem = /*#__PURE__*/ createLeafComponent('item', function MenuItem<T extends object>(props: MenuItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n [props, forwardedRef] = useContextProps(props, forwardedRef, MenuItemContext);\n let id = useSlottedContext(MenuItemContext)?.id as string;\n let state = useContext(MenuStateContext)!;\n let ref = useObjectRef<any>(forwardedRef);\n let selectionManager = useContext(SelectionManagerContext)!;\n\n let {menuItemProps, labelProps, descriptionProps, keyboardShortcutProps, ...states} = useMenuItem({\n ...props,\n id,\n key: item.key,\n selectionManager\n }, state, ref);\n\n let {isFocusVisible, focusProps} = useFocusRing();\n let {hoverProps, isHovered} = useHover({\n isDisabled: states.isDisabled\n });\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-MenuItem',\n values: {\n ...states,\n isHovered,\n isFocusVisible,\n selectionMode: selectionManager.selectionMode,\n selectionBehavior: selectionManager.selectionBehavior,\n hasSubmenu: !!props['aria-haspopup'],\n isOpen: props['aria-expanded'] === 'true'\n }\n });\n\n let ElementType: React.ElementType = props.href ? 'a' : 'div';\n\n return (\n <ElementType\n {...mergeProps(menuItemProps, focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-selected={states.isSelected || undefined}\n data-selection-mode={selectionManager.selectionMode === 'none' ? undefined : selectionManager.selectionMode}\n data-has-submenu={!!props['aria-haspopup'] || undefined}\n data-open={props['aria-expanded'] === 'true' || undefined}>\n <Provider\n values={[\n [TextContext, {\n slots: {\n label: labelProps,\n description: descriptionProps\n }\n }],\n [KeyboardContext, keyboardShortcutProps]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n"],"names":[],"version":3,"file":"Menu.main.js.map"}
package/dist/Menu.mjs CHANGED
@@ -10,6 +10,7 @@ import {useMenuTrigger as $kM2ZM$useMenuTrigger, useMenu as $kM2ZM$useMenu, Focu
10
10
  import {useMenuTriggerState as $kM2ZM$useMenuTriggerState, useTreeState as $kM2ZM$useTreeState} from "react-stately";
11
11
  import {createBranchComponent as $kM2ZM$createBranchComponent, CollectionBuilder as $kM2ZM$CollectionBuilder, Collection as $kM2ZM$Collection, createLeafComponent as $kM2ZM$createLeafComponent} from "@react-aria/collections";
12
12
  import {useResizeObserver as $kM2ZM$useResizeObserver, useObjectRef as $kM2ZM$useObjectRef, filterDOMProps as $kM2ZM$filterDOMProps} from "@react-aria/utils";
13
+ import {SelectionManager as $kM2ZM$SelectionManager, useMultipleSelectionState as $kM2ZM$useMultipleSelectionState} from "@react-stately/selection";
13
14
  import {PressResponder as $kM2ZM$PressResponder, useInteractOutside as $kM2ZM$useInteractOutside, useHover as $kM2ZM$useHover} from "@react-aria/interactions";
14
15
  import $kM2ZM$react, {createContext as $kM2ZM$createContext, useRef as $kM2ZM$useRef, useState as $kM2ZM$useState, useCallback as $kM2ZM$useCallback, useContext as $kM2ZM$useContext, useEffect as $kM2ZM$useEffect, forwardRef as $kM2ZM$forwardRef} from "react";
15
16
  import {useSubmenuTriggerState as $kM2ZM$useSubmenuTriggerState} from "@react-stately/menu";
@@ -41,9 +42,11 @@ import {useSubmenuTrigger as $kM2ZM$useSubmenuTrigger} from "@react-aria/menu";
41
42
 
42
43
 
43
44
 
45
+
44
46
  const $3674c52c6b3c5bce$export$c7e742effb1c51e2 = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
45
47
  const $3674c52c6b3c5bce$export$24aad8519b95b41b = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
46
48
  const $3674c52c6b3c5bce$export$795aec4671cbae19 = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
49
+ const $3674c52c6b3c5bce$var$SelectionManagerContext = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
47
50
  function $3674c52c6b3c5bce$export$27d2ad3c5815583e(props) {
48
51
  let state = (0, $kM2ZM$useMenuTriggerState)(props);
49
52
  let ref = (0, $kM2ZM$useRef)(null);
@@ -234,6 +237,7 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
234
237
  [
235
238
  (0, $7135fc7d473fd974$export$d40e14dec8b060a8),
236
239
  {
240
+ name: 'MenuSection',
237
241
  render: $3674c52c6b3c5bce$var$MenuSection
238
242
  }
239
243
  ],
@@ -246,6 +250,10 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
246
250
  [
247
251
  $3674c52c6b3c5bce$var$MenuItemContext,
248
252
  null
253
+ ],
254
+ [
255
+ $3674c52c6b3c5bce$var$SelectionManagerContext,
256
+ state.selectionManager
249
257
  ]
250
258
  ]
251
259
  }, /*#__PURE__*/ (0, $kM2ZM$react).createElement(CollectionRoot, {
@@ -265,7 +273,30 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
265
273
  /**
266
274
  * A menu displays a list of actions or options that a user can choose.
267
275
  */ const $3674c52c6b3c5bce$export$d9b273488cd8ce6f = /*#__PURE__*/ (0, $kM2ZM$forwardRef)($3674c52c6b3c5bce$var$Menu);
268
- function $3674c52c6b3c5bce$var$MenuSection(props, ref, section) {
276
+ // A subclass of SelectionManager that forwards focus-related properties to the parent,
277
+ // but has its own local selection state.
278
+ class $3674c52c6b3c5bce$var$GroupSelectionManager extends (0, $kM2ZM$SelectionManager) {
279
+ get focusedKey() {
280
+ return this.parent.focusedKey;
281
+ }
282
+ get isFocused() {
283
+ return this.parent.isFocused;
284
+ }
285
+ setFocusedKey(key, childFocusStrategy) {
286
+ return this.parent.setFocusedKey(key, childFocusStrategy);
287
+ }
288
+ setFocused(isFocused) {
289
+ this.parent.setFocused(isFocused);
290
+ }
291
+ get childFocusStrategy() {
292
+ return this.parent.childFocusStrategy;
293
+ }
294
+ constructor(parent, state){
295
+ super(parent.collection, state);
296
+ this.parent = parent;
297
+ }
298
+ }
299
+ function $3674c52c6b3c5bce$var$MenuSection(props, ref, section, className = 'react-aria-MenuSection') {
269
300
  var _section_props, _section_props1;
270
301
  let state = (0, $kM2ZM$useContext)($3674c52c6b3c5bce$export$24aad8519b95b41b);
271
302
  let { CollectionBranch: CollectionBranch } = (0, $kM2ZM$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
@@ -276,26 +307,41 @@ function $3674c52c6b3c5bce$var$MenuSection(props, ref, section) {
276
307
  'aria-label': (_section_props_arialabel = section.props['aria-label']) !== null && _section_props_arialabel !== void 0 ? _section_props_arialabel : undefined
277
308
  });
278
309
  let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
279
- defaultClassName: 'react-aria-Section',
310
+ defaultClassName: className,
280
311
  className: (_section_props = section.props) === null || _section_props === void 0 ? void 0 : _section_props.className,
281
312
  style: (_section_props1 = section.props) === null || _section_props1 === void 0 ? void 0 : _section_props1.style,
282
313
  values: {}
283
314
  });
315
+ let parent = (0, $kM2ZM$useContext)($3674c52c6b3c5bce$var$SelectionManagerContext);
316
+ let selectionState = (0, $kM2ZM$useMultipleSelectionState)(props);
317
+ let manager = props.selectionMode != null ? new $3674c52c6b3c5bce$var$GroupSelectionManager(parent, selectionState) : parent;
284
318
  return /*#__PURE__*/ (0, $kM2ZM$react).createElement("section", {
285
319
  ...(0, $kM2ZM$filterDOMProps)(props),
286
320
  ...groupProps,
287
321
  ...renderProps,
288
322
  ref: ref
289
- }, /*#__PURE__*/ (0, $kM2ZM$react).createElement((0, $72a5793c14baf454$export$e0e4026c12a8bdbb).Provider, {
290
- value: {
291
- ...headingProps,
292
- ref: headingRef
293
- }
323
+ }, /*#__PURE__*/ (0, $kM2ZM$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
324
+ values: [
325
+ [
326
+ (0, $72a5793c14baf454$export$e0e4026c12a8bdbb),
327
+ {
328
+ ...headingProps,
329
+ ref: headingRef
330
+ }
331
+ ],
332
+ [
333
+ $3674c52c6b3c5bce$var$SelectionManagerContext,
334
+ manager
335
+ ]
336
+ ]
294
337
  }, /*#__PURE__*/ (0, $kM2ZM$react).createElement(CollectionBranch, {
295
338
  collection: state.collection,
296
339
  parent: section
297
340
  })));
298
341
  }
342
+ /**
343
+ * A MenuSection represents a section within a Menu.
344
+ */ const $3674c52c6b3c5bce$export$4b1545b4f2016d26 = /*#__PURE__*/ (0, $kM2ZM$createBranchComponent)('section', $3674c52c6b3c5bce$var$MenuSection);
299
345
  const $3674c52c6b3c5bce$var$MenuItemContext = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
300
346
  const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $kM2ZM$createLeafComponent)('item', function MenuItem(props, forwardedRef, item) {
301
347
  var _useSlottedContext;
@@ -303,10 +349,12 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $kM2ZM$creat
303
349
  let id = (_useSlottedContext = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($3674c52c6b3c5bce$var$MenuItemContext)) === null || _useSlottedContext === void 0 ? void 0 : _useSlottedContext.id;
304
350
  let state = (0, $kM2ZM$useContext)($3674c52c6b3c5bce$export$24aad8519b95b41b);
305
351
  let ref = (0, $kM2ZM$useObjectRef)(forwardedRef);
352
+ let selectionManager = (0, $kM2ZM$useContext)($3674c52c6b3c5bce$var$SelectionManagerContext);
306
353
  let { menuItemProps: menuItemProps, labelProps: labelProps, descriptionProps: descriptionProps, keyboardShortcutProps: keyboardShortcutProps, ...states } = (0, $kM2ZM$useMenuItem)({
307
354
  ...props,
308
355
  id: id,
309
- key: item.key
356
+ key: item.key,
357
+ selectionManager: selectionManager
310
358
  }, state, ref);
311
359
  let { isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $kM2ZM$useFocusRing)();
312
360
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $kM2ZM$useHover)({
@@ -321,8 +369,8 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $kM2ZM$creat
321
369
  ...states,
322
370
  isHovered: isHovered,
323
371
  isFocusVisible: isFocusVisible,
324
- selectionMode: state.selectionManager.selectionMode,
325
- selectionBehavior: state.selectionManager.selectionBehavior,
372
+ selectionMode: selectionManager.selectionMode,
373
+ selectionBehavior: selectionManager.selectionBehavior,
326
374
  hasSubmenu: !!props['aria-haspopup'],
327
375
  isOpen: props['aria-expanded'] === 'true'
328
376
  }
@@ -338,7 +386,7 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $kM2ZM$creat
338
386
  "data-focus-visible": isFocusVisible || undefined,
339
387
  "data-pressed": states.isPressed || undefined,
340
388
  "data-selected": states.isSelected || undefined,
341
- "data-selection-mode": state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode,
389
+ "data-selection-mode": selectionManager.selectionMode === 'none' ? undefined : selectionManager.selectionMode,
342
390
  "data-has-submenu": !!props['aria-haspopup'] || undefined,
343
391
  "data-open": props['aria-expanded'] === 'true' || undefined
344
392
  }, /*#__PURE__*/ (0, $kM2ZM$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
@@ -361,5 +409,5 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $kM2ZM$creat
361
409
  });
362
410
 
363
411
 
364
- export {$3674c52c6b3c5bce$export$c7e742effb1c51e2 as MenuContext, $3674c52c6b3c5bce$export$24aad8519b95b41b as MenuStateContext, $3674c52c6b3c5bce$export$795aec4671cbae19 as RootMenuTriggerStateContext, $3674c52c6b3c5bce$export$27d2ad3c5815583e as MenuTrigger, $3674c52c6b3c5bce$export$ecabc99eeffab7ca as SubmenuTrigger, $3674c52c6b3c5bce$export$d9b273488cd8ce6f as Menu, $3674c52c6b3c5bce$export$2ce376c2cc3355c8 as MenuItem};
412
+ export {$3674c52c6b3c5bce$export$c7e742effb1c51e2 as MenuContext, $3674c52c6b3c5bce$export$24aad8519b95b41b as MenuStateContext, $3674c52c6b3c5bce$export$795aec4671cbae19 as RootMenuTriggerStateContext, $3674c52c6b3c5bce$export$27d2ad3c5815583e as MenuTrigger, $3674c52c6b3c5bce$export$ecabc99eeffab7ca as SubmenuTrigger, $3674c52c6b3c5bce$export$d9b273488cd8ce6f as Menu, $3674c52c6b3c5bce$export$4b1545b4f2016d26 as MenuSection, $3674c52c6b3c5bce$export$2ce376c2cc3355c8 as MenuItem};
365
413
  //# sourceMappingURL=Menu.module.js.map
@@ -10,6 +10,7 @@ import {useMenuTrigger as $kM2ZM$useMenuTrigger, useMenu as $kM2ZM$useMenu, Focu
10
10
  import {useMenuTriggerState as $kM2ZM$useMenuTriggerState, useTreeState as $kM2ZM$useTreeState} from "react-stately";
11
11
  import {createBranchComponent as $kM2ZM$createBranchComponent, CollectionBuilder as $kM2ZM$CollectionBuilder, Collection as $kM2ZM$Collection, createLeafComponent as $kM2ZM$createLeafComponent} from "@react-aria/collections";
12
12
  import {useResizeObserver as $kM2ZM$useResizeObserver, useObjectRef as $kM2ZM$useObjectRef, filterDOMProps as $kM2ZM$filterDOMProps} from "@react-aria/utils";
13
+ import {SelectionManager as $kM2ZM$SelectionManager, useMultipleSelectionState as $kM2ZM$useMultipleSelectionState} from "@react-stately/selection";
13
14
  import {PressResponder as $kM2ZM$PressResponder, useInteractOutside as $kM2ZM$useInteractOutside, useHover as $kM2ZM$useHover} from "@react-aria/interactions";
14
15
  import $kM2ZM$react, {createContext as $kM2ZM$createContext, useRef as $kM2ZM$useRef, useState as $kM2ZM$useState, useCallback as $kM2ZM$useCallback, useContext as $kM2ZM$useContext, useEffect as $kM2ZM$useEffect, forwardRef as $kM2ZM$forwardRef} from "react";
15
16
  import {useSubmenuTriggerState as $kM2ZM$useSubmenuTriggerState} from "@react-stately/menu";
@@ -41,9 +42,11 @@ import {useSubmenuTrigger as $kM2ZM$useSubmenuTrigger} from "@react-aria/menu";
41
42
 
42
43
 
43
44
 
45
+
44
46
  const $3674c52c6b3c5bce$export$c7e742effb1c51e2 = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
45
47
  const $3674c52c6b3c5bce$export$24aad8519b95b41b = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
46
48
  const $3674c52c6b3c5bce$export$795aec4671cbae19 = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
49
+ const $3674c52c6b3c5bce$var$SelectionManagerContext = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
47
50
  function $3674c52c6b3c5bce$export$27d2ad3c5815583e(props) {
48
51
  let state = (0, $kM2ZM$useMenuTriggerState)(props);
49
52
  let ref = (0, $kM2ZM$useRef)(null);
@@ -234,6 +237,7 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
234
237
  [
235
238
  (0, $7135fc7d473fd974$export$d40e14dec8b060a8),
236
239
  {
240
+ name: 'MenuSection',
237
241
  render: $3674c52c6b3c5bce$var$MenuSection
238
242
  }
239
243
  ],
@@ -246,6 +250,10 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
246
250
  [
247
251
  $3674c52c6b3c5bce$var$MenuItemContext,
248
252
  null
253
+ ],
254
+ [
255
+ $3674c52c6b3c5bce$var$SelectionManagerContext,
256
+ state.selectionManager
249
257
  ]
250
258
  ]
251
259
  }, /*#__PURE__*/ (0, $kM2ZM$react).createElement(CollectionRoot, {
@@ -265,7 +273,30 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
265
273
  /**
266
274
  * A menu displays a list of actions or options that a user can choose.
267
275
  */ const $3674c52c6b3c5bce$export$d9b273488cd8ce6f = /*#__PURE__*/ (0, $kM2ZM$forwardRef)($3674c52c6b3c5bce$var$Menu);
268
- function $3674c52c6b3c5bce$var$MenuSection(props, ref, section) {
276
+ // A subclass of SelectionManager that forwards focus-related properties to the parent,
277
+ // but has its own local selection state.
278
+ class $3674c52c6b3c5bce$var$GroupSelectionManager extends (0, $kM2ZM$SelectionManager) {
279
+ get focusedKey() {
280
+ return this.parent.focusedKey;
281
+ }
282
+ get isFocused() {
283
+ return this.parent.isFocused;
284
+ }
285
+ setFocusedKey(key, childFocusStrategy) {
286
+ return this.parent.setFocusedKey(key, childFocusStrategy);
287
+ }
288
+ setFocused(isFocused) {
289
+ this.parent.setFocused(isFocused);
290
+ }
291
+ get childFocusStrategy() {
292
+ return this.parent.childFocusStrategy;
293
+ }
294
+ constructor(parent, state){
295
+ super(parent.collection, state);
296
+ this.parent = parent;
297
+ }
298
+ }
299
+ function $3674c52c6b3c5bce$var$MenuSection(props, ref, section, className = 'react-aria-MenuSection') {
269
300
  var _section_props, _section_props1;
270
301
  let state = (0, $kM2ZM$useContext)($3674c52c6b3c5bce$export$24aad8519b95b41b);
271
302
  let { CollectionBranch: CollectionBranch } = (0, $kM2ZM$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
@@ -276,26 +307,41 @@ function $3674c52c6b3c5bce$var$MenuSection(props, ref, section) {
276
307
  'aria-label': (_section_props_arialabel = section.props['aria-label']) !== null && _section_props_arialabel !== void 0 ? _section_props_arialabel : undefined
277
308
  });
278
309
  let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
279
- defaultClassName: 'react-aria-Section',
310
+ defaultClassName: className,
280
311
  className: (_section_props = section.props) === null || _section_props === void 0 ? void 0 : _section_props.className,
281
312
  style: (_section_props1 = section.props) === null || _section_props1 === void 0 ? void 0 : _section_props1.style,
282
313
  values: {}
283
314
  });
315
+ let parent = (0, $kM2ZM$useContext)($3674c52c6b3c5bce$var$SelectionManagerContext);
316
+ let selectionState = (0, $kM2ZM$useMultipleSelectionState)(props);
317
+ let manager = props.selectionMode != null ? new $3674c52c6b3c5bce$var$GroupSelectionManager(parent, selectionState) : parent;
284
318
  return /*#__PURE__*/ (0, $kM2ZM$react).createElement("section", {
285
319
  ...(0, $kM2ZM$filterDOMProps)(props),
286
320
  ...groupProps,
287
321
  ...renderProps,
288
322
  ref: ref
289
- }, /*#__PURE__*/ (0, $kM2ZM$react).createElement((0, $72a5793c14baf454$export$e0e4026c12a8bdbb).Provider, {
290
- value: {
291
- ...headingProps,
292
- ref: headingRef
293
- }
323
+ }, /*#__PURE__*/ (0, $kM2ZM$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
324
+ values: [
325
+ [
326
+ (0, $72a5793c14baf454$export$e0e4026c12a8bdbb),
327
+ {
328
+ ...headingProps,
329
+ ref: headingRef
330
+ }
331
+ ],
332
+ [
333
+ $3674c52c6b3c5bce$var$SelectionManagerContext,
334
+ manager
335
+ ]
336
+ ]
294
337
  }, /*#__PURE__*/ (0, $kM2ZM$react).createElement(CollectionBranch, {
295
338
  collection: state.collection,
296
339
  parent: section
297
340
  })));
298
341
  }
342
+ /**
343
+ * A MenuSection represents a section within a Menu.
344
+ */ const $3674c52c6b3c5bce$export$4b1545b4f2016d26 = /*#__PURE__*/ (0, $kM2ZM$createBranchComponent)('section', $3674c52c6b3c5bce$var$MenuSection);
299
345
  const $3674c52c6b3c5bce$var$MenuItemContext = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
300
346
  const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $kM2ZM$createLeafComponent)('item', function MenuItem(props, forwardedRef, item) {
301
347
  var _useSlottedContext;
@@ -303,10 +349,12 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $kM2ZM$creat
303
349
  let id = (_useSlottedContext = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($3674c52c6b3c5bce$var$MenuItemContext)) === null || _useSlottedContext === void 0 ? void 0 : _useSlottedContext.id;
304
350
  let state = (0, $kM2ZM$useContext)($3674c52c6b3c5bce$export$24aad8519b95b41b);
305
351
  let ref = (0, $kM2ZM$useObjectRef)(forwardedRef);
352
+ let selectionManager = (0, $kM2ZM$useContext)($3674c52c6b3c5bce$var$SelectionManagerContext);
306
353
  let { menuItemProps: menuItemProps, labelProps: labelProps, descriptionProps: descriptionProps, keyboardShortcutProps: keyboardShortcutProps, ...states } = (0, $kM2ZM$useMenuItem)({
307
354
  ...props,
308
355
  id: id,
309
- key: item.key
356
+ key: item.key,
357
+ selectionManager: selectionManager
310
358
  }, state, ref);
311
359
  let { isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $kM2ZM$useFocusRing)();
312
360
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $kM2ZM$useHover)({
@@ -321,8 +369,8 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $kM2ZM$creat
321
369
  ...states,
322
370
  isHovered: isHovered,
323
371
  isFocusVisible: isFocusVisible,
324
- selectionMode: state.selectionManager.selectionMode,
325
- selectionBehavior: state.selectionManager.selectionBehavior,
372
+ selectionMode: selectionManager.selectionMode,
373
+ selectionBehavior: selectionManager.selectionBehavior,
326
374
  hasSubmenu: !!props['aria-haspopup'],
327
375
  isOpen: props['aria-expanded'] === 'true'
328
376
  }
@@ -338,7 +386,7 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $kM2ZM$creat
338
386
  "data-focus-visible": isFocusVisible || undefined,
339
387
  "data-pressed": states.isPressed || undefined,
340
388
  "data-selected": states.isSelected || undefined,
341
- "data-selection-mode": state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode,
389
+ "data-selection-mode": selectionManager.selectionMode === 'none' ? undefined : selectionManager.selectionMode,
342
390
  "data-has-submenu": !!props['aria-haspopup'] || undefined,
343
391
  "data-open": props['aria-expanded'] === 'true' || undefined
344
392
  }, /*#__PURE__*/ (0, $kM2ZM$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
@@ -361,5 +409,5 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $kM2ZM$creat
361
409
  });
362
410
 
363
411
 
364
- export {$3674c52c6b3c5bce$export$c7e742effb1c51e2 as MenuContext, $3674c52c6b3c5bce$export$24aad8519b95b41b as MenuStateContext, $3674c52c6b3c5bce$export$795aec4671cbae19 as RootMenuTriggerStateContext, $3674c52c6b3c5bce$export$27d2ad3c5815583e as MenuTrigger, $3674c52c6b3c5bce$export$ecabc99eeffab7ca as SubmenuTrigger, $3674c52c6b3c5bce$export$d9b273488cd8ce6f as Menu, $3674c52c6b3c5bce$export$2ce376c2cc3355c8 as MenuItem};
412
+ export {$3674c52c6b3c5bce$export$c7e742effb1c51e2 as MenuContext, $3674c52c6b3c5bce$export$24aad8519b95b41b as MenuStateContext, $3674c52c6b3c5bce$export$795aec4671cbae19 as RootMenuTriggerStateContext, $3674c52c6b3c5bce$export$27d2ad3c5815583e as MenuTrigger, $3674c52c6b3c5bce$export$ecabc99eeffab7ca as SubmenuTrigger, $3674c52c6b3c5bce$export$d9b273488cd8ce6f as Menu, $3674c52c6b3c5bce$export$4b1545b4f2016d26 as MenuSection, $3674c52c6b3c5bce$export$2ce376c2cc3355c8 as MenuItem};
365
413
  //# sourceMappingURL=Menu.module.js.map