@contentful/f36-menu 4.0.1-beta.2558 → 4.0.1-beta.2696

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/main.js CHANGED
@@ -1,6 +1,5 @@
1
1
  var $6ZrLO$react = require("react");
2
2
  var $6ZrLO$contentfulf36core = require("@contentful/f36-core");
3
- var $6ZrLO$contentfulf36utils = require("@contentful/f36-utils");
4
3
  var $6ZrLO$contentfulf36popover = require("@contentful/f36-popover");
5
4
  var $6ZrLO$emotion = require("emotion");
6
5
  var $6ZrLO$contentfulf36tokens = require("@contentful/f36-tokens");
@@ -25,11 +24,64 @@ $parcel$export(module.exports, "SubmenuTrigger", () => $68e427819b978177$export$
25
24
 
26
25
 
27
26
 
27
+ const $9abfe5cafeb7e9d3$var$ARROW_KEY_TYPES = {
28
+ vertical: {
29
+ prev: 'ArrowUp',
30
+ next: 'ArrowDown'
31
+ },
32
+ horizontal: {
33
+ prev: 'ArrowLeft',
34
+ next: 'ArrowRight'
35
+ }
36
+ };
37
+ const $9abfe5cafeb7e9d3$export$e8d01079a7f85a7 = ({ itemsContainerRef: itemsContainerRef , itemsSelector: itemsSelector , keyType: keyType = 'vertical' })=>{
38
+ const [focusedIndex, setFocusedIndex] = $6ZrLO$react.useState(0);
39
+ const handleArrowsKeyDown = $6ZrLO$react.useCallback((event)=>{
40
+ const container = itemsContainerRef.current;
41
+ if (!container) return;
42
+ const items = container.querySelectorAll(itemsSelector);
43
+ if (items.length === 0) return;
44
+ const lastItemIndex = items.length - 1;
45
+ const focusFirstItem = ()=>setFocusedIndex(0)
46
+ ;
47
+ const focusLastItem = ()=>setFocusedIndex(lastItemIndex)
48
+ ;
49
+ const focusNextItem = ()=>{
50
+ if (focusedIndex === lastItemIndex) focusFirstItem();
51
+ else setFocusedIndex(focusedIndex + 1);
52
+ };
53
+ const focusPrevItem = ()=>{
54
+ if (focusedIndex === 0) focusLastItem();
55
+ else setFocusedIndex(focusedIndex - 1);
56
+ };
57
+ const keyToFnMap = {
58
+ [$9abfe5cafeb7e9d3$var$ARROW_KEY_TYPES[keyType].next]: focusNextItem,
59
+ [$9abfe5cafeb7e9d3$var$ARROW_KEY_TYPES[keyType].prev]: focusPrevItem
60
+ };
61
+ const fn = keyToFnMap[event.key];
62
+ if (fn) {
63
+ event.preventDefault();
64
+ fn();
65
+ }
66
+ }, [
67
+ focusedIndex,
68
+ itemsSelector,
69
+ itemsContainerRef,
70
+ keyType
71
+ ]);
72
+ return {
73
+ focusedIndex: focusedIndex,
74
+ handleArrowsKeyDown: handleArrowsKeyDown,
75
+ setFocusedIndex: setFocusedIndex
76
+ };
77
+ };
78
+
79
+
28
80
 
29
81
 
30
- const $31bc1b2a74a830dc$var$MenuContext = $parcel$interopDefault($6ZrLO$react).createContext(undefined);
82
+ const $31bc1b2a74a830dc$var$MenuContext = ($parcel$interopDefault($6ZrLO$react)).createContext(undefined);
31
83
  const $31bc1b2a74a830dc$export$21c7ab35b39f78ec = ()=>{
32
- const context = $parcel$interopDefault($6ZrLO$react).useContext($31bc1b2a74a830dc$var$MenuContext);
84
+ const context = ($parcel$interopDefault($6ZrLO$react)).useContext($31bc1b2a74a830dc$var$MenuContext);
33
85
  if (context === undefined) throw new Error('useMenuContext must be used within a MenuContextProvider');
34
86
  return context;
35
87
  };
@@ -43,7 +95,7 @@ function $453ff7c40e833219$export$d9b273488cd8ce6f(props) {
43
95
  const triggerRef = $6ZrLO$react.useRef(null);
44
96
  const menuListRef = $6ZrLO$react.useRef(null);
45
97
  const menuId = $6ZrLO$contentfulf36core.useId(null, 'menu');
46
- const { focusedIndex: focusedIndex , handleArrowsKeyDown: handleArrowsKeyDown , setFocusedIndex: setFocusedIndex } = $6ZrLO$contentfulf36utils.useArrowKeyNavigation({
98
+ const { focusedIndex: focusedIndex , handleArrowsKeyDown: handleArrowsKeyDown , setFocusedIndex: setFocusedIndex } = $9abfe5cafeb7e9d3$export$e8d01079a7f85a7({
47
99
  itemsContainerRef: menuListRef,
48
100
  itemsSelector: $453ff7c40e833219$var$MENU_ITEMS_SELECTOR
49
101
  });
@@ -177,9 +229,9 @@ function $453ff7c40e833219$export$d9b273488cd8ce6f(props) {
177
229
  isControlled,
178
230
  onOpen
179
231
  ]);
180
- return(/*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).createElement($31bc1b2a74a830dc$export$2cad3fd48ac06579, {
232
+ return(/*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($31bc1b2a74a830dc$export$2cad3fd48ac06579, {
181
233
  value: contextValue
182
- }, /*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).createElement($6ZrLO$contentfulf36popover.Popover, {
234
+ }, /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($6ZrLO$contentfulf36popover.Popover, {
183
235
  ...otherProps,
184
236
  isOpen: isOpen,
185
237
  onClose: handleClose,
@@ -221,9 +273,9 @@ const $453ff7c40e833219$var$useMenuOpenState = (props)=>{
221
273
 
222
274
 
223
275
 
224
- const $62b35dc82bb7def8$var$SubmenuContext = $parcel$interopDefault($6ZrLO$react).createContext(undefined);
276
+ const $62b35dc82bb7def8$var$SubmenuContext = ($parcel$interopDefault($6ZrLO$react)).createContext(undefined);
225
277
  const $62b35dc82bb7def8$export$958673a266cbe049 = ()=>{
226
- const context = $parcel$interopDefault($6ZrLO$react).useContext($62b35dc82bb7def8$var$SubmenuContext);
278
+ const context = ($parcel$interopDefault($6ZrLO$react)).useContext($62b35dc82bb7def8$var$SubmenuContext);
227
279
  return context;
228
280
  };
229
281
  const $62b35dc82bb7def8$export$81b3dbd1f003f0c7 = $62b35dc82bb7def8$var$SubmenuContext.Provider;
@@ -237,9 +289,9 @@ const $ce9788dc1cd48a1b$export$396ce14bde1b7929 = ()=>{
237
289
  position: 'sticky',
238
290
  top: 0,
239
291
  left: 0,
240
- backgroundColor: $parcel$interopDefault($6ZrLO$contentfulf36tokens).colorWhite,
241
- borderBottom: `1px solid ${$parcel$interopDefault($6ZrLO$contentfulf36tokens).gray300}`,
242
- padding: `${$parcel$interopDefault($6ZrLO$contentfulf36tokens).spacingXs} 0`,
292
+ backgroundColor: ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).colorWhite,
293
+ borderBottom: `1px solid ${($parcel$interopDefault($6ZrLO$contentfulf36tokens)).gray300}`,
294
+ padding: `${($parcel$interopDefault($6ZrLO$contentfulf36tokens)).spacingXs} 0`,
243
295
  zIndex: 1001
244
296
  }));
245
297
  };
@@ -248,9 +300,9 @@ const $ce9788dc1cd48a1b$export$fd3dbc8a890448f = ()=>{
248
300
  position: 'sticky',
249
301
  bottom: 0,
250
302
  left: 0,
251
- backgroundColor: $parcel$interopDefault($6ZrLO$contentfulf36tokens).colorWhite,
252
- borderTop: `1px solid ${$parcel$interopDefault($6ZrLO$contentfulf36tokens).gray300}`,
253
- padding: `${$parcel$interopDefault($6ZrLO$contentfulf36tokens).spacingXs} 0`,
303
+ backgroundColor: ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).colorWhite,
304
+ borderTop: `1px solid ${($parcel$interopDefault($6ZrLO$contentfulf36tokens)).gray300}`,
305
+ padding: `${($parcel$interopDefault($6ZrLO$contentfulf36tokens)).spacingXs} 0`,
254
306
  zIndex: 1001
255
307
  }));
256
308
  };
@@ -259,8 +311,8 @@ const $ce9788dc1cd48a1b$export$10ce7613b0465b57 = (props)=>({
259
311
  overflowY: 'auto',
260
312
  position: 'relative',
261
313
  padding: 0,
262
- paddingTop: props.hasStickyHeader ? 0 : $parcel$interopDefault($6ZrLO$contentfulf36tokens).spacingXs,
263
- paddingBottom: props.hasStickyFooter ? 0 : $parcel$interopDefault($6ZrLO$contentfulf36tokens).spacingXs
314
+ paddingTop: props.hasStickyHeader ? 0 : ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).spacingXs,
315
+ paddingBottom: props.hasStickyFooter ? 0 : ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).spacingXs
264
316
  })
265
317
  })
266
318
  ;
@@ -272,7 +324,7 @@ const $ce9788dc1cd48a1b$export$10ce7613b0465b57 = (props)=>({
272
324
  const $77fa76994469c42b$export$77451990ddb9d17c = (props)=>{
273
325
  const { children: children , testId: testId = 'cf-ui-menu-list-header' , className: className , ...otherProps } = props;
274
326
  const styles = $ce9788dc1cd48a1b$export$396ce14bde1b7929();
275
- return(/*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).createElement("div", {
327
+ return(/*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement("div", {
276
328
  "data-test-id": testId,
277
329
  className: $6ZrLO$emotion.cx(styles, className),
278
330
  ...otherProps
@@ -287,7 +339,7 @@ $77fa76994469c42b$export$77451990ddb9d17c.displayName = 'MenuListHeader';
287
339
  const $56409107038e75ac$export$3e8a81e7ad0650f4 = (props)=>{
288
340
  const { children: children , testId: testId = 'cf-ui-menu-list-footer' , className: className , ...otherProps } = props;
289
341
  const styles = $ce9788dc1cd48a1b$export$fd3dbc8a890448f();
290
- return(/*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).createElement("div", {
342
+ return(/*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement("div", {
291
343
  "data-test-id": testId,
292
344
  className: $6ZrLO$emotion.cx(styles, className),
293
345
  ...otherProps
@@ -307,7 +359,7 @@ const $c5bfee6901fd5b47$var$_MenuList = (props, ref)=>{
307
359
  let header = null;
308
360
  let footer = null;
309
361
  const items = [];
310
- $parcel$interopDefault($6ZrLO$react).Children.forEach(children, (child)=>{
362
+ ($parcel$interopDefault($6ZrLO$react)).Children.forEach(children, (child)=>{
311
363
  let appendChild = true;
312
364
  if ($c5bfee6901fd5b47$var$assertChild(child)) {
313
365
  if (child.type.displayName === $77fa76994469c42b$export$77451990ddb9d17c.displayName) {
@@ -325,7 +377,7 @@ const $c5bfee6901fd5b47$var$_MenuList = (props, ref)=>{
325
377
  hasStickyFooter: Boolean(footer)
326
378
  });
327
379
  const extendedOtherProps = submenuContext ? submenuContext.getSubmenuListProps(otherProps) : otherProps;
328
- return(/*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).createElement($6ZrLO$contentfulf36popover.Popover.Content, {
380
+ return(/*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($6ZrLO$contentfulf36popover.Popover.Content, {
329
381
  role: "menu",
330
382
  ...extendedOtherProps,
331
383
  ...getMenuListProps(extendedOtherProps, ref),
@@ -333,7 +385,7 @@ const $c5bfee6901fd5b47$var$_MenuList = (props, ref)=>{
333
385
  testId: testId
334
386
  }, header, items, footer));
335
387
  };
336
- const $c5bfee6901fd5b47$export$d4c4e98c5044dc8 = /*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).forwardRef($c5bfee6901fd5b47$var$_MenuList);
388
+ const $c5bfee6901fd5b47$export$d4c4e98c5044dc8 = /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).forwardRef($c5bfee6901fd5b47$var$_MenuList);
337
389
 
338
390
 
339
391
 
@@ -354,24 +406,24 @@ const $f099c69f76c1082f$export$adaad53e003c74d0 = ()=>{
354
406
  border: 0,
355
407
  margin: 0,
356
408
  outline: 'none',
357
- fontSize: $parcel$interopDefault($6ZrLO$contentfulf36tokens).fontSizeM,
358
- lineHeight: $parcel$interopDefault($6ZrLO$contentfulf36tokens).lineHeightM,
359
- fontWeight: $parcel$interopDefault($6ZrLO$contentfulf36tokens).fontWeightNormal,
409
+ fontSize: ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).fontSizeM,
410
+ lineHeight: ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).lineHeightM,
411
+ fontWeight: ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).fontWeightNormal,
360
412
  position: 'relative',
361
413
  textAlign: 'left',
362
- padding: `${$parcel$interopDefault($6ZrLO$contentfulf36tokens).spacingXs} ${$parcel$interopDefault($6ZrLO$contentfulf36tokens).spacingM}`,
414
+ padding: `${($parcel$interopDefault($6ZrLO$contentfulf36tokens)).spacingXs} ${($parcel$interopDefault($6ZrLO$contentfulf36tokens)).spacingM}`,
363
415
  wordBreak: 'break-word',
364
416
  whiteSpace: 'break-spaces',
365
417
  cursor: 'pointer',
366
418
  hyphens: 'auto',
367
419
  minWidth: '150px',
368
420
  textDecoration: 'none',
369
- color: $parcel$interopDefault($6ZrLO$contentfulf36tokens).gray800,
421
+ color: ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).gray800,
370
422
  '&:focus, &:hover': {
371
- backgroundColor: $parcel$interopDefault($6ZrLO$contentfulf36tokens).gray100
423
+ backgroundColor: ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).gray100
372
424
  },
373
425
  '&:active': {
374
- backgroundColor: $parcel$interopDefault($6ZrLO$contentfulf36tokens).gray200
426
+ backgroundColor: ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).gray200
375
427
  },
376
428
  '&:disabled': {
377
429
  opacity: 0.5,
@@ -397,7 +449,7 @@ function $01d29448a29c05b3$var$_MenuItem(props, ref) {
397
449
  focusMenuItem
398
450
  ]);
399
451
  const Element = as !== null && as !== void 0 ? as : $01d29448a29c05b3$var$MENU_ITEM_DEFAULT_TAG;
400
- return(/*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).createElement(Element, {
452
+ return(/*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement(Element, {
401
453
  role: "menuitem",
402
454
  ...otherProps,
403
455
  ...getMenuItemProps(otherProps),
@@ -407,16 +459,16 @@ function $01d29448a29c05b3$var$_MenuItem(props, ref) {
407
459
  tabIndex: -1
408
460
  }, props.children));
409
461
  }
410
- const $01d29448a29c05b3$export$2ce376c2cc3355c8 = /*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).forwardRef($01d29448a29c05b3$var$_MenuItem);
462
+ const $01d29448a29c05b3$export$2ce376c2cc3355c8 = /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).forwardRef($01d29448a29c05b3$var$_MenuItem);
411
463
 
412
464
 
413
465
 
414
466
 
415
467
 
416
468
  const $57a0b88402c05a1e$export$27d2ad3c5815583e = (props)=>{
417
- const child = $parcel$interopDefault($6ZrLO$react).Children.only(props.children);
469
+ const child = ($parcel$interopDefault($6ZrLO$react)).Children.only(props.children);
418
470
  const { getTriggerProps: getTriggerProps } = $31bc1b2a74a830dc$export$21c7ab35b39f78ec();
419
- return(/*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).createElement($6ZrLO$contentfulf36popover.Popover.Trigger, null, /*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).cloneElement(child, {
471
+ return(/*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($6ZrLO$contentfulf36popover.Popover.Trigger, null, /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).cloneElement(child, {
420
472
  ...getTriggerProps(child.props, child.ref),
421
473
  ['aria-haspopup']: 'menu'
422
474
  })));
@@ -431,8 +483,8 @@ const $f85a558bae23a8bd$export$4605da6f9a8ef405 = ()=>/*#__PURE__*/ $6ZrLO$emoti
431
483
  border: 'none',
432
484
  width: '100%',
433
485
  height: '1px',
434
- background: $parcel$interopDefault($6ZrLO$contentfulf36tokens).gray300,
435
- margin: `${$parcel$interopDefault($6ZrLO$contentfulf36tokens).spacingXs} 0`
486
+ background: ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).gray300,
487
+ margin: `${($parcel$interopDefault($6ZrLO$contentfulf36tokens)).spacingXs} 0`
436
488
  })
437
489
  ;
438
490
 
@@ -440,7 +492,7 @@ const $f85a558bae23a8bd$export$4605da6f9a8ef405 = ()=>/*#__PURE__*/ $6ZrLO$emoti
440
492
  const $a8d7f8a94ad9b120$export$acb07b4664ac227c = (props)=>{
441
493
  const { children: children , testId: testId = 'cf-ui-menu-divider' , className: className , ...otherProps } = props;
442
494
  const styles = $f85a558bae23a8bd$export$4605da6f9a8ef405();
443
- return(/*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).createElement("hr", {
495
+ return(/*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement("hr", {
444
496
  "aria-orientation": "horizontal",
445
497
  "data-test-id": testId,
446
498
  className: $6ZrLO$emotion.cx(styles, className),
@@ -455,8 +507,8 @@ const $a8d7f8a94ad9b120$export$acb07b4664ac227c = (props)=>{
455
507
 
456
508
  const $80d81cb0da14b65a$export$2698fa8b3a0a79e6 = ()=>/*#__PURE__*/ $6ZrLO$emotion.css({
457
509
  textAlign: 'left',
458
- padding: `${$parcel$interopDefault($6ZrLO$contentfulf36tokens).spacingXs} ${$parcel$interopDefault($6ZrLO$contentfulf36tokens).spacingM}`,
459
- lineHeight: $parcel$interopDefault($6ZrLO$contentfulf36tokens).lineHeightM,
510
+ padding: `${($parcel$interopDefault($6ZrLO$contentfulf36tokens)).spacingXs} ${($parcel$interopDefault($6ZrLO$contentfulf36tokens)).spacingM}`,
511
+ lineHeight: ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).lineHeightM,
460
512
  'hr + &': {
461
513
  marginTop: '-8px'
462
514
  }
@@ -468,7 +520,7 @@ const $80d81cb0da14b65a$export$2698fa8b3a0a79e6 = ()=>/*#__PURE__*/ $6ZrLO$emoti
468
520
  const $a9e47e1a6fcc6dbc$export$5d1e6c648985631e = (props)=>{
469
521
  const { children: children , testId: testId = 'cf-ui-menu-section-title' , className: className , ...otherProps } = props;
470
522
  const styles = $80d81cb0da14b65a$export$2698fa8b3a0a79e6();
471
- return(/*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).createElement($6ZrLO$contentfulf36typography.SectionHeading // Techincally, menus cannot contain headings according to ARIA.
523
+ return(/*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($6ZrLO$contentfulf36typography.SectionHeading // Techincally, menus cannot contain headings according to ARIA.
472
524
  , {
473
525
  // We hide the heading from assistive technology, and only use it
474
526
  // as a label
@@ -573,9 +625,9 @@ const $d1c454a08dd2b04a$export$49229ebf838c159b = (props)=>{
573
625
  handleOpen,
574
626
  closeAndFocusTrigger
575
627
  ]);
576
- return(/*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).createElement($62b35dc82bb7def8$export$81b3dbd1f003f0c7, {
628
+ return(/*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($62b35dc82bb7def8$export$81b3dbd1f003f0c7, {
577
629
  value: contextValue
578
- }, /*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).createElement($453ff7c40e833219$export$d9b273488cd8ce6f, {
630
+ }, /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($453ff7c40e833219$export$d9b273488cd8ce6f, {
579
631
  ...propsToPropagateToSubmenus,
580
632
  ...otherProps,
581
633
  isOpen: isOpen,
@@ -601,15 +653,15 @@ const $440a5860c5fbe4e7$export$ce276565acbba1c9 = ()=>{
601
653
  root: ({ isActive: isActive })=>/*#__PURE__*/ $6ZrLO$emotion.css({
602
654
  display: 'flex',
603
655
  alignItems: 'center',
604
- paddingRight: $parcel$interopDefault($6ZrLO$contentfulf36tokens).spacingXs,
656
+ paddingRight: ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).spacingXs,
605
657
  ...isActive ? {
606
- backgroundColor: $parcel$interopDefault($6ZrLO$contentfulf36tokens).gray100
658
+ backgroundColor: ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).gray100
607
659
  } : {
608
660
  }
609
661
  })
610
662
  ,
611
663
  content: /*#__PURE__*/ $6ZrLO$emotion.css({
612
- marginRight: $parcel$interopDefault($6ZrLO$contentfulf36tokens).spacingM
664
+ marginRight: ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).spacingM
613
665
  }),
614
666
  icon: /*#__PURE__*/ $6ZrLO$emotion.css({
615
667
  name: "1hapt0s",
@@ -623,19 +675,19 @@ const $68e427819b978177$var$_SubmenuTrigger = (props, ref)=>{
623
675
  const { className: className , children: children } = props;
624
676
  const { getSubmenuTriggerProps: getSubmenuTriggerProps , isOpen: isOpen } = $62b35dc82bb7def8$export$958673a266cbe049();
625
677
  const styles = $440a5860c5fbe4e7$export$ce276565acbba1c9();
626
- return(/*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).createElement($57a0b88402c05a1e$export$27d2ad3c5815583e, null, /*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).createElement($01d29448a29c05b3$export$2ce376c2cc3355c8, {
678
+ return(/*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($57a0b88402c05a1e$export$27d2ad3c5815583e, null, /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($01d29448a29c05b3$export$2ce376c2cc3355c8, {
627
679
  ...props,
628
680
  ...getSubmenuTriggerProps(props, ref),
629
681
  className: $6ZrLO$emotion.cx(styles.root({
630
682
  isActive: isOpen
631
683
  }), className)
632
- }, /*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).createElement("span", {
684
+ }, /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement("span", {
633
685
  className: styles.content
634
- }, children), /*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).createElement($6ZrLO$contentfulf36icons.ChevronRightIcon, {
686
+ }, children), /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($6ZrLO$contentfulf36icons.ChevronRightIcon, {
635
687
  className: styles.icon
636
688
  }))));
637
689
  };
638
- const $68e427819b978177$export$ecabc99eeffab7ca = /*#__PURE__*/ $parcel$interopDefault($6ZrLO$react).forwardRef($68e427819b978177$var$_SubmenuTrigger);
690
+ const $68e427819b978177$export$ecabc99eeffab7ca = /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).forwardRef($68e427819b978177$var$_SubmenuTrigger);
639
691
 
640
692
 
641
693
  const $c2cdaffe72abf66f$export$d9b273488cd8ce6f = $453ff7c40e833219$export$d9b273488cd8ce6f;
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AGwBA,KAAA,CAAMuH,iCAAW,GAAG5F,oCAAK,CAAC6F,aAAa,CAA8BL,SAAjD;AAEb,KAAA,CAAMM,yCAA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UAAL,GAAkBJ,yCAAlB;AACAjB,yCAAI,CAACsB,UAAL,GAAkBJ,yCAAlB;AACAlB,yCAAI,CAACuB,IAAL,GAAYnB,yCAAZ;AACAJ,yCAAI,CAACwB,OAAL,GAAelB,yCAAf;AACAN,yCAAI,CAACyB,OAAL,GAAejB,yCAAf;AACAR,yCAAI,CAAC0B,YAAL,GAAoBhB,yCAApB;AACAV,yCAAI,CAACY,OAAL,GAAeA,yCAAf;AACAZ,yCAAI,CAACc,cAAL,GAAsBA,yCAAtB","sources":["packages/components/menu/src/index.ts","packages/components/menu/src/CompoundMenu.tsx","packages/components/menu/src/Menu.tsx","packages/components/menu/src/MenuContext.ts","packages/components/menu/src/MenuList/MenuList.tsx","packages/components/menu/src/SubmenuContext.ts","packages/components/menu/src/MenuList/MenuList.styles.ts","packages/components/menu/src/MenuList/MenuListHeader.tsx","packages/components/menu/src/MenuList/MenuListFooter.tsx","packages/components/menu/src/MenuItem/MenuItem.tsx","packages/components/menu/src/MenuItem/MenuItem.styles.ts","packages/components/menu/src/MenuTrigger/MenuTrigger.tsx","packages/components/menu/src/MenuDivider/MenuDivider.tsx","packages/components/menu/src/MenuDivider/MenuDivider.styles.ts","packages/components/menu/src/MenuSectionTitle/MenuSectionTitle.tsx","packages/components/menu/src/MenuSectionTitle/MenuSectionTitle.styles.ts","packages/components/menu/src/Submenu/Submenu.tsx","packages/components/menu/src/SubmenuTrigger/SubmenuTrigger.tsx","packages/components/menu/src/SubmenuTrigger/SubmenuTrigger.styles.ts"],"sourcesContent":["export { Menu } from './CompoundMenu';\nexport type { MenuProps } from './Menu';\nexport { MenuList } from './MenuList/MenuList';\nexport type { MenuListProps } from './MenuList/MenuList';\nexport { MenuItem } from './MenuItem/MenuItem';\nexport type { MenuItemProps } from './MenuItem/MenuItem';\nexport { MenuTrigger } from './MenuTrigger/MenuTrigger';\nexport type { MenuTriggerProps } from './MenuTrigger/MenuTrigger';\nexport { MenuDivider } from './MenuDivider/MenuDivider';\nexport type { MenuDividerProps } from './MenuDivider/MenuDivider';\nexport { MenuSectionTitle } from './MenuSectionTitle/MenuSectionTitle';\nexport type { MenuSectionTitleProps } from './MenuSectionTitle/MenuSectionTitle';\nexport { Submenu } from './Submenu/Submenu';\nexport type { SubmenuProps } from './Submenu/Submenu';\nexport { SubmenuTrigger } from './SubmenuTrigger/SubmenuTrigger';\nexport type { SubmenuTriggerProps } from './SubmenuTrigger/SubmenuTrigger';\n","import { Menu as OriginalMenu } from './Menu';\nimport { MenuList } from './MenuList/MenuList';\nimport { MenuListHeader } from './MenuList/MenuListHeader';\nimport { MenuListFooter } from './MenuList/MenuListFooter';\nimport { MenuItem } from './MenuItem/MenuItem';\nimport { MenuTrigger } from './MenuTrigger/MenuTrigger';\nimport { MenuDivider } from './MenuDivider/MenuDivider';\nimport { MenuSectionTitle } from './MenuSectionTitle/MenuSectionTitle';\nimport { Submenu } from './Submenu/Submenu';\nimport { SubmenuTrigger } from './SubmenuTrigger/SubmenuTrigger';\n\ntype CompoundMenu = typeof OriginalMenu & {\n List: typeof MenuList;\n ListHeader: typeof MenuListHeader;\n ListFooter: typeof MenuListFooter;\n Item: typeof MenuItem;\n Trigger: typeof MenuTrigger;\n Divider: typeof MenuDivider;\n SectionTitle: typeof MenuSectionTitle;\n Submenu: typeof Submenu;\n SubmenuTrigger: typeof SubmenuTrigger;\n};\n\nexport const Menu = OriginalMenu as CompoundMenu;\nMenu.List = MenuList;\nMenu.ListHeader = MenuListHeader;\nMenu.ListFooter = MenuListFooter;\nMenu.Item = MenuItem;\nMenu.Trigger = MenuTrigger;\nMenu.Divider = MenuDivider;\nMenu.SectionTitle = MenuSectionTitle;\nMenu.Submenu = Submenu;\nMenu.SubmenuTrigger = SubmenuTrigger;\n","import React, {\n useState,\n useCallback,\n useMemo,\n useRef,\n useEffect,\n} from 'react';\nimport { mergeRefs, useId } from '@contentful/f36-core';\nimport { useArrowKeyNavigation } from '@contentful/f36-utils';\nimport { Popover, PopoverProps } from '@contentful/f36-popover';\nimport { MenuContextProvider, MenuContextType } from './MenuContext';\n\nconst MENU_ITEMS_SELECTOR = '[role=\"menuitem\"]:not(:disabled)';\n\nexport interface MenuProps\n extends Omit<PopoverProps, 'autoFocus' | 'id' | 'closeOnBlur'> {\n /**\n * If `true`, the Menu will be opened in controlled mode.\n * By default the Menu is uncontrolled\n */\n isOpen?: boolean;\n\n /**\n * If `true`, the Menu will be initially opened.\n */\n defaultIsOpen?: boolean;\n\n /**\n * Callback fired when the Menu opens\n */\n onOpen?: () => void;\n\n /**\n * Callback fired when the Menu closes\n */\n onClose?: () => void;\n\n /**\n * If `true`, the Menu will close when a menu item is\n * clicked\n *\n * Note: This prop will be propagated to all submenus,\n * unless you will override it with props on submenu itself\n *\n * @default true\n */\n closeOnSelect?: boolean;\n\n /**\n * If true, the menu will close when you blur out it by clicking outside\n *\n * Note: This prop will be propagated to all submenus,\n * unless you will override it with props on submenu itself\n *\n * @default true\n */\n closeOnBlur?: boolean;\n\n /**\n * If true, the menu will close when you hit the Esc key\n *\n * Note: This prop will be propagated to all submenus,\n * unless you will override it with props on submenu itself\n *\n * @default true\n */\n closeOnEsc?: boolean;\n}\n\nexport function Menu(props: MenuProps) {\n const {\n closeOnSelect = true,\n closeOnBlur = true,\n closeOnEsc = true,\n children,\n onOpen,\n ...otherProps\n } = props;\n const { isOpen, handleOpen, handleClose, isControlled } = useMenuOpenState(\n props,\n );\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n const menuListRef = useRef<HTMLDivElement>(null);\n\n const menuId = useId(null, 'menu');\n\n const {\n focusedIndex,\n handleArrowsKeyDown,\n setFocusedIndex,\n } = useArrowKeyNavigation({\n itemsContainerRef: menuListRef,\n itemsSelector: MENU_ITEMS_SELECTOR,\n });\n\n useEffect(() => {\n if (isOpen && menuListRef.current) {\n const menuItems = menuListRef.current.querySelectorAll(\n MENU_ITEMS_SELECTOR,\n );\n\n if (menuItems.length > 0 && focusedIndex < menuItems.length) {\n // timeout trick to prevent scroll from jumping\n // when the popover is not positioned correctly yet in the opening phase\n setTimeout(() => {\n (menuItems[focusedIndex] as HTMLElement).focus({\n preventScroll: false,\n });\n }, 0);\n }\n }\n }, [isOpen, focusedIndex]);\n\n const focusMenuItem = useCallback(\n (item: HTMLElement) => {\n const menuItems = menuListRef.current.querySelectorAll(\n MENU_ITEMS_SELECTOR,\n );\n\n const itemIndex = [...menuItems].findIndex(\n (menuItem) => item === menuItem,\n );\n\n if (itemIndex !== -1) {\n setFocusedIndex(itemIndex);\n }\n },\n [setFocusedIndex],\n );\n\n const closeAndFocusTrigger = useCallback(() => {\n handleClose();\n triggerRef.current?.focus({ preventScroll: true });\n }, [handleClose]);\n\n const handleMenuListKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Tab') {\n event.preventDefault();\n closeAndFocusTrigger();\n return;\n }\n\n // we don't want to propagate other keydown events except `Tab`\n event.stopPropagation();\n\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n closeAndFocusTrigger();\n return;\n }\n\n handleArrowsKeyDown(event);\n },\n [closeAndFocusTrigger, handleArrowsKeyDown],\n );\n\n const contextValue: MenuContextType = useMemo(\n () => ({\n isOpen,\n menuId,\n focusMenuItem,\n getTriggerProps: (_props = {}, _ref = null) => ({\n onClick: (event) => {\n // if the user made component controlled by providing isOpen prop\n // but onOpen callback is not provided, we won't add toggle logic\n // to the trigger component. So they can make any toggle logic on their own.\n const isFullyControlled = isControlled && !onOpen;\n\n if (!isFullyControlled) {\n if (isOpen) {\n handleClose();\n } else {\n handleOpen();\n }\n }\n\n _props.onClick?.(event);\n },\n ref: mergeRefs(triggerRef, _ref),\n }),\n getMenuListProps: (_props = {}, _ref = null) => ({\n ref: mergeRefs(menuListRef, _ref),\n onKeyDown: (event) => {\n handleMenuListKeyDown(event);\n _props.onKeyDown?.(event);\n },\n onBlur: (event) => {\n _props.onBlur?.(event);\n\n if (!closeOnBlur) {\n return;\n }\n\n const relatedTarget = event.relatedTarget as Node;\n\n const targetIsMenu =\n menuListRef.current === relatedTarget ||\n menuListRef.current?.contains(relatedTarget);\n const targetIsTrigger =\n triggerRef.current === relatedTarget ||\n triggerRef.current?.contains(relatedTarget);\n const targetIsSubmenu =\n relatedTarget?.parentElement?.dataset.parentMenu === menuId;\n\n if (targetIsMenu || targetIsTrigger || targetIsSubmenu) {\n event.stopPropagation();\n return;\n }\n\n handleClose();\n },\n }),\n getMenuItemProps: (_props = {}) => ({\n onClick: (event) => {\n _props.onClick?.(event);\n\n const isSubmenuTrigger = Boolean(\n (event.target as HTMLElement).getAttribute('aria-haspopup'),\n );\n if (closeOnSelect && !isSubmenuTrigger) {\n closeAndFocusTrigger();\n }\n },\n }),\n propsToPropagateToSubmenus: {\n closeOnSelect,\n closeOnBlur,\n closeOnEsc,\n },\n }),\n [\n menuId,\n isOpen,\n handleMenuListKeyDown,\n closeOnSelect,\n handleClose,\n handleOpen,\n focusMenuItem,\n closeOnBlur,\n closeOnEsc,\n closeAndFocusTrigger,\n isControlled,\n onOpen,\n ],\n );\n\n return (\n <MenuContextProvider value={contextValue}>\n <Popover\n {...otherProps}\n isOpen={isOpen}\n onClose={handleClose}\n id={menuId}\n closeOnEsc={closeOnEsc}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={false}\n closeOnBlur={false}\n >\n {children}\n </Popover>\n </MenuContextProvider>\n );\n}\n\ntype UseMenuOpenStateProps = Pick<\n MenuProps,\n 'isOpen' | 'defaultIsOpen' | 'onOpen' | 'onClose'\n>;\n\nconst useMenuOpenState = (props: UseMenuOpenStateProps) => {\n const { isOpen, defaultIsOpen, onOpen, onClose } = props;\n const [isOpenState, setIsOpen] = useState(defaultIsOpen || false);\n\n const isControlled = isOpen !== undefined;\n const isOpenValue = isControlled ? isOpen : isOpenState;\n\n const handleClose = useCallback(() => {\n if (!isControlled) {\n setIsOpen(false);\n }\n onClose?.();\n }, [isControlled, onClose]);\n\n const handleOpen = useCallback(() => {\n if (!isControlled) {\n setIsOpen(true);\n }\n onOpen?.();\n }, [isControlled, onOpen]);\n\n return { isOpen: isOpenValue, isControlled, handleClose, handleOpen };\n};\n","import React, { ComponentPropsWithRef } from 'react';\nimport { MenuProps } from '.';\n\nexport type MenuContextType = {\n isOpen: boolean;\n menuId: string;\n focusMenuItem: (item: HTMLElement) => void;\n getTriggerProps: (\n _props: ComponentPropsWithRef<'button'>,\n _ref: React.Ref<HTMLButtonElement>,\n ) => ComponentPropsWithRef<'button'>;\n getMenuListProps: (\n _props: ComponentPropsWithRef<'div'>,\n _ref: React.Ref<HTMLDivElement>,\n ) => ComponentPropsWithRef<'div'>;\n getMenuItemProps: (\n _props: ComponentPropsWithRef<'button'>,\n ) => ComponentPropsWithRef<'button'>;\n propsToPropagateToSubmenus: Pick<\n MenuProps,\n 'closeOnBlur' | 'closeOnEsc' | 'closeOnSelect'\n >;\n};\n\nconst MenuContext = React.createContext<MenuContextType | undefined>(undefined);\n\nexport const useMenuContext = () => {\n const context = React.useContext(MenuContext);\n\n if (context === undefined) {\n throw new Error('useMenuContext must be used within a MenuContextProvider');\n }\n\n return context;\n};\n\nexport const MenuContextProvider = MenuContext.Provider;\n","import React from 'react';\nimport { CommonProps, PropsWithHTMLElement } from '@contentful/f36-core';\nimport { useMenuContext } from '../MenuContext';\nimport { useSubmenuContext } from '../SubmenuContext';\nimport { Popover } from '@contentful/f36-popover';\nimport { cx } from 'emotion';\nimport { getMenuListStyles } from './MenuList.styles';\nimport { MenuListHeader } from './MenuListHeader';\nimport { MenuListFooter } from './MenuListFooter';\n\ninterface MenuListInternalProps extends CommonProps {\n children?: React.ReactNode;\n}\n\nfunction assertChild(child: any): child is { type: { displayName: string } } {\n return Boolean(child?.type?.displayName);\n}\n\nexport type MenuListProps = PropsWithHTMLElement<MenuListInternalProps, 'div'>;\n\nconst _MenuList = (props: MenuListProps, ref: React.Ref<HTMLDivElement>) => {\n const {\n children,\n testId = 'cf-ui-menu-list',\n className,\n ...otherProps\n } = props;\n\n const { getMenuListProps } = useMenuContext();\n const submenuContext = useSubmenuContext();\n\n let header: React.ReactElement | null = null;\n let footer: React.ReactElement | null = null;\n const items: React.ReactElement[] = [];\n\n React.Children.forEach(children, (child) => {\n let appendChild = true;\n if (assertChild(child)) {\n if (child.type.displayName === MenuListHeader.displayName) {\n header = (child as unknown) as React.ReactElement;\n appendChild = false;\n } else if (child.type.displayName === MenuListFooter.displayName) {\n footer = (child as unknown) as React.ReactElement;\n appendChild = false;\n }\n }\n if (appendChild) {\n items.push((child as unknown) as React.ReactElement);\n }\n });\n\n const styles = getMenuListStyles({\n hasStickyHeader: Boolean(header),\n hasStickyFooter: Boolean(footer),\n });\n\n const extendedOtherProps = submenuContext\n ? submenuContext.getSubmenuListProps(otherProps)\n : otherProps;\n\n return (\n <Popover.Content\n role=\"menu\"\n {...extendedOtherProps}\n {...getMenuListProps(extendedOtherProps, ref)}\n className={cx(styles.container, className)}\n testId={testId}\n >\n {header}\n {items}\n {footer}\n </Popover.Content>\n );\n};\n\nexport const MenuList = React.forwardRef(_MenuList);\n","import React, { ComponentPropsWithRef, ComponentPropsWithoutRef } from 'react';\n\nexport type SubmenuContextType = {\n isOpen: boolean;\n getSubmenuListProps: (\n _props: ComponentPropsWithRef<'div'>,\n ) => { 'data-parent-menu': string } & ComponentPropsWithoutRef<'div'>;\n getSubmenuTriggerProps: (\n _props: ComponentPropsWithRef<'button'>,\n _ref: React.Ref<HTMLButtonElement>,\n ) => ComponentPropsWithRef<'button'>;\n};\n\nconst SubmenuContext = React.createContext<SubmenuContextType | undefined>(\n undefined,\n);\n\nexport const useSubmenuContext = () => {\n const context = React.useContext(SubmenuContext);\n return context;\n};\n\nexport const SubmenuContextProvider = SubmenuContext.Provider;\n","import { css } from 'emotion';\nimport tokens from '@contentful/f36-tokens';\n\nexport const getMenuHeaderStyles = () => {\n return css({\n position: 'sticky',\n top: 0,\n left: 0,\n backgroundColor: tokens.colorWhite,\n borderBottom: `1px solid ${tokens.gray300}`,\n padding: `${tokens.spacingXs} 0`,\n zIndex: 1001,\n });\n};\n\nexport const getMenuFooterStyles = () => {\n return css({\n position: 'sticky',\n bottom: 0,\n left: 0,\n backgroundColor: tokens.colorWhite,\n borderTop: `1px solid ${tokens.gray300}`,\n padding: `${tokens.spacingXs} 0`,\n zIndex: 1001,\n });\n};\n\nexport const getMenuListStyles = (props: {\n hasStickyFooter?: boolean;\n hasStickyHeader?: boolean;\n}) => ({\n container: css({\n overflowY: 'auto',\n position: 'relative',\n padding: 0,\n paddingTop: props.hasStickyHeader ? 0 : tokens.spacingXs,\n paddingBottom: props.hasStickyFooter ? 0 : tokens.spacingXs,\n }),\n});\n","import React from 'react';\nimport { cx } from 'emotion';\nimport type { CommonProps, PropsWithHTMLElement } from '@contentful/f36-core';\n\nimport { getMenuHeaderStyles } from './MenuList.styles';\n\nexport type MenuListHeaderProps = PropsWithHTMLElement<CommonProps, 'div'>;\n\nexport const MenuListHeader: React.FC<MenuListHeaderProps> = (props) => {\n const {\n children,\n testId = 'cf-ui-menu-list-header',\n className,\n ...otherProps\n } = props;\n\n const styles = getMenuHeaderStyles();\n\n return (\n <div\n data-test-id={testId}\n className={cx(styles, className)}\n {...otherProps}\n >\n {children}\n </div>\n );\n};\n\nMenuListHeader.displayName = 'MenuListHeader';\n","import React from 'react';\nimport { cx } from 'emotion';\nimport type { CommonProps, PropsWithHTMLElement } from '@contentful/f36-core';\n\nimport { getMenuFooterStyles } from './MenuList.styles';\n\nexport type MenuListFooterProps = PropsWithHTMLElement<CommonProps, 'div'>;\n\nexport const MenuListFooter: React.FC<MenuListFooterProps> = (props) => {\n const {\n children,\n testId = 'cf-ui-menu-list-footer',\n className,\n ...otherProps\n } = props;\n\n const styles = getMenuFooterStyles();\n\n return (\n <div\n data-test-id={testId}\n className={cx(styles, className)}\n {...otherProps}\n >\n {children}\n </div>\n );\n};\n\nMenuListFooter.displayName = 'MenuListFooter';\n","import React, { useEffect, useRef } from 'react';\nimport { cx } from 'emotion';\nimport {\n CommonProps,\n mergeRefs,\n PolymorphicComponent,\n PolymorphicProps,\n} from '@contentful/f36-core';\nimport { useMenuContext } from '../MenuContext';\nimport { useId } from '@contentful/f36-core';\nimport { getMenuItemStyles } from './MenuItem.styles';\n\nconst MENU_ITEM_DEFAULT_TAG = 'button';\n\ninterface MenuItemInternalProps extends CommonProps {\n children?: React.ReactNode;\n as?: 'a' | 'button';\n\n /**\n * Sets focus on item\n */\n isInitiallyFocused?: boolean;\n}\n\nexport type MenuItemProps<\n E extends React.ElementType = typeof MENU_ITEM_DEFAULT_TAG\n> = PolymorphicProps<MenuItemInternalProps, E>;\n\nfunction _MenuItem<E extends React.ElementType = typeof MENU_ITEM_DEFAULT_TAG>(\n props: MenuItemProps<E>,\n ref: React.Ref<any>,\n) {\n const { testId, className, as, isInitiallyFocused, ...otherProps } = props;\n\n const id = useId(null, 'menu-item');\n const itemTestId = testId || `cf-ui-${id}`;\n const styles = getMenuItemStyles();\n\n const { getMenuItemProps, focusMenuItem } = useMenuContext();\n\n const itemRef = useRef<HTMLElement>(null);\n useEffect(() => {\n if (isInitiallyFocused && itemRef.current) {\n focusMenuItem(itemRef.current);\n }\n }, [isInitiallyFocused, focusMenuItem]);\n\n const Element = (as ?? MENU_ITEM_DEFAULT_TAG) as React.ElementType;\n\n return (\n <Element\n role=\"menuitem\"\n {...otherProps}\n {...getMenuItemProps(otherProps)}\n className={cx(styles.root, className)}\n data-test-id={itemTestId}\n ref={mergeRefs(itemRef, ref)}\n tabIndex={-1}\n >\n {props.children}\n </Element>\n );\n}\n\nexport const MenuItem: PolymorphicComponent<\n MenuItemInternalProps,\n typeof MENU_ITEM_DEFAULT_TAG\n> = React.forwardRef(_MenuItem);\n","import { css } from 'emotion';\nimport tokens from '@contentful/f36-tokens';\n\nexport const getMenuItemStyles = () => {\n return {\n root: css({\n display: 'block',\n width: '100%',\n background: 'none',\n border: 0,\n margin: 0,\n outline: 'none',\n fontSize: tokens.fontSizeM,\n lineHeight: tokens.lineHeightM,\n fontWeight: tokens.fontWeightNormal,\n position: 'relative',\n textAlign: 'left',\n padding: `${tokens.spacingXs} ${tokens.spacingM}`,\n wordBreak: 'break-word',\n whiteSpace: 'break-spaces',\n cursor: 'pointer',\n hyphens: 'auto',\n minWidth: '150px',\n textDecoration: 'none',\n color: tokens.gray800,\n\n '&:focus, &:hover': {\n backgroundColor: tokens.gray100,\n },\n '&:active': {\n backgroundColor: tokens.gray200,\n },\n '&:disabled': {\n opacity: 0.5,\n cursor: 'auto',\n },\n }),\n };\n};\n","import React from 'react';\nimport { Popover } from '@contentful/f36-popover';\nimport { useMenuContext } from '../MenuContext';\n\nexport interface MenuTriggerProps {\n children: React.ReactNode;\n}\n\nexport const MenuTrigger = (props: MenuTriggerProps) => {\n const child = React.Children.only(props.children) as any;\n const { getTriggerProps } = useMenuContext();\n\n return (\n <Popover.Trigger>\n {React.cloneElement(child, {\n ...getTriggerProps(child.props, child.ref),\n ['aria-haspopup']: 'menu',\n })}\n </Popover.Trigger>\n );\n};\n","import React from 'react';\nimport { CommonProps, PropsWithHTMLElement } from '@contentful/f36-core';\nimport { cx } from 'emotion';\nimport { getMenuDividerStyles } from './MenuDivider.styles';\n\nexport type MenuDividerProps = PropsWithHTMLElement<CommonProps, 'hr'>;\n\nexport const MenuDivider = (props: MenuDividerProps) => {\n const {\n children,\n testId = 'cf-ui-menu-divider',\n className,\n ...otherProps\n } = props;\n\n const styles = getMenuDividerStyles();\n\n return (\n <hr\n aria-orientation=\"horizontal\"\n data-test-id={testId}\n className={cx(styles, className)}\n {...otherProps}\n />\n );\n};\n","import { css } from 'emotion';\nimport tokens from '@contentful/f36-tokens';\n\nexport const getMenuDividerStyles = () =>\n css({\n border: 'none',\n width: '100%',\n height: '1px',\n background: tokens.gray300,\n margin: `${tokens.spacingXs} 0`,\n });\n","import React from 'react';\nimport { cx } from 'emotion';\nimport { getMenuSectionTitleStyles } from './MenuSectionTitle.styles';\nimport {\n SectionHeading,\n SectionHeadingProps,\n} from '@contentful/f36-typography';\n\nexport type MenuSectionTitleProps = SectionHeadingProps;\n\nexport const MenuSectionTitle = (props: MenuSectionTitleProps) => {\n const {\n children,\n testId = 'cf-ui-menu-section-title',\n className,\n ...otherProps\n } = props;\n\n const styles = getMenuSectionTitleStyles();\n\n return (\n <SectionHeading\n // Techincally, menus cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, and only use it\n // as a label\n aria-hidden=\"true\"\n testId={testId}\n className={cx(styles, className)}\n marginBottom=\"none\"\n {...otherProps}\n >\n {children}\n </SectionHeading>\n );\n};\n","import { css } from 'emotion';\nimport tokens from '@contentful/f36-tokens';\n\nexport const getMenuSectionTitleStyles = () =>\n css({\n textAlign: 'left',\n padding: `${tokens.spacingXs} ${tokens.spacingM}`,\n lineHeight: tokens.lineHeightM,\n\n 'hr + &': {\n marginTop: '-8px',\n },\n });\n","import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Menu, MenuProps } from '../Menu';\nimport { useMenuContext } from '../MenuContext';\nimport { SubmenuContextProvider, SubmenuContextType } from '../SubmenuContext';\nimport { mergeRefs } from '@contentful/f36-core';\n\nconst SUBMENU_OFFSET: [number, number] = [-8, 2];\n\nexport type SubmenuProps = Omit<\n MenuProps,\n | 'placement'\n | 'offset'\n | 'usePortal'\n | 'isOpen'\n | 'isAutoalignmentEnabled'\n | 'defaultIsOpen'\n>;\n\nexport const Submenu = (props: SubmenuProps) => {\n const { onClose, onOpen, ...otherProps } = props;\n\n const {\n isOpen: isParentMenuOpen,\n menuId,\n propsToPropagateToSubmenus,\n } = useMenuContext();\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n const mouseLeaveTimerRef = useRef(null);\n\n const [isOpen, setIsOpen] = useState(false);\n const handleOpen = useCallback(() => {\n setIsOpen(true);\n window.clearTimeout(mouseLeaveTimerRef.current);\n\n onOpen?.();\n }, [onOpen]);\n const handleClose = useCallback(() => {\n setIsOpen(false);\n window.clearTimeout(mouseLeaveTimerRef.current);\n\n onClose?.();\n }, [onClose]);\n const closeAndFocusTrigger = useCallback(() => {\n handleClose();\n triggerRef.current?.focus({ preventScroll: true });\n }, [handleClose]);\n\n useEffect(() => {\n // close when parent menu closed\n if (isParentMenuOpen === false) {\n setIsOpen(false);\n }\n }, [isParentMenuOpen]);\n\n const contextValue: SubmenuContextType = useMemo(\n () => ({\n isOpen,\n getSubmenuListProps: (_props) => ({\n 'data-parent-menu': menuId,\n onMouseOver: (event) => {\n handleOpen();\n\n _props.onMouseOver?.(event);\n },\n onMouseLeave: (event) => {\n closeAndFocusTrigger();\n\n _props.onMouseLeave?.(event);\n },\n }),\n getSubmenuTriggerProps: (_props, _ref) => ({\n ref: mergeRefs(triggerRef, _ref),\n onKeyDown: (event) => {\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n handleOpen();\n }\n\n _props.onKeyDown?.(event);\n },\n onMouseOver: (event) => {\n handleOpen();\n\n _props.onMouseOver?.(event);\n },\n onMouseLeave: (event) => {\n mouseLeaveTimerRef.current = window.setTimeout(\n closeAndFocusTrigger,\n 300,\n );\n\n _props.onMouseLeave?.(event);\n },\n }),\n }),\n [isOpen, menuId, handleOpen, closeAndFocusTrigger],\n );\n\n return (\n <SubmenuContextProvider value={contextValue}>\n <Menu\n {...propsToPropagateToSubmenus}\n {...otherProps}\n isOpen={isOpen}\n onClose={handleClose}\n onOpen={handleOpen}\n placement=\"right-start\"\n offset={SUBMENU_OFFSET}\n isAutoalignmentEnabled={false}\n />\n </SubmenuContextProvider>\n );\n};\n","import React from 'react';\nimport { MenuTrigger } from '../MenuTrigger/MenuTrigger';\nimport { MenuItem, MenuItemProps } from '../MenuItem/MenuItem';\nimport { useSubmenuContext } from '../SubmenuContext';\nimport { ChevronRightIcon } from '@contentful/f36-icons';\nimport { cx } from 'emotion';\nimport { getSubmenuTriggerStyles } from './SubmenuTrigger.styles';\n\nexport type SubmenuTriggerProps = Omit<\n MenuItemProps<'button'>,\n 'isInitiallyFocused' | 'as'\n>;\n\nconst _SubmenuTrigger = (\n props: SubmenuTriggerProps,\n ref: React.Ref<HTMLButtonElement>,\n) => {\n const { className, children } = props;\n const { getSubmenuTriggerProps, isOpen } = useSubmenuContext();\n\n const styles = getSubmenuTriggerStyles();\n\n return (\n <MenuTrigger>\n <MenuItem\n {...props}\n {...getSubmenuTriggerProps(props, ref)}\n className={cx(styles.root({ isActive: isOpen }), className)}\n >\n <span className={styles.content}>{children}</span>\n <ChevronRightIcon className={styles.icon} />\n </MenuItem>\n </MenuTrigger>\n );\n};\n\nexport const SubmenuTrigger = React.forwardRef(_SubmenuTrigger);\n","import { css } from 'emotion';\nimport tokens from '@contentful/f36-tokens';\n\nexport const getSubmenuTriggerStyles = () => {\n return {\n root: ({ isActive }) =>\n css({\n display: 'flex',\n alignItems: 'center',\n paddingRight: tokens.spacingXs,\n ...(isActive\n ? {\n backgroundColor: tokens.gray100,\n }\n : {}),\n }),\n content: css({\n marginRight: tokens.spacingM,\n }),\n icon: css({\n marginLeft: 'auto',\n fill: 'currentColor',\n }),\n };\n};\n"],"names":["Menu","MenuProps","MenuList","MenuListProps","MenuItem","MenuItemProps","MenuTrigger","MenuTriggerProps","MenuDivider","MenuDividerProps","MenuSectionTitle","MenuSectionTitleProps","Submenu","SubmenuProps","SubmenuTrigger","SubmenuTriggerProps","OriginalMenu","MenuListHeader","MenuListFooter","CompoundMenu","List","ListHeader","ListFooter","Item","Trigger","Divider","SectionTitle","React","useState","useCallback","useMemo","useRef","useEffect","mergeRefs","useId","useArrowKeyNavigation","Popover","PopoverProps","MenuContextProvider","MenuContextType","MENU_ITEMS_SELECTOR","Omit","isOpen","defaultIsOpen","onOpen","onClose","closeOnSelect","closeOnBlur","closeOnEsc","props","children","otherProps","handleOpen","handleClose","isControlled","useMenuOpenState","triggerRef","HTMLButtonElement","menuListRef","HTMLDivElement","menuId","focusedIndex","handleArrowsKeyDown","setFocusedIndex","itemsContainerRef","itemsSelector","current","menuItems","querySelectorAll","length","setTimeout","HTMLElement","focus","preventScroll","focusMenuItem","item","itemIndex","findIndex","menuItem","closeAndFocusTrigger","handleMenuListKeyDown","event","KeyboardEvent","key","preventDefault","stopPropagation","contextValue","getTriggerProps","_props","_ref","onClick","isFullyControlled","ref","getMenuListProps","onKeyDown","onBlur","relatedTarget","Node","targetIsMenu","contains","targetIsTrigger","targetIsSubmenu","parentElement","dataset","parentMenu","getMenuItemProps","isSubmenuTrigger","Boolean","target","getAttribute","propsToPropagateToSubmenus","UseMenuOpenStateProps","Pick","isOpenState","setIsOpen","undefined","isOpenValue","ComponentPropsWithRef","Ref","MenuContext","createContext","useMenuContext","context","useContext","Error","Provider","CommonProps","PropsWithHTMLElement","useSubmenuContext","getMenuListStyles","MenuListInternalProps","ReactNode","assertChild","child","type","displayName","_MenuList","testId","className","submenuContext","header","ReactElement","footer","items","Children","forEach","appendChild","push","styles","hasStickyHeader","hasStickyFooter","extendedOtherProps","getSubmenuListProps","container","forwardRef","ComponentPropsWithoutRef","SubmenuContextType","getSubmenuTriggerProps","SubmenuContext","SubmenuContextProvider","tokens","getMenuHeaderStyles","position","top","left","backgroundColor","colorWhite","borderBottom","gray300","padding","spacingXs","zIndex","getMenuFooterStyles","bottom","borderTop","overflowY","paddingTop","paddingBottom","MenuListHeaderProps","FC","MenuListFooterProps","PolymorphicComponent","PolymorphicProps","getMenuItemStyles","MENU_ITEM_DEFAULT_TAG","MenuItemInternalProps","as","isInitiallyFocused","ElementType","E","_MenuItem","id","itemTestId","itemRef","Element","root","display","width","background","border","margin","outline","fontSize","fontSizeM","lineHeight","lineHeightM","fontWeight","fontWeightNormal","textAlign","spacingM","wordBreak","whiteSpace","cursor","hyphens","minWidth","textDecoration","color","gray800","gray100","gray200","opacity","only","cloneElement","getMenuDividerStyles","height","getMenuSectionTitleStyles","SectionHeading","SectionHeadingProps","marginTop","SUBMENU_OFFSET","isParentMenuOpen","mouseLeaveTimerRef","window","clearTimeout","onMouseOver","onMouseLeave","ChevronRightIcon","getSubmenuTriggerStyles","_SubmenuTrigger","isActive","content","icon","alignItems","paddingRight","marginRight"],"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A1B,CAAA,GAAqCyG,yCAAiB;IAE5D,KAAA,CAAMmB,MAAM,GAAGwF,yCAAuB;IAEtC,MAAA,oEACG,yCAAD,2EACG,yCAAD;WACM7M,KAAJ;WACI6H,sBAAsB,CAAC7H,KAAD,EAAQ2C,GAAR;QAC1B,SAAA,EAAW,iBAAA,CAAG0E,MAAM,CAAC8C,IAAP,CAAY,CAHlC;YAGoC4C,QAAQ,EAAEtN,MAAVsN;QAAF,CAAZ,GAAmCnG,SAAtC;0EAEV,CAAD;QAAM,SAAA,EAAWS,MAAM,CAAC2F,OAAR;OAAkB/M,QAAD,sEAChC,0CAAD;QAAkB,SAAA,EAAWoH,MAAM,CAAC4F,IAAR;;AAInC,CArBD;AAuBO,KAAA,CAAMpP,yCAAc,iBAAGa,sCAAK,CAACgJ,UAAN,CAAiBoF,qCAAjB;;;AjBdvB,KAAA,CAAM/P,yCAAI,GAAGgB,yCAAY;AAChChB,yCAAI,CAACoB,IAAL,GAAYlB,wCAAZ;AACAF,yCAAI,CAACqB,UAAL,GAAkBJ,yCAAlB;AACAjB,yCAAI,CAACsB,UAAL,GAAkBJ,yCAAlB;AACAlB,yCAAI,CAACuB,IAAL,GAAYnB,yCAAZ;AACAJ,yCAAI,CAACwB,OAAL,GAAelB,yCAAf;AACAN,yCAAI,CAACyB,OAAL,GAAejB,yCAAf;AACAR,yCAAI,CAAC0B,YAAL,GAAoBhB,yCAApB;AACAV,yCAAI,CAACY,OAAL,GAAeA,yCAAf;AACAZ,yCAAI,CAACc,cAAL,GAAsBA,yCAAtB","sources":["packages/components/menu/src/index.ts","packages/components/menu/src/CompoundMenu.tsx","packages/components/menu/src/Menu.tsx","packages/components/menu/src/useArrowKeyNavigation.ts","packages/components/menu/src/MenuContext.ts","packages/components/menu/src/MenuList/MenuList.tsx","packages/components/menu/src/SubmenuContext.ts","packages/components/menu/src/MenuList/MenuList.styles.ts","packages/components/menu/src/MenuList/MenuListHeader.tsx","packages/components/menu/src/MenuList/MenuListFooter.tsx","packages/components/menu/src/MenuItem/MenuItem.tsx","packages/components/menu/src/MenuItem/MenuItem.styles.ts","packages/components/menu/src/MenuTrigger/MenuTrigger.tsx","packages/components/menu/src/MenuDivider/MenuDivider.tsx","packages/components/menu/src/MenuDivider/MenuDivider.styles.ts","packages/components/menu/src/MenuSectionTitle/MenuSectionTitle.tsx","packages/components/menu/src/MenuSectionTitle/MenuSectionTitle.styles.ts","packages/components/menu/src/Submenu/Submenu.tsx","packages/components/menu/src/SubmenuTrigger/SubmenuTrigger.tsx","packages/components/menu/src/SubmenuTrigger/SubmenuTrigger.styles.ts"],"sourcesContent":["export { Menu } from './CompoundMenu';\nexport type { MenuProps } from './Menu';\nexport { MenuList } from './MenuList/MenuList';\nexport type { MenuListProps } from './MenuList/MenuList';\nexport { MenuItem } from './MenuItem/MenuItem';\nexport type { MenuItemProps } from './MenuItem/MenuItem';\nexport { MenuTrigger } from './MenuTrigger/MenuTrigger';\nexport type { MenuTriggerProps } from './MenuTrigger/MenuTrigger';\nexport { MenuDivider } from './MenuDivider/MenuDivider';\nexport type { MenuDividerProps } from './MenuDivider/MenuDivider';\nexport { MenuSectionTitle } from './MenuSectionTitle/MenuSectionTitle';\nexport type { MenuSectionTitleProps } from './MenuSectionTitle/MenuSectionTitle';\nexport { Submenu } from './Submenu/Submenu';\nexport type { SubmenuProps } from './Submenu/Submenu';\nexport { SubmenuTrigger } from './SubmenuTrigger/SubmenuTrigger';\nexport type { SubmenuTriggerProps } from './SubmenuTrigger/SubmenuTrigger';\n","import { Menu as OriginalMenu } from './Menu';\nimport { MenuList } from './MenuList/MenuList';\nimport { MenuListHeader } from './MenuList/MenuListHeader';\nimport { MenuListFooter } from './MenuList/MenuListFooter';\nimport { MenuItem } from './MenuItem/MenuItem';\nimport { MenuTrigger } from './MenuTrigger/MenuTrigger';\nimport { MenuDivider } from './MenuDivider/MenuDivider';\nimport { MenuSectionTitle } from './MenuSectionTitle/MenuSectionTitle';\nimport { Submenu } from './Submenu/Submenu';\nimport { SubmenuTrigger } from './SubmenuTrigger/SubmenuTrigger';\n\ntype CompoundMenu = typeof OriginalMenu & {\n List: typeof MenuList;\n ListHeader: typeof MenuListHeader;\n ListFooter: typeof MenuListFooter;\n Item: typeof MenuItem;\n Trigger: typeof MenuTrigger;\n Divider: typeof MenuDivider;\n SectionTitle: typeof MenuSectionTitle;\n Submenu: typeof Submenu;\n SubmenuTrigger: typeof SubmenuTrigger;\n};\n\nexport const Menu = OriginalMenu as CompoundMenu;\nMenu.List = MenuList;\nMenu.ListHeader = MenuListHeader;\nMenu.ListFooter = MenuListFooter;\nMenu.Item = MenuItem;\nMenu.Trigger = MenuTrigger;\nMenu.Divider = MenuDivider;\nMenu.SectionTitle = MenuSectionTitle;\nMenu.Submenu = Submenu;\nMenu.SubmenuTrigger = SubmenuTrigger;\n","import React, {\n useState,\n useCallback,\n useMemo,\n useRef,\n useEffect,\n} from 'react';\nimport { mergeRefs, useId } from '@contentful/f36-core';\nimport { useArrowKeyNavigation } from './useArrowKeyNavigation';\nimport { Popover, PopoverProps } from '@contentful/f36-popover';\nimport { MenuContextProvider, MenuContextType } from './MenuContext';\n\nconst MENU_ITEMS_SELECTOR = '[role=\"menuitem\"]:not(:disabled)';\n\nexport interface MenuProps\n extends Omit<PopoverProps, 'autoFocus' | 'id' | 'closeOnBlur'> {\n /**\n * If `true`, the Menu will be opened in controlled mode.\n * By default the Menu is uncontrolled\n */\n isOpen?: boolean;\n\n /**\n * If `true`, the Menu will be initially opened.\n */\n defaultIsOpen?: boolean;\n\n /**\n * Callback fired when the Menu opens\n */\n onOpen?: () => void;\n\n /**\n * Callback fired when the Menu closes\n */\n onClose?: () => void;\n\n /**\n * If `true`, the Menu will close when a menu item is\n * clicked\n *\n * Note: This prop will be propagated to all submenus,\n * unless you will override it with props on submenu itself\n *\n * @default true\n */\n closeOnSelect?: boolean;\n\n /**\n * If true, the menu will close when you blur out it by clicking outside\n *\n * Note: This prop will be propagated to all submenus,\n * unless you will override it with props on submenu itself\n *\n * @default true\n */\n closeOnBlur?: boolean;\n\n /**\n * If true, the menu will close when you hit the Esc key\n *\n * Note: This prop will be propagated to all submenus,\n * unless you will override it with props on submenu itself\n *\n * @default true\n */\n closeOnEsc?: boolean;\n}\n\nexport function Menu(props: MenuProps) {\n const {\n closeOnSelect = true,\n closeOnBlur = true,\n closeOnEsc = true,\n children,\n onOpen,\n ...otherProps\n } = props;\n const { isOpen, handleOpen, handleClose, isControlled } = useMenuOpenState(\n props,\n );\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n const menuListRef = useRef<HTMLDivElement>(null);\n\n const menuId = useId(null, 'menu');\n\n const {\n focusedIndex,\n handleArrowsKeyDown,\n setFocusedIndex,\n } = useArrowKeyNavigation({\n itemsContainerRef: menuListRef,\n itemsSelector: MENU_ITEMS_SELECTOR,\n });\n\n useEffect(() => {\n if (isOpen && menuListRef.current) {\n const menuItems = menuListRef.current.querySelectorAll(\n MENU_ITEMS_SELECTOR,\n );\n\n if (menuItems.length > 0 && focusedIndex < menuItems.length) {\n // timeout trick to prevent scroll from jumping\n // when the popover is not positioned correctly yet in the opening phase\n setTimeout(() => {\n (menuItems[focusedIndex] as HTMLElement).focus({\n preventScroll: false,\n });\n }, 0);\n }\n }\n }, [isOpen, focusedIndex]);\n\n const focusMenuItem = useCallback(\n (item: HTMLElement) => {\n const menuItems = menuListRef.current.querySelectorAll(\n MENU_ITEMS_SELECTOR,\n );\n\n const itemIndex = [...menuItems].findIndex(\n (menuItem) => item === menuItem,\n );\n\n if (itemIndex !== -1) {\n setFocusedIndex(itemIndex);\n }\n },\n [setFocusedIndex],\n );\n\n const closeAndFocusTrigger = useCallback(() => {\n handleClose();\n triggerRef.current?.focus({ preventScroll: true });\n }, [handleClose]);\n\n const handleMenuListKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Tab') {\n event.preventDefault();\n closeAndFocusTrigger();\n return;\n }\n\n // we don't want to propagate other keydown events except `Tab`\n event.stopPropagation();\n\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n closeAndFocusTrigger();\n return;\n }\n\n handleArrowsKeyDown(event);\n },\n [closeAndFocusTrigger, handleArrowsKeyDown],\n );\n\n const contextValue: MenuContextType = useMemo(\n () => ({\n isOpen,\n menuId,\n focusMenuItem,\n getTriggerProps: (_props = {}, _ref = null) => ({\n onClick: (event) => {\n // if the user made component controlled by providing isOpen prop\n // but onOpen callback is not provided, we won't add toggle logic\n // to the trigger component. So they can make any toggle logic on their own.\n const isFullyControlled = isControlled && !onOpen;\n\n if (!isFullyControlled) {\n if (isOpen) {\n handleClose();\n } else {\n handleOpen();\n }\n }\n\n _props.onClick?.(event);\n },\n ref: mergeRefs(triggerRef, _ref),\n }),\n getMenuListProps: (_props = {}, _ref = null) => ({\n ref: mergeRefs(menuListRef, _ref),\n onKeyDown: (event) => {\n handleMenuListKeyDown(event);\n _props.onKeyDown?.(event);\n },\n onBlur: (event) => {\n _props.onBlur?.(event);\n\n if (!closeOnBlur) {\n return;\n }\n\n const relatedTarget = event.relatedTarget as Node;\n\n const targetIsMenu =\n menuListRef.current === relatedTarget ||\n menuListRef.current?.contains(relatedTarget);\n const targetIsTrigger =\n triggerRef.current === relatedTarget ||\n triggerRef.current?.contains(relatedTarget);\n const targetIsSubmenu =\n relatedTarget?.parentElement?.dataset.parentMenu === menuId;\n\n if (targetIsMenu || targetIsTrigger || targetIsSubmenu) {\n event.stopPropagation();\n return;\n }\n\n handleClose();\n },\n }),\n getMenuItemProps: (_props = {}) => ({\n onClick: (event) => {\n _props.onClick?.(event);\n\n const isSubmenuTrigger = Boolean(\n (event.target as HTMLElement).getAttribute('aria-haspopup'),\n );\n if (closeOnSelect && !isSubmenuTrigger) {\n closeAndFocusTrigger();\n }\n },\n }),\n propsToPropagateToSubmenus: {\n closeOnSelect,\n closeOnBlur,\n closeOnEsc,\n },\n }),\n [\n menuId,\n isOpen,\n handleMenuListKeyDown,\n closeOnSelect,\n handleClose,\n handleOpen,\n focusMenuItem,\n closeOnBlur,\n closeOnEsc,\n closeAndFocusTrigger,\n isControlled,\n onOpen,\n ],\n );\n\n return (\n <MenuContextProvider value={contextValue}>\n <Popover\n {...otherProps}\n isOpen={isOpen}\n onClose={handleClose}\n id={menuId}\n closeOnEsc={closeOnEsc}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={false}\n closeOnBlur={false}\n >\n {children}\n </Popover>\n </MenuContextProvider>\n );\n}\n\ntype UseMenuOpenStateProps = Pick<\n MenuProps,\n 'isOpen' | 'defaultIsOpen' | 'onOpen' | 'onClose'\n>;\n\nconst useMenuOpenState = (props: UseMenuOpenStateProps) => {\n const { isOpen, defaultIsOpen, onOpen, onClose } = props;\n const [isOpenState, setIsOpen] = useState(defaultIsOpen || false);\n\n const isControlled = isOpen !== undefined;\n const isOpenValue = isControlled ? isOpen : isOpenState;\n\n const handleClose = useCallback(() => {\n if (!isControlled) {\n setIsOpen(false);\n }\n onClose?.();\n }, [isControlled, onClose]);\n\n const handleOpen = useCallback(() => {\n if (!isControlled) {\n setIsOpen(true);\n }\n onOpen?.();\n }, [isControlled, onOpen]);\n\n return { isOpen: isOpenValue, isControlled, handleClose, handleOpen };\n};\n","import { useState, useCallback } from 'react';\n\ninterface UseArrowKeyNavigationProps {\n itemsContainerRef: React.MutableRefObject<HTMLElement>;\n itemsSelector: string;\n keyType?: 'vertical' | 'horizontal';\n initialFocusedIndex?: number;\n}\n\nconst ARROW_KEY_TYPES = {\n vertical: {\n prev: 'ArrowUp',\n next: 'ArrowDown',\n },\n horizontal: {\n prev: 'ArrowLeft',\n next: 'ArrowRight',\n },\n};\n\nexport const useArrowKeyNavigation = ({\n itemsContainerRef,\n itemsSelector,\n keyType = 'vertical',\n}: UseArrowKeyNavigationProps) => {\n const [focusedIndex, setFocusedIndex] = useState<number>(0);\n\n const handleArrowsKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n const container = itemsContainerRef.current;\n if (!container) return;\n\n const items = container.querySelectorAll(itemsSelector);\n if (items.length === 0) return;\n\n const lastItemIndex = items.length - 1;\n\n const focusFirstItem = () => setFocusedIndex(0);\n const focusLastItem = () => setFocusedIndex(lastItemIndex);\n const focusNextItem = () => {\n if (focusedIndex === lastItemIndex) {\n focusFirstItem();\n } else {\n setFocusedIndex(focusedIndex + 1);\n }\n };\n const focusPrevItem = () => {\n if (focusedIndex === 0) {\n focusLastItem();\n } else {\n setFocusedIndex(focusedIndex - 1);\n }\n };\n\n const keyToFnMap = {\n [ARROW_KEY_TYPES[keyType].next]: focusNextItem,\n [ARROW_KEY_TYPES[keyType].prev]: focusPrevItem,\n };\n\n const fn = keyToFnMap[event.key];\n if (fn) {\n event.preventDefault();\n fn();\n }\n },\n [focusedIndex, itemsSelector, itemsContainerRef, keyType],\n );\n\n return { focusedIndex, handleArrowsKeyDown, setFocusedIndex };\n};\n","import React, { ComponentPropsWithRef } from 'react';\nimport { MenuProps } from '.';\n\nexport type MenuContextType = {\n isOpen: boolean;\n menuId: string;\n focusMenuItem: (item: HTMLElement) => void;\n getTriggerProps: (\n _props: ComponentPropsWithRef<'button'>,\n _ref: React.Ref<HTMLButtonElement>,\n ) => ComponentPropsWithRef<'button'>;\n getMenuListProps: (\n _props: ComponentPropsWithRef<'div'>,\n _ref: React.Ref<HTMLDivElement>,\n ) => ComponentPropsWithRef<'div'>;\n getMenuItemProps: (\n _props: ComponentPropsWithRef<'button'>,\n ) => ComponentPropsWithRef<'button'>;\n propsToPropagateToSubmenus: Pick<\n MenuProps,\n 'closeOnBlur' | 'closeOnEsc' | 'closeOnSelect'\n >;\n};\n\nconst MenuContext = React.createContext<MenuContextType | undefined>(undefined);\n\nexport const useMenuContext = () => {\n const context = React.useContext(MenuContext);\n\n if (context === undefined) {\n throw new Error('useMenuContext must be used within a MenuContextProvider');\n }\n\n return context;\n};\n\nexport const MenuContextProvider = MenuContext.Provider;\n","import React from 'react';\nimport {\n CommonProps,\n PropsWithHTMLElement,\n ExpandProps,\n} from '@contentful/f36-core';\nimport { useMenuContext } from '../MenuContext';\nimport { useSubmenuContext } from '../SubmenuContext';\nimport { Popover } from '@contentful/f36-popover';\nimport { cx } from 'emotion';\nimport { getMenuListStyles } from './MenuList.styles';\nimport { MenuListHeader } from './MenuListHeader';\nimport { MenuListFooter } from './MenuListFooter';\n\ninterface MenuListInternalProps extends CommonProps {\n children?: React.ReactNode;\n}\n\nfunction assertChild(child: any): child is { type: { displayName: string } } {\n return Boolean(child?.type?.displayName);\n}\n\nexport type MenuListProps = PropsWithHTMLElement<MenuListInternalProps, 'div'>;\n\nconst _MenuList = (\n props: ExpandProps<MenuListProps>,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n children,\n testId = 'cf-ui-menu-list',\n className,\n ...otherProps\n } = props;\n\n const { getMenuListProps } = useMenuContext();\n const submenuContext = useSubmenuContext();\n\n let header: React.ReactElement | null = null;\n let footer: React.ReactElement | null = null;\n const items: React.ReactElement[] = [];\n\n React.Children.forEach(children, (child) => {\n let appendChild = true;\n if (assertChild(child)) {\n if (child.type.displayName === MenuListHeader.displayName) {\n header = (child as unknown) as React.ReactElement;\n appendChild = false;\n } else if (child.type.displayName === MenuListFooter.displayName) {\n footer = (child as unknown) as React.ReactElement;\n appendChild = false;\n }\n }\n if (appendChild) {\n items.push((child as unknown) as React.ReactElement);\n }\n });\n\n const styles = getMenuListStyles({\n hasStickyHeader: Boolean(header),\n hasStickyFooter: Boolean(footer),\n });\n\n const extendedOtherProps = submenuContext\n ? submenuContext.getSubmenuListProps(otherProps)\n : otherProps;\n\n return (\n <Popover.Content\n role=\"menu\"\n {...extendedOtherProps}\n {...getMenuListProps(extendedOtherProps, ref)}\n className={cx(styles.container, className)}\n testId={testId}\n >\n {header}\n {items}\n {footer}\n </Popover.Content>\n );\n};\n\nexport const MenuList = React.forwardRef(_MenuList);\n","import React, { ComponentPropsWithRef, ComponentPropsWithoutRef } from 'react';\n\nexport type SubmenuContextType = {\n isOpen: boolean;\n getSubmenuListProps: (\n _props: ComponentPropsWithRef<'div'>,\n ) => { 'data-parent-menu': string } & ComponentPropsWithoutRef<'div'>;\n getSubmenuTriggerProps: (\n _props: ComponentPropsWithRef<'button'>,\n _ref: React.Ref<HTMLButtonElement>,\n ) => ComponentPropsWithRef<'button'>;\n};\n\nconst SubmenuContext = React.createContext<SubmenuContextType | undefined>(\n undefined,\n);\n\nexport const useSubmenuContext = () => {\n const context = React.useContext(SubmenuContext);\n return context;\n};\n\nexport const SubmenuContextProvider = SubmenuContext.Provider;\n","import { css } from 'emotion';\nimport tokens from '@contentful/f36-tokens';\n\nexport const getMenuHeaderStyles = () => {\n return css({\n position: 'sticky',\n top: 0,\n left: 0,\n backgroundColor: tokens.colorWhite,\n borderBottom: `1px solid ${tokens.gray300}`,\n padding: `${tokens.spacingXs} 0`,\n zIndex: 1001,\n });\n};\n\nexport const getMenuFooterStyles = () => {\n return css({\n position: 'sticky',\n bottom: 0,\n left: 0,\n backgroundColor: tokens.colorWhite,\n borderTop: `1px solid ${tokens.gray300}`,\n padding: `${tokens.spacingXs} 0`,\n zIndex: 1001,\n });\n};\n\nexport const getMenuListStyles = (props: {\n hasStickyFooter?: boolean;\n hasStickyHeader?: boolean;\n}) => ({\n container: css({\n overflowY: 'auto',\n position: 'relative',\n padding: 0,\n paddingTop: props.hasStickyHeader ? 0 : tokens.spacingXs,\n paddingBottom: props.hasStickyFooter ? 0 : tokens.spacingXs,\n }),\n});\n","import React from 'react';\nimport { cx } from 'emotion';\nimport type {\n CommonProps,\n PropsWithHTMLElement,\n ExpandProps,\n} from '@contentful/f36-core';\n\nimport { getMenuHeaderStyles } from './MenuList.styles';\n\nexport type MenuListHeaderProps = PropsWithHTMLElement<CommonProps, 'div'>;\n\nexport const MenuListHeader: React.FC<ExpandProps<MenuListHeaderProps>> = (\n props,\n) => {\n const {\n children,\n testId = 'cf-ui-menu-list-header',\n className,\n ...otherProps\n } = props;\n\n const styles = getMenuHeaderStyles();\n\n return (\n <div\n data-test-id={testId}\n className={cx(styles, className)}\n {...otherProps}\n >\n {children}\n </div>\n );\n};\n\nMenuListHeader.displayName = 'MenuListHeader';\n","import React from 'react';\nimport { cx } from 'emotion';\nimport type {\n CommonProps,\n PropsWithHTMLElement,\n ExpandProps,\n} from '@contentful/f36-core';\n\nimport { getMenuFooterStyles } from './MenuList.styles';\n\nexport type MenuListFooterProps = PropsWithHTMLElement<CommonProps, 'div'>;\n\nexport const MenuListFooter: React.FC<ExpandProps<MenuListFooterProps>> = (\n props,\n) => {\n const {\n children,\n testId = 'cf-ui-menu-list-footer',\n className,\n ...otherProps\n } = props;\n\n const styles = getMenuFooterStyles();\n\n return (\n <div\n data-test-id={testId}\n className={cx(styles, className)}\n {...otherProps}\n >\n {children}\n </div>\n );\n};\n\nMenuListFooter.displayName = 'MenuListFooter';\n","import React, { useEffect, useRef } from 'react';\nimport { cx } from 'emotion';\nimport {\n CommonProps,\n mergeRefs,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport { useMenuContext } from '../MenuContext';\nimport { useId } from '@contentful/f36-core';\nimport { getMenuItemStyles } from './MenuItem.styles';\n\nconst MENU_ITEM_DEFAULT_TAG = 'button';\n\ninterface MenuItemInternalProps extends CommonProps {\n children?: React.ReactNode;\n as?: 'a' | 'button';\n\n /**\n * Sets focus on item\n */\n isInitiallyFocused?: boolean;\n}\n\nexport type MenuItemProps<\n E extends React.ElementType = typeof MENU_ITEM_DEFAULT_TAG\n> = PolymorphicProps<MenuItemInternalProps, E>;\n\nfunction _MenuItem<E extends React.ElementType = typeof MENU_ITEM_DEFAULT_TAG>(\n props: MenuItemProps<E>,\n ref: React.Ref<any>,\n) {\n const { testId, className, as, isInitiallyFocused, ...otherProps } = props;\n\n const id = useId(null, 'menu-item');\n const itemTestId = testId || `cf-ui-${id}`;\n const styles = getMenuItemStyles();\n\n const { getMenuItemProps, focusMenuItem } = useMenuContext();\n\n const itemRef = useRef<HTMLElement>(null);\n useEffect(() => {\n if (isInitiallyFocused && itemRef.current) {\n focusMenuItem(itemRef.current);\n }\n }, [isInitiallyFocused, focusMenuItem]);\n\n const Element = (as ?? MENU_ITEM_DEFAULT_TAG) as React.ElementType;\n\n return (\n <Element\n role=\"menuitem\"\n {...otherProps}\n {...getMenuItemProps(otherProps)}\n className={cx(styles.root, className)}\n data-test-id={itemTestId}\n ref={mergeRefs(itemRef, ref)}\n tabIndex={-1}\n >\n {props.children}\n </Element>\n );\n}\n\nexport const MenuItem: PolymorphicComponent<\n ExpandProps<MenuItemInternalProps>,\n typeof MENU_ITEM_DEFAULT_TAG\n> = React.forwardRef(_MenuItem);\n","import { css } from 'emotion';\nimport tokens from '@contentful/f36-tokens';\n\nexport const getMenuItemStyles = () => {\n return {\n root: css({\n display: 'block',\n width: '100%',\n background: 'none',\n border: 0,\n margin: 0,\n outline: 'none',\n fontSize: tokens.fontSizeM,\n lineHeight: tokens.lineHeightM,\n fontWeight: tokens.fontWeightNormal,\n position: 'relative',\n textAlign: 'left',\n padding: `${tokens.spacingXs} ${tokens.spacingM}`,\n wordBreak: 'break-word',\n whiteSpace: 'break-spaces',\n cursor: 'pointer',\n hyphens: 'auto',\n minWidth: '150px',\n textDecoration: 'none',\n color: tokens.gray800,\n\n '&:focus, &:hover': {\n backgroundColor: tokens.gray100,\n },\n '&:active': {\n backgroundColor: tokens.gray200,\n },\n '&:disabled': {\n opacity: 0.5,\n cursor: 'auto',\n },\n }),\n };\n};\n","import React from 'react';\nimport { Popover } from '@contentful/f36-popover';\nimport { useMenuContext } from '../MenuContext';\nimport { ExpandProps } from '@contentful/f36-core';\n\nexport interface MenuTriggerProps {\n children: React.ReactNode;\n}\n\nexport const MenuTrigger = (props: ExpandProps<MenuTriggerProps>) => {\n const child = React.Children.only(props.children) as any;\n const { getTriggerProps } = useMenuContext();\n\n return (\n <Popover.Trigger>\n {React.cloneElement(child, {\n ...getTriggerProps(child.props, child.ref),\n ['aria-haspopup']: 'menu',\n })}\n </Popover.Trigger>\n );\n};\n","import React from 'react';\nimport {\n CommonProps,\n PropsWithHTMLElement,\n ExpandProps,\n} from '@contentful/f36-core';\nimport { cx } from 'emotion';\nimport { getMenuDividerStyles } from './MenuDivider.styles';\n\nexport type MenuDividerProps = PropsWithHTMLElement<CommonProps, 'hr'>;\n\nexport const MenuDivider = (props: ExpandProps<MenuDividerProps>) => {\n const {\n children,\n testId = 'cf-ui-menu-divider',\n className,\n ...otherProps\n } = props;\n\n const styles = getMenuDividerStyles();\n\n return (\n <hr\n aria-orientation=\"horizontal\"\n data-test-id={testId}\n className={cx(styles, className)}\n {...otherProps}\n />\n );\n};\n","import { css } from 'emotion';\nimport tokens from '@contentful/f36-tokens';\n\nexport const getMenuDividerStyles = () =>\n css({\n border: 'none',\n width: '100%',\n height: '1px',\n background: tokens.gray300,\n margin: `${tokens.spacingXs} 0`,\n });\n","import React from 'react';\nimport { cx } from 'emotion';\nimport { getMenuSectionTitleStyles } from './MenuSectionTitle.styles';\nimport {\n SectionHeading,\n SectionHeadingProps,\n} from '@contentful/f36-typography';\nimport { ExpandProps } from '@contentful/f36-core';\n\nexport type MenuSectionTitleProps = SectionHeadingProps;\n\nexport const MenuSectionTitle = (props: ExpandProps<MenuSectionTitleProps>) => {\n const {\n children,\n testId = 'cf-ui-menu-section-title',\n className,\n ...otherProps\n } = props;\n\n const styles = getMenuSectionTitleStyles();\n\n return (\n <SectionHeading\n // Techincally, menus cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, and only use it\n // as a label\n aria-hidden=\"true\"\n testId={testId}\n className={cx(styles, className)}\n marginBottom=\"none\"\n {...otherProps}\n >\n {children}\n </SectionHeading>\n );\n};\n","import { css } from 'emotion';\nimport tokens from '@contentful/f36-tokens';\n\nexport const getMenuSectionTitleStyles = () =>\n css({\n textAlign: 'left',\n padding: `${tokens.spacingXs} ${tokens.spacingM}`,\n lineHeight: tokens.lineHeightM,\n\n 'hr + &': {\n marginTop: '-8px',\n },\n });\n","import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Menu, MenuProps } from '../Menu';\nimport { useMenuContext } from '../MenuContext';\nimport { SubmenuContextProvider, SubmenuContextType } from '../SubmenuContext';\nimport { mergeRefs } from '@contentful/f36-core';\n\nconst SUBMENU_OFFSET: [number, number] = [-8, 2];\n\nexport type SubmenuProps = Omit<\n MenuProps,\n | 'placement'\n | 'offset'\n | 'usePortal'\n | 'isOpen'\n | 'isAutoalignmentEnabled'\n | 'defaultIsOpen'\n>;\n\nexport const Submenu = (props: SubmenuProps) => {\n const { onClose, onOpen, ...otherProps } = props;\n\n const {\n isOpen: isParentMenuOpen,\n menuId,\n propsToPropagateToSubmenus,\n } = useMenuContext();\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n const mouseLeaveTimerRef = useRef(null);\n\n const [isOpen, setIsOpen] = useState(false);\n const handleOpen = useCallback(() => {\n setIsOpen(true);\n window.clearTimeout(mouseLeaveTimerRef.current);\n\n onOpen?.();\n }, [onOpen]);\n const handleClose = useCallback(() => {\n setIsOpen(false);\n window.clearTimeout(mouseLeaveTimerRef.current);\n\n onClose?.();\n }, [onClose]);\n const closeAndFocusTrigger = useCallback(() => {\n handleClose();\n triggerRef.current?.focus({ preventScroll: true });\n }, [handleClose]);\n\n useEffect(() => {\n // close when parent menu closed\n if (isParentMenuOpen === false) {\n setIsOpen(false);\n }\n }, [isParentMenuOpen]);\n\n const contextValue: SubmenuContextType = useMemo(\n () => ({\n isOpen,\n getSubmenuListProps: (_props) => ({\n 'data-parent-menu': menuId,\n onMouseOver: (event) => {\n handleOpen();\n\n _props.onMouseOver?.(event);\n },\n onMouseLeave: (event) => {\n closeAndFocusTrigger();\n\n _props.onMouseLeave?.(event);\n },\n }),\n getSubmenuTriggerProps: (_props, _ref) => ({\n ref: mergeRefs(triggerRef, _ref),\n onKeyDown: (event) => {\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n handleOpen();\n }\n\n _props.onKeyDown?.(event);\n },\n onMouseOver: (event) => {\n handleOpen();\n\n _props.onMouseOver?.(event);\n },\n onMouseLeave: (event) => {\n mouseLeaveTimerRef.current = window.setTimeout(\n closeAndFocusTrigger,\n 300,\n );\n\n _props.onMouseLeave?.(event);\n },\n }),\n }),\n [isOpen, menuId, handleOpen, closeAndFocusTrigger],\n );\n\n return (\n <SubmenuContextProvider value={contextValue}>\n <Menu\n {...propsToPropagateToSubmenus}\n {...otherProps}\n isOpen={isOpen}\n onClose={handleClose}\n onOpen={handleOpen}\n placement=\"right-start\"\n offset={SUBMENU_OFFSET}\n isAutoalignmentEnabled={false}\n />\n </SubmenuContextProvider>\n );\n};\n","import React from 'react';\nimport { MenuTrigger } from '../MenuTrigger/MenuTrigger';\nimport { MenuItem, MenuItemProps } from '../MenuItem/MenuItem';\nimport { useSubmenuContext } from '../SubmenuContext';\nimport { ChevronRightIcon } from '@contentful/f36-icons';\nimport { ExpandProps } from '@contentful/f36-core';\nimport { cx } from 'emotion';\nimport { getSubmenuTriggerStyles } from './SubmenuTrigger.styles';\n\nexport type SubmenuTriggerProps = Omit<\n MenuItemProps<'button'>,\n 'isInitiallyFocused' | 'as'\n>;\n\nconst _SubmenuTrigger = (\n props: ExpandProps<SubmenuTriggerProps>,\n ref: React.Ref<HTMLButtonElement>,\n) => {\n const { className, children } = props;\n const { getSubmenuTriggerProps, isOpen } = useSubmenuContext();\n\n const styles = getSubmenuTriggerStyles();\n\n return (\n <MenuTrigger>\n <MenuItem\n {...props}\n {...getSubmenuTriggerProps(props, ref)}\n className={cx(styles.root({ isActive: isOpen }), className)}\n >\n <span className={styles.content}>{children}</span>\n <ChevronRightIcon className={styles.icon} />\n </MenuItem>\n </MenuTrigger>\n );\n};\n\nexport const SubmenuTrigger = React.forwardRef(_SubmenuTrigger);\n","import { css } from 'emotion';\nimport tokens from '@contentful/f36-tokens';\n\nexport const getSubmenuTriggerStyles = () => {\n return {\n root: ({ isActive }) =>\n css({\n display: 'flex',\n alignItems: 'center',\n paddingRight: tokens.spacingXs,\n ...(isActive\n ? {\n backgroundColor: tokens.gray100,\n }\n : {}),\n }),\n content: css({\n marginRight: tokens.spacingM,\n }),\n icon: css({\n marginLeft: 'auto',\n fill: 'currentColor',\n }),\n };\n};\n"],"names":["Menu","MenuProps","MenuList","MenuListProps","MenuItem","MenuItemProps","MenuTrigger","MenuTriggerProps","MenuDivider","MenuDividerProps","MenuSectionTitle","MenuSectionTitleProps","Submenu","SubmenuProps","SubmenuTrigger","SubmenuTriggerProps","OriginalMenu","MenuListHeader","MenuListFooter","CompoundMenu","List","ListHeader","ListFooter","Item","Trigger","Divider","SectionTitle","React","useState","useCallback","useMemo","useRef","useEffect","mergeRefs","useId","useArrowKeyNavigation","Popover","PopoverProps","MenuContextProvider","MenuContextType","MENU_ITEMS_SELECTOR","Omit","isOpen","defaultIsOpen","onOpen","onClose","closeOnSelect","closeOnBlur","closeOnEsc","props","children","otherProps","handleOpen","handleClose","isControlled","useMenuOpenState","triggerRef","HTMLButtonElement","menuListRef","HTMLDivElement","menuId","focusedIndex","handleArrowsKeyDown","setFocusedIndex","itemsContainerRef","itemsSelector","current","menuItems","querySelectorAll","length","setTimeout","HTMLElement","focus","preventScroll","focusMenuItem","item","itemIndex","findIndex","menuItem","closeAndFocusTrigger","handleMenuListKeyDown","event","KeyboardEvent","key","preventDefault","stopPropagation","contextValue","getTriggerProps","_props","_ref","onClick","isFullyControlled","ref","getMenuListProps","onKeyDown","onBlur","relatedTarget","Node","targetIsMenu","contains","targetIsTrigger","targetIsSubmenu","parentElement","dataset","parentMenu","getMenuItemProps","isSubmenuTrigger","Boolean","target","getAttribute","propsToPropagateToSubmenus","UseMenuOpenStateProps","Pick","isOpenState","setIsOpen","undefined","isOpenValue","UseArrowKeyNavigationProps","MutableRefObject","keyType","initialFocusedIndex","ARROW_KEY_TYPES","vertical","prev","next","horizontal","container","items","lastItemIndex","focusFirstItem","focusLastItem","focusNextItem","focusPrevItem","keyToFnMap","fn","ComponentPropsWithRef","Ref","MenuContext","createContext","useMenuContext","context","useContext","Error","Provider","CommonProps","PropsWithHTMLElement","ExpandProps","useSubmenuContext","getMenuListStyles","MenuListInternalProps","ReactNode","assertChild","child","type","displayName","_MenuList","testId","className","submenuContext","header","ReactElement","footer","Children","forEach","appendChild","push","styles","hasStickyHeader","hasStickyFooter","extendedOtherProps","getSubmenuListProps","forwardRef","ComponentPropsWithoutRef","SubmenuContextType","getSubmenuTriggerProps","SubmenuContext","SubmenuContextProvider","tokens","getMenuHeaderStyles","position","top","left","backgroundColor","colorWhite","borderBottom","gray300","padding","spacingXs","zIndex","getMenuFooterStyles","bottom","borderTop","overflowY","paddingTop","paddingBottom","MenuListHeaderProps","FC","MenuListFooterProps","PolymorphicComponent","PolymorphicProps","getMenuItemStyles","MENU_ITEM_DEFAULT_TAG","MenuItemInternalProps","as","isInitiallyFocused","ElementType","E","_MenuItem","id","itemTestId","itemRef","Element","root","display","width","background","border","margin","outline","fontSize","fontSizeM","lineHeight","lineHeightM","fontWeight","fontWeightNormal","textAlign","spacingM","wordBreak","whiteSpace","cursor","hyphens","minWidth","textDecoration","color","gray800","gray100","gray200","opacity","only","cloneElement","getMenuDividerStyles","height","getMenuSectionTitleStyles","SectionHeading","SectionHeadingProps","marginTop","SUBMENU_OFFSET","isParentMenuOpen","mouseLeaveTimerRef","window","clearTimeout","onMouseOver","onMouseLeave","ChevronRightIcon","getSubmenuTriggerStyles","_SubmenuTrigger","isActive","content","icon","alignItems","paddingRight","marginRight"],"version":3,"file":"main.js.map"}