@contentful/f36-menu 4.6.2 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/main.js +28 -32
- package/dist/main.js.map +1 -1
- package/dist/module.js +28 -32
- package/dist/module.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.8.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @contentful/f36-icons@4.8.0
|
|
9
|
+
- @contentful/f36-popover@4.8.0
|
|
10
|
+
- @contentful/f36-typography@4.8.0
|
|
11
|
+
- @contentful/f36-utils@4.8.0
|
|
12
|
+
- @contentful/f36-core@4.8.0
|
|
13
|
+
|
|
14
|
+
## 4.7.0
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [[`e50b8945`](https://github.com/contentful/forma-36/commit/e50b8945faef7323187e1bd9a2a9cbfcbae2e405)]:
|
|
19
|
+
- @contentful/f36-core@4.7.0
|
|
20
|
+
- @contentful/f36-icons@4.7.0
|
|
21
|
+
- @contentful/f36-popover@4.7.0
|
|
22
|
+
- @contentful/f36-typography@4.7.0
|
|
23
|
+
- @contentful/f36-utils@4.7.0
|
|
24
|
+
|
|
3
25
|
## 4.6.2
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/main.js
CHANGED
|
@@ -160,8 +160,7 @@ function $453ff7c40e833219$export$d9b273488cd8ce6f(props) {
|
|
|
160
160
|
isOpen: isOpen,
|
|
161
161
|
menuId: menuId,
|
|
162
162
|
focusMenuItem: focusMenuItem,
|
|
163
|
-
getTriggerProps: (_props = {
|
|
164
|
-
}, _ref = null)=>{
|
|
163
|
+
getTriggerProps: (_props = {}, _ref = null)=>{
|
|
165
164
|
return {
|
|
166
165
|
onClick: (event)=>{
|
|
167
166
|
var ref;
|
|
@@ -178,8 +177,7 @@ function $453ff7c40e833219$export$d9b273488cd8ce6f(props) {
|
|
|
178
177
|
ref: $6ZrLO$contentfulf36core.mergeRefs(triggerRef, _ref)
|
|
179
178
|
};
|
|
180
179
|
},
|
|
181
|
-
getMenuListProps: (_props = {
|
|
182
|
-
}, _ref = null)=>{
|
|
180
|
+
getMenuListProps: (_props = {}, _ref = null)=>{
|
|
183
181
|
return {
|
|
184
182
|
ref: $6ZrLO$contentfulf36core.mergeRefs(menuListRef, _ref),
|
|
185
183
|
onKeyDown: (event)=>{
|
|
@@ -203,8 +201,7 @@ function $453ff7c40e833219$export$d9b273488cd8ce6f(props) {
|
|
|
203
201
|
}
|
|
204
202
|
};
|
|
205
203
|
},
|
|
206
|
-
getMenuItemProps: (_props = {
|
|
207
|
-
})=>{
|
|
204
|
+
getMenuItemProps: (_props = {})=>{
|
|
208
205
|
return {
|
|
209
206
|
onClick: (event)=>{
|
|
210
207
|
var ref;
|
|
@@ -234,7 +231,7 @@ function $453ff7c40e833219$export$d9b273488cd8ce6f(props) {
|
|
|
234
231
|
isControlled,
|
|
235
232
|
onOpen
|
|
236
233
|
]);
|
|
237
|
-
return
|
|
234
|
+
return /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($31bc1b2a74a830dc$export$2cad3fd48ac06579, {
|
|
238
235
|
value: contextValue
|
|
239
236
|
}, /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($6ZrLO$contentfulf36popover.Popover, {
|
|
240
237
|
...otherProps,
|
|
@@ -244,7 +241,7 @@ function $453ff7c40e833219$export$d9b273488cd8ce6f(props) {
|
|
|
244
241
|
closeOnEsc: closeOnEsc,
|
|
245
242
|
autoFocus: false,
|
|
246
243
|
closeOnBlur: false
|
|
247
|
-
}, children))
|
|
244
|
+
}, children));
|
|
248
245
|
}
|
|
249
246
|
|
|
250
247
|
|
|
@@ -264,7 +261,7 @@ const $62b35dc82bb7def8$export$81b3dbd1f003f0c7 = $62b35dc82bb7def8$var$SubmenuC
|
|
|
264
261
|
|
|
265
262
|
|
|
266
263
|
const $ce9788dc1cd48a1b$export$396ce14bde1b7929 = ()=>{
|
|
267
|
-
return
|
|
264
|
+
return /*#__PURE__*/ $6ZrLO$emotion.css({
|
|
268
265
|
position: 'sticky',
|
|
269
266
|
top: 0,
|
|
270
267
|
left: 0,
|
|
@@ -272,10 +269,10 @@ const $ce9788dc1cd48a1b$export$396ce14bde1b7929 = ()=>{
|
|
|
272
269
|
borderBottom: `1px solid ${($parcel$interopDefault($6ZrLO$contentfulf36tokens)).gray300}`,
|
|
273
270
|
padding: `${($parcel$interopDefault($6ZrLO$contentfulf36tokens)).spacingXs} 0`,
|
|
274
271
|
zIndex: 1001
|
|
275
|
-
})
|
|
272
|
+
});
|
|
276
273
|
};
|
|
277
274
|
const $ce9788dc1cd48a1b$export$fd3dbc8a890448f = ()=>{
|
|
278
|
-
return
|
|
275
|
+
return /*#__PURE__*/ $6ZrLO$emotion.css({
|
|
279
276
|
position: 'sticky',
|
|
280
277
|
bottom: 0,
|
|
281
278
|
left: 0,
|
|
@@ -283,7 +280,7 @@ const $ce9788dc1cd48a1b$export$fd3dbc8a890448f = ()=>{
|
|
|
283
280
|
borderTop: `1px solid ${($parcel$interopDefault($6ZrLO$contentfulf36tokens)).gray300}`,
|
|
284
281
|
padding: `${($parcel$interopDefault($6ZrLO$contentfulf36tokens)).spacingXs} 0`,
|
|
285
282
|
zIndex: 1001
|
|
286
|
-
})
|
|
283
|
+
});
|
|
287
284
|
};
|
|
288
285
|
const $ce9788dc1cd48a1b$export$10ce7613b0465b57 = (props)=>({
|
|
289
286
|
container: /*#__PURE__*/ $6ZrLO$emotion.css({
|
|
@@ -303,11 +300,11 @@ const $ce9788dc1cd48a1b$export$10ce7613b0465b57 = (props)=>({
|
|
|
303
300
|
const $77fa76994469c42b$export$77451990ddb9d17c = (props)=>{
|
|
304
301
|
const { children: children , testId: testId = 'cf-ui-menu-list-header' , className: className , ...otherProps } = props;
|
|
305
302
|
const styles = $ce9788dc1cd48a1b$export$396ce14bde1b7929();
|
|
306
|
-
return
|
|
303
|
+
return /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement("div", {
|
|
307
304
|
"data-test-id": testId,
|
|
308
305
|
className: $6ZrLO$emotion.cx(styles, className),
|
|
309
306
|
...otherProps
|
|
310
|
-
}, children)
|
|
307
|
+
}, children);
|
|
311
308
|
};
|
|
312
309
|
$77fa76994469c42b$export$77451990ddb9d17c.displayName = 'MenuListHeader';
|
|
313
310
|
|
|
@@ -318,11 +315,11 @@ $77fa76994469c42b$export$77451990ddb9d17c.displayName = 'MenuListHeader';
|
|
|
318
315
|
const $56409107038e75ac$export$3e8a81e7ad0650f4 = (props)=>{
|
|
319
316
|
const { children: children , testId: testId = 'cf-ui-menu-list-footer' , className: className , ...otherProps } = props;
|
|
320
317
|
const styles = $ce9788dc1cd48a1b$export$fd3dbc8a890448f();
|
|
321
|
-
return
|
|
318
|
+
return /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement("div", {
|
|
322
319
|
"data-test-id": testId,
|
|
323
320
|
className: $6ZrLO$emotion.cx(styles, className),
|
|
324
321
|
...otherProps
|
|
325
|
-
}, children)
|
|
322
|
+
}, children);
|
|
326
323
|
};
|
|
327
324
|
$56409107038e75ac$export$3e8a81e7ad0650f4.displayName = 'MenuListFooter';
|
|
328
325
|
|
|
@@ -356,13 +353,13 @@ const $c5bfee6901fd5b47$var$_MenuList = (props, ref)=>{
|
|
|
356
353
|
hasStickyFooter: Boolean(footer)
|
|
357
354
|
});
|
|
358
355
|
const extendedOtherProps = submenuContext ? submenuContext.getSubmenuListProps(otherProps) : otherProps;
|
|
359
|
-
return
|
|
356
|
+
return /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($6ZrLO$contentfulf36popover.Popover.Content, {
|
|
360
357
|
role: "menu",
|
|
361
358
|
...extendedOtherProps,
|
|
362
359
|
...getMenuListProps(extendedOtherProps, ref),
|
|
363
360
|
className: $6ZrLO$emotion.cx(styles.container, className),
|
|
364
361
|
testId: testId
|
|
365
|
-
}, header, items, footer)
|
|
362
|
+
}, header, items, footer);
|
|
366
363
|
};
|
|
367
364
|
const $c5bfee6901fd5b47$export$d4c4e98c5044dc8 = /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).forwardRef($c5bfee6901fd5b47$var$_MenuList);
|
|
368
365
|
|
|
@@ -441,7 +438,7 @@ function $01d29448a29c05b3$var$_MenuItem(props, ref) {
|
|
|
441
438
|
focusMenuItem
|
|
442
439
|
]);
|
|
443
440
|
const Element = as !== null && as !== void 0 ? as : $01d29448a29c05b3$var$MENU_ITEM_DEFAULT_TAG;
|
|
444
|
-
return
|
|
441
|
+
return /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement(Element, {
|
|
445
442
|
role: "menuitem",
|
|
446
443
|
...otherProps,
|
|
447
444
|
...getMenuItemProps(otherProps),
|
|
@@ -449,7 +446,7 @@ function $01d29448a29c05b3$var$_MenuItem(props, ref) {
|
|
|
449
446
|
"data-test-id": itemTestId,
|
|
450
447
|
ref: $6ZrLO$contentfulf36core.mergeRefs(itemRef, ref),
|
|
451
448
|
tabIndex: -1
|
|
452
|
-
}, props.children)
|
|
449
|
+
}, props.children);
|
|
453
450
|
}
|
|
454
451
|
$01d29448a29c05b3$var$_MenuItem.displayName = 'MenuItem';
|
|
455
452
|
const $01d29448a29c05b3$export$2ce376c2cc3355c8 = /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).forwardRef($01d29448a29c05b3$var$_MenuItem);
|
|
@@ -461,10 +458,10 @@ const $01d29448a29c05b3$export$2ce376c2cc3355c8 = /*#__PURE__*/ ($parcel$interop
|
|
|
461
458
|
const $57a0b88402c05a1e$export$27d2ad3c5815583e = (props)=>{
|
|
462
459
|
const child = ($parcel$interopDefault($6ZrLO$react)).Children.only(props.children);
|
|
463
460
|
const { getTriggerProps: getTriggerProps } = $31bc1b2a74a830dc$export$21c7ab35b39f78ec();
|
|
464
|
-
return
|
|
461
|
+
return /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($6ZrLO$contentfulf36popover.Popover.Trigger, null, /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).cloneElement(child, {
|
|
465
462
|
...getTriggerProps(child.props, child.ref),
|
|
466
463
|
['aria-haspopup']: 'menu'
|
|
467
|
-
}))
|
|
464
|
+
}));
|
|
468
465
|
};
|
|
469
466
|
|
|
470
467
|
|
|
@@ -485,12 +482,12 @@ const $f85a558bae23a8bd$export$4605da6f9a8ef405 = ()=>/*#__PURE__*/ $6ZrLO$emoti
|
|
|
485
482
|
const $a8d7f8a94ad9b120$export$acb07b4664ac227c = (props)=>{
|
|
486
483
|
const { children: children , testId: testId = 'cf-ui-menu-divider' , className: className , ...otherProps } = props;
|
|
487
484
|
const styles = $f85a558bae23a8bd$export$4605da6f9a8ef405();
|
|
488
|
-
return
|
|
485
|
+
return /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement("hr", {
|
|
489
486
|
"aria-orientation": "horizontal",
|
|
490
487
|
"data-test-id": testId,
|
|
491
488
|
className: $6ZrLO$emotion.cx(styles, className),
|
|
492
489
|
...otherProps
|
|
493
|
-
})
|
|
490
|
+
});
|
|
494
491
|
};
|
|
495
492
|
|
|
496
493
|
|
|
@@ -513,7 +510,7 @@ const $80d81cb0da14b65a$export$2698fa8b3a0a79e6 = ()=>/*#__PURE__*/ $6ZrLO$emoti
|
|
|
513
510
|
const $a9e47e1a6fcc6dbc$export$5d1e6c648985631e = (props)=>{
|
|
514
511
|
const { children: children , testId: testId = 'cf-ui-menu-section-title' , className: className , ...otherProps } = props;
|
|
515
512
|
const styles = $80d81cb0da14b65a$export$2698fa8b3a0a79e6();
|
|
516
|
-
return
|
|
513
|
+
return /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($6ZrLO$contentfulf36typography.SectionHeading // Techincally, menus cannot contain headings according to ARIA.
|
|
517
514
|
, {
|
|
518
515
|
// We hide the heading from assistive technology, and only use it
|
|
519
516
|
// as a label
|
|
@@ -522,7 +519,7 @@ const $a9e47e1a6fcc6dbc$export$5d1e6c648985631e = (props)=>{
|
|
|
522
519
|
className: $6ZrLO$emotion.cx(styles, className),
|
|
523
520
|
marginBottom: "none",
|
|
524
521
|
...otherProps
|
|
525
|
-
}, children)
|
|
522
|
+
}, children);
|
|
526
523
|
};
|
|
527
524
|
|
|
528
525
|
|
|
@@ -618,7 +615,7 @@ const $d1c454a08dd2b04a$export$49229ebf838c159b = (props)=>{
|
|
|
618
615
|
handleOpen,
|
|
619
616
|
closeAndFocusTrigger
|
|
620
617
|
]);
|
|
621
|
-
return
|
|
618
|
+
return /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($62b35dc82bb7def8$export$81b3dbd1f003f0c7, {
|
|
622
619
|
value: contextValue
|
|
623
620
|
}, /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($453ff7c40e833219$export$d9b273488cd8ce6f, {
|
|
624
621
|
...propsToPropagateToSubmenus,
|
|
@@ -629,7 +626,7 @@ const $d1c454a08dd2b04a$export$49229ebf838c159b = (props)=>{
|
|
|
629
626
|
placement: "right-start",
|
|
630
627
|
offset: $d1c454a08dd2b04a$var$SUBMENU_OFFSET,
|
|
631
628
|
isAutoalignmentEnabled: false
|
|
632
|
-
}))
|
|
629
|
+
}));
|
|
633
630
|
};
|
|
634
631
|
|
|
635
632
|
|
|
@@ -649,8 +646,7 @@ const $440a5860c5fbe4e7$export$ce276565acbba1c9 = ()=>{
|
|
|
649
646
|
paddingRight: ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).spacingXs,
|
|
650
647
|
...isActive ? {
|
|
651
648
|
backgroundColor: ($parcel$interopDefault($6ZrLO$contentfulf36tokens)).gray100
|
|
652
|
-
} : {
|
|
653
|
-
}
|
|
649
|
+
} : {}
|
|
654
650
|
})
|
|
655
651
|
,
|
|
656
652
|
content: /*#__PURE__*/ $6ZrLO$emotion.css({
|
|
@@ -668,7 +664,7 @@ const $68e427819b978177$var$_SubmenuTrigger = (props, ref)=>{
|
|
|
668
664
|
const { className: className , children: children } = props;
|
|
669
665
|
const { getSubmenuTriggerProps: getSubmenuTriggerProps , isOpen: isOpen } = $62b35dc82bb7def8$export$958673a266cbe049();
|
|
670
666
|
const styles = $440a5860c5fbe4e7$export$ce276565acbba1c9();
|
|
671
|
-
return
|
|
667
|
+
return /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($57a0b88402c05a1e$export$27d2ad3c5815583e, null, /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($01d29448a29c05b3$export$2ce376c2cc3355c8, {
|
|
672
668
|
...props,
|
|
673
669
|
...getSubmenuTriggerProps(props, ref),
|
|
674
670
|
className: $6ZrLO$emotion.cx(styles.root({
|
|
@@ -678,7 +674,7 @@ const $68e427819b978177$var$_SubmenuTrigger = (props, ref)=>{
|
|
|
678
674
|
className: styles.content
|
|
679
675
|
}, children), /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).createElement($6ZrLO$contentfulf36icons.ChevronRightIcon, {
|
|
680
676
|
className: styles.icon
|
|
681
|
-
})))
|
|
677
|
+
})));
|
|
682
678
|
};
|
|
683
679
|
const $68e427819b978177$export$ecabc99eeffab7ca = /*#__PURE__*/ ($parcel$interopDefault($6ZrLO$react)).forwardRef($68e427819b978177$var$_SubmenuTrigger);
|
|
684
680
|
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AGSA,KAAA,CAAMmH,qCAAe,GAAG,CAAxB;IACEC,QAAQ,EAAE,CAAVA;QACEC,IAAI,EAAE,CADE;QAERC,IAAI,EAAE,CAANA;IAFQ,CADY;IAKtBC,UAAU,EAAE,CAAZA;QACEF,IAAI,EA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,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, { useCallback, useMemo, useRef, useEffect } from 'react';\nimport { mergeRefs, useId, useControllableState } from '@contentful/f36-core';\nimport { useArrowKeyNavigation } from './useArrowKeyNavigation';\nimport { Popover } from '@contentful/f36-popover';\nimport type { 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 * By default, the Menu is uncontrolled (manage it's expanded state by itself)\n * But you can make it controlled by providing boolean (true/false)\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 {\n isOpen,\n handleOpen,\n handleClose,\n isControlled,\n } = useControllableState({\n isOpen: props.isOpen,\n defaultIsOpen: props.defaultIsOpen,\n onOpen,\n onClose: props.onClose,\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","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 type {\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 { mergeRefs } from '@contentful/f36-core';\nimport type {\n CommonProps,\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\n_MenuItem.displayName = 'MenuItem';\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 '&:hover': {\n backgroundColor: tokens.gray100,\n },\n '&:focus': {\n boxShadow: `inset ${tokens.glowPrimary}`,\n // just to make boxShadow with rounded corners\n borderRadius: tokens.borderRadiusMedium,\n },\n '&:focus:not(:focus-visible)': {\n boxShadow: 'unset',\n borderRadius: 'unset',\n },\n '&:focus-visible': {\n boxShadow: `inset ${tokens.glowPrimary}`,\n borderRadius: tokens.borderRadiusMedium,\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 type { 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 type {\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 { SectionHeading } from '@contentful/f36-typography';\nimport type { SectionHeadingProps } from '@contentful/f36-typography';\nimport type { 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 type { 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","useCallback","useMemo","useRef","useEffect","mergeRefs","useId","useControllableState","useArrowKeyNavigation","Popover","PopoverProps","MenuContextProvider","MenuContextType","MENU_ITEMS_SELECTOR","Omit","isOpen","defaultIsOpen","onOpen","onClose","closeOnSelect","closeOnBlur","closeOnEsc","props","children","otherProps","handleOpen","handleClose","isControlled","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","useState","UseArrowKeyNavigationProps","MutableRefObject","keyType","initialFocusedIndex","ARROW_KEY_TYPES","vertical","prev","next","horizontal","container","items","lastItemIndex","focusFirstItem","focusLastItem","focusNextItem","focusPrevItem","keyToFnMap","fn","ComponentPropsWithRef","Ref","Pick","MenuContext","createContext","undefined","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","boxShadow","glowPrimary","borderRadius","borderRadiusMedium","gray200","opacity","only","cloneElement","getMenuDividerStyles","height","getMenuSectionTitleStyles","SectionHeading","SectionHeadingProps","marginTop","SUBMENU_OFFSET","isParentMenuOpen","mouseLeaveTimerRef","setIsOpen","window","clearTimeout","onMouseOver","onMouseLeave","ChevronRightIcon","getSubmenuTriggerStyles","_SubmenuTrigger","isActive","content","icon","alignItems","paddingRight","marginRight"],"version":3,"file":"main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AEAA;;ACAA;AASA,MAAMmH,qCAAe,GAAG;IACtBC,QAAQ,EAAE;QACRC,IAAI,EAAE,SADE;QAERC,IAAI,EAAE,WAANA;KAHoB;IAKtBC,UAAU,EAAE;QACVF,IAAI,EAAE,WADI;QAEVC,IAAI,EAAE,YAANA;KAFU;CALd,AAAwB;AAWjB,MAAMnF,wCAAqB,GAAG,CAAC,EApBtC,mBAqBE4B,iBADoC,CAAA,EApBtC,eAsBEC,aAFoC,CAAA,WAGpCiD,OAAO,GAAG,UAAVA,GAHmC,GAIH;IAChC,MAAM,CAACrD,YAAD,EAAeE,eAAf,CAAA,GAAkCgD,qBAAQ,CAAS,CAAT,CAAhD,AAAA;IAEA,MAAMjD,mBAAmB,GAAGjC,wBAAW,CACrC,CAACoD,KAAD,GAAgC;QAC9B,MAAMwC,SAAS,GAAGzD,iBAAiB,CAACE,OAApC,AAAA;QACA,IAAI,CAACuD,SAAL,EAAgB,OAAhB;QAEA,MAAMC,KAAK,GAAGD,SAAS,CAACrD,gBAAV,CAA2BH,aAA3B,CAAd,AAAA;QACA,IAAIyD,KAAK,CAACrD,MAAN,KAAiB,CAArB,EAAwB,OAAxB;QAEA,MAAMsD,aAAa,GAAGD,KAAK,CAACrD,MAAN,GAAe,CAArC,AAAA;QAEA,MAAMuD,cAAc,GAAG,IAAM7D,eAAe,CAAC,CAAD,CAA5C;QAAA;QACA,MAAM8D,aAAa,GAAG,IAAM9D,eAAe,CAAC4D,aAAD,CAA3C;QAAA;QACA,MAAMG,aAAa,GAAG,IAAM;YAC1B,IAAIjE,YAAY,KAAK8D,aAArB,EACEC,cAAc,EAAdA,CAAAA;iBAEA7D,eAAe,CAACF,YAAY,GAAG,CAAhB,CAAf,CA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AAZ;AACAA,yCAAI,CAACc,cAAL,GAAsBA,yCAAtB,CAAAd;;ADhCA","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, { useCallback, useMemo, useRef, useEffect } from 'react';\nimport { mergeRefs, useId, useControllableState } from '@contentful/f36-core';\nimport { useArrowKeyNavigation } from './useArrowKeyNavigation';\nimport { Popover } from '@contentful/f36-popover';\nimport type { 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 * By default, the Menu is uncontrolled (manage it's expanded state by itself)\n * But you can make it controlled by providing boolean (true/false)\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 {\n isOpen,\n handleOpen,\n handleClose,\n isControlled,\n } = useControllableState({\n isOpen: props.isOpen,\n defaultIsOpen: props.defaultIsOpen,\n onOpen,\n onClose: props.onClose,\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","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 type {\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 { mergeRefs } from '@contentful/f36-core';\nimport type {\n CommonProps,\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\n_MenuItem.displayName = 'MenuItem';\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 '&:hover': {\n backgroundColor: tokens.gray100,\n },\n '&:focus': {\n boxShadow: `inset ${tokens.glowPrimary}`,\n // just to make boxShadow with rounded corners\n borderRadius: tokens.borderRadiusMedium,\n },\n '&:focus:not(:focus-visible)': {\n boxShadow: 'unset',\n borderRadius: 'unset',\n },\n '&:focus-visible': {\n boxShadow: `inset ${tokens.glowPrimary}`,\n borderRadius: tokens.borderRadiusMedium,\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 type { 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 type {\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 { SectionHeading } from '@contentful/f36-typography';\nimport type { SectionHeadingProps } from '@contentful/f36-typography';\nimport type { 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 type { 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","useCallback","useMemo","useRef","useEffect","mergeRefs","useId","useControllableState","useArrowKeyNavigation","Popover","PopoverProps","MenuContextProvider","MenuContextType","MENU_ITEMS_SELECTOR","Omit","isOpen","defaultIsOpen","onOpen","onClose","closeOnSelect","closeOnBlur","closeOnEsc","props","children","otherProps","handleOpen","handleClose","isControlled","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","useState","UseArrowKeyNavigationProps","MutableRefObject","keyType","initialFocusedIndex","ARROW_KEY_TYPES","vertical","prev","next","horizontal","container","items","lastItemIndex","focusFirstItem","focusLastItem","focusNextItem","focusPrevItem","keyToFnMap","fn","ComponentPropsWithRef","Ref","Pick","MenuContext","createContext","undefined","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","boxShadow","glowPrimary","borderRadius","borderRadiusMedium","gray200","opacity","only","cloneElement","getMenuDividerStyles","height","getMenuSectionTitleStyles","SectionHeading","SectionHeadingProps","marginTop","SUBMENU_OFFSET","isParentMenuOpen","mouseLeaveTimerRef","setIsOpen","window","clearTimeout","onMouseOver","onMouseLeave","ChevronRightIcon","getSubmenuTriggerStyles","_SubmenuTrigger","isActive","content","icon","alignItems","paddingRight","marginRight"],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -145,8 +145,7 @@ function $815624c5c2e33d2d$export$d9b273488cd8ce6f(props) {
|
|
|
145
145
|
isOpen: isOpen,
|
|
146
146
|
menuId: menuId,
|
|
147
147
|
focusMenuItem: focusMenuItem,
|
|
148
|
-
getTriggerProps: (_props = {
|
|
149
|
-
}, _ref = null)=>{
|
|
148
|
+
getTriggerProps: (_props = {}, _ref = null)=>{
|
|
150
149
|
return {
|
|
151
150
|
onClick: (event)=>{
|
|
152
151
|
var ref;
|
|
@@ -163,8 +162,7 @@ function $815624c5c2e33d2d$export$d9b273488cd8ce6f(props) {
|
|
|
163
162
|
ref: $eBAEH$mergeRefs(triggerRef, _ref)
|
|
164
163
|
};
|
|
165
164
|
},
|
|
166
|
-
getMenuListProps: (_props = {
|
|
167
|
-
}, _ref = null)=>{
|
|
165
|
+
getMenuListProps: (_props = {}, _ref = null)=>{
|
|
168
166
|
return {
|
|
169
167
|
ref: $eBAEH$mergeRefs(menuListRef, _ref),
|
|
170
168
|
onKeyDown: (event)=>{
|
|
@@ -188,8 +186,7 @@ function $815624c5c2e33d2d$export$d9b273488cd8ce6f(props) {
|
|
|
188
186
|
}
|
|
189
187
|
};
|
|
190
188
|
},
|
|
191
|
-
getMenuItemProps: (_props = {
|
|
192
|
-
})=>{
|
|
189
|
+
getMenuItemProps: (_props = {})=>{
|
|
193
190
|
return {
|
|
194
191
|
onClick: (event)=>{
|
|
195
192
|
var ref;
|
|
@@ -219,7 +216,7 @@ function $815624c5c2e33d2d$export$d9b273488cd8ce6f(props) {
|
|
|
219
216
|
isControlled,
|
|
220
217
|
onOpen
|
|
221
218
|
]);
|
|
222
|
-
return
|
|
219
|
+
return /*#__PURE__*/ $eBAEH$react.createElement($c66e4ce1999d7489$export$2cad3fd48ac06579, {
|
|
223
220
|
value: contextValue
|
|
224
221
|
}, /*#__PURE__*/ $eBAEH$react.createElement($eBAEH$Popover, {
|
|
225
222
|
...otherProps,
|
|
@@ -229,7 +226,7 @@ function $815624c5c2e33d2d$export$d9b273488cd8ce6f(props) {
|
|
|
229
226
|
closeOnEsc: closeOnEsc,
|
|
230
227
|
autoFocus: false,
|
|
231
228
|
closeOnBlur: false
|
|
232
|
-
}, children))
|
|
229
|
+
}, children));
|
|
233
230
|
}
|
|
234
231
|
|
|
235
232
|
|
|
@@ -249,7 +246,7 @@ const $5f642d41e782730b$export$81b3dbd1f003f0c7 = $5f642d41e782730b$var$SubmenuC
|
|
|
249
246
|
|
|
250
247
|
|
|
251
248
|
const $e1ca220e91193b42$export$396ce14bde1b7929 = ()=>{
|
|
252
|
-
return
|
|
249
|
+
return /*#__PURE__*/ $eBAEH$css({
|
|
253
250
|
position: 'sticky',
|
|
254
251
|
top: 0,
|
|
255
252
|
left: 0,
|
|
@@ -257,10 +254,10 @@ const $e1ca220e91193b42$export$396ce14bde1b7929 = ()=>{
|
|
|
257
254
|
borderBottom: `1px solid ${$eBAEH$contentfulf36tokens.gray300}`,
|
|
258
255
|
padding: `${$eBAEH$contentfulf36tokens.spacingXs} 0`,
|
|
259
256
|
zIndex: 1001
|
|
260
|
-
})
|
|
257
|
+
});
|
|
261
258
|
};
|
|
262
259
|
const $e1ca220e91193b42$export$fd3dbc8a890448f = ()=>{
|
|
263
|
-
return
|
|
260
|
+
return /*#__PURE__*/ $eBAEH$css({
|
|
264
261
|
position: 'sticky',
|
|
265
262
|
bottom: 0,
|
|
266
263
|
left: 0,
|
|
@@ -268,7 +265,7 @@ const $e1ca220e91193b42$export$fd3dbc8a890448f = ()=>{
|
|
|
268
265
|
borderTop: `1px solid ${$eBAEH$contentfulf36tokens.gray300}`,
|
|
269
266
|
padding: `${$eBAEH$contentfulf36tokens.spacingXs} 0`,
|
|
270
267
|
zIndex: 1001
|
|
271
|
-
})
|
|
268
|
+
});
|
|
272
269
|
};
|
|
273
270
|
const $e1ca220e91193b42$export$10ce7613b0465b57 = (props)=>({
|
|
274
271
|
container: /*#__PURE__*/ $eBAEH$css({
|
|
@@ -288,11 +285,11 @@ const $e1ca220e91193b42$export$10ce7613b0465b57 = (props)=>({
|
|
|
288
285
|
const $042de7e263db0945$export$77451990ddb9d17c = (props)=>{
|
|
289
286
|
const { children: children , testId: testId = 'cf-ui-menu-list-header' , className: className , ...otherProps } = props;
|
|
290
287
|
const styles = $e1ca220e91193b42$export$396ce14bde1b7929();
|
|
291
|
-
return
|
|
288
|
+
return /*#__PURE__*/ $eBAEH$react.createElement("div", {
|
|
292
289
|
"data-test-id": testId,
|
|
293
290
|
className: $eBAEH$cx(styles, className),
|
|
294
291
|
...otherProps
|
|
295
|
-
}, children)
|
|
292
|
+
}, children);
|
|
296
293
|
};
|
|
297
294
|
$042de7e263db0945$export$77451990ddb9d17c.displayName = 'MenuListHeader';
|
|
298
295
|
|
|
@@ -303,11 +300,11 @@ $042de7e263db0945$export$77451990ddb9d17c.displayName = 'MenuListHeader';
|
|
|
303
300
|
const $5a5dcb1ec14dca9d$export$3e8a81e7ad0650f4 = (props)=>{
|
|
304
301
|
const { children: children , testId: testId = 'cf-ui-menu-list-footer' , className: className , ...otherProps } = props;
|
|
305
302
|
const styles = $e1ca220e91193b42$export$fd3dbc8a890448f();
|
|
306
|
-
return
|
|
303
|
+
return /*#__PURE__*/ $eBAEH$react.createElement("div", {
|
|
307
304
|
"data-test-id": testId,
|
|
308
305
|
className: $eBAEH$cx(styles, className),
|
|
309
306
|
...otherProps
|
|
310
|
-
}, children)
|
|
307
|
+
}, children);
|
|
311
308
|
};
|
|
312
309
|
$5a5dcb1ec14dca9d$export$3e8a81e7ad0650f4.displayName = 'MenuListFooter';
|
|
313
310
|
|
|
@@ -341,13 +338,13 @@ const $511d273ec51beeae$var$_MenuList = (props, ref)=>{
|
|
|
341
338
|
hasStickyFooter: Boolean(footer)
|
|
342
339
|
});
|
|
343
340
|
const extendedOtherProps = submenuContext ? submenuContext.getSubmenuListProps(otherProps) : otherProps;
|
|
344
|
-
return
|
|
341
|
+
return /*#__PURE__*/ $eBAEH$react.createElement($eBAEH$Popover.Content, {
|
|
345
342
|
role: "menu",
|
|
346
343
|
...extendedOtherProps,
|
|
347
344
|
...getMenuListProps(extendedOtherProps, ref),
|
|
348
345
|
className: $eBAEH$cx(styles.container, className),
|
|
349
346
|
testId: testId
|
|
350
|
-
}, header, items, footer)
|
|
347
|
+
}, header, items, footer);
|
|
351
348
|
};
|
|
352
349
|
const $511d273ec51beeae$export$d4c4e98c5044dc8 = /*#__PURE__*/ $eBAEH$react.forwardRef($511d273ec51beeae$var$_MenuList);
|
|
353
350
|
|
|
@@ -426,7 +423,7 @@ function $ea346231d142cd67$var$_MenuItem(props, ref) {
|
|
|
426
423
|
focusMenuItem
|
|
427
424
|
]);
|
|
428
425
|
const Element = as !== null && as !== void 0 ? as : $ea346231d142cd67$var$MENU_ITEM_DEFAULT_TAG;
|
|
429
|
-
return
|
|
426
|
+
return /*#__PURE__*/ $eBAEH$react.createElement(Element, {
|
|
430
427
|
role: "menuitem",
|
|
431
428
|
...otherProps,
|
|
432
429
|
...getMenuItemProps(otherProps),
|
|
@@ -434,7 +431,7 @@ function $ea346231d142cd67$var$_MenuItem(props, ref) {
|
|
|
434
431
|
"data-test-id": itemTestId,
|
|
435
432
|
ref: $eBAEH$mergeRefs(itemRef, ref),
|
|
436
433
|
tabIndex: -1
|
|
437
|
-
}, props.children)
|
|
434
|
+
}, props.children);
|
|
438
435
|
}
|
|
439
436
|
$ea346231d142cd67$var$_MenuItem.displayName = 'MenuItem';
|
|
440
437
|
const $ea346231d142cd67$export$2ce376c2cc3355c8 = /*#__PURE__*/ $eBAEH$react.forwardRef($ea346231d142cd67$var$_MenuItem);
|
|
@@ -446,10 +443,10 @@ const $ea346231d142cd67$export$2ce376c2cc3355c8 = /*#__PURE__*/ $eBAEH$react.for
|
|
|
446
443
|
const $94016b6f927b504d$export$27d2ad3c5815583e = (props)=>{
|
|
447
444
|
const child = $eBAEH$react.Children.only(props.children);
|
|
448
445
|
const { getTriggerProps: getTriggerProps } = $c66e4ce1999d7489$export$21c7ab35b39f78ec();
|
|
449
|
-
return
|
|
446
|
+
return /*#__PURE__*/ $eBAEH$react.createElement($eBAEH$Popover.Trigger, null, /*#__PURE__*/ $eBAEH$react.cloneElement(child, {
|
|
450
447
|
...getTriggerProps(child.props, child.ref),
|
|
451
448
|
['aria-haspopup']: 'menu'
|
|
452
|
-
}))
|
|
449
|
+
}));
|
|
453
450
|
};
|
|
454
451
|
|
|
455
452
|
|
|
@@ -470,12 +467,12 @@ const $90fd1006b83bc4dd$export$4605da6f9a8ef405 = ()=>/*#__PURE__*/ $eBAEH$css({
|
|
|
470
467
|
const $a6a319b65dbbd900$export$acb07b4664ac227c = (props)=>{
|
|
471
468
|
const { children: children , testId: testId = 'cf-ui-menu-divider' , className: className , ...otherProps } = props;
|
|
472
469
|
const styles = $90fd1006b83bc4dd$export$4605da6f9a8ef405();
|
|
473
|
-
return
|
|
470
|
+
return /*#__PURE__*/ $eBAEH$react.createElement("hr", {
|
|
474
471
|
"aria-orientation": "horizontal",
|
|
475
472
|
"data-test-id": testId,
|
|
476
473
|
className: $eBAEH$cx(styles, className),
|
|
477
474
|
...otherProps
|
|
478
|
-
})
|
|
475
|
+
});
|
|
479
476
|
};
|
|
480
477
|
|
|
481
478
|
|
|
@@ -498,7 +495,7 @@ const $7f43fb9a4d140447$export$2698fa8b3a0a79e6 = ()=>/*#__PURE__*/ $eBAEH$css({
|
|
|
498
495
|
const $7c6385c774644580$export$5d1e6c648985631e = (props)=>{
|
|
499
496
|
const { children: children , testId: testId = 'cf-ui-menu-section-title' , className: className , ...otherProps } = props;
|
|
500
497
|
const styles = $7f43fb9a4d140447$export$2698fa8b3a0a79e6();
|
|
501
|
-
return
|
|
498
|
+
return /*#__PURE__*/ $eBAEH$react.createElement($eBAEH$SectionHeading // Techincally, menus cannot contain headings according to ARIA.
|
|
502
499
|
, {
|
|
503
500
|
// We hide the heading from assistive technology, and only use it
|
|
504
501
|
// as a label
|
|
@@ -507,7 +504,7 @@ const $7c6385c774644580$export$5d1e6c648985631e = (props)=>{
|
|
|
507
504
|
className: $eBAEH$cx(styles, className),
|
|
508
505
|
marginBottom: "none",
|
|
509
506
|
...otherProps
|
|
510
|
-
}, children)
|
|
507
|
+
}, children);
|
|
511
508
|
};
|
|
512
509
|
|
|
513
510
|
|
|
@@ -603,7 +600,7 @@ const $407bba9f98210b35$export$49229ebf838c159b = (props)=>{
|
|
|
603
600
|
handleOpen,
|
|
604
601
|
closeAndFocusTrigger
|
|
605
602
|
]);
|
|
606
|
-
return
|
|
603
|
+
return /*#__PURE__*/ $eBAEH$react.createElement($5f642d41e782730b$export$81b3dbd1f003f0c7, {
|
|
607
604
|
value: contextValue
|
|
608
605
|
}, /*#__PURE__*/ $eBAEH$react.createElement($815624c5c2e33d2d$export$d9b273488cd8ce6f, {
|
|
609
606
|
...propsToPropagateToSubmenus,
|
|
@@ -614,7 +611,7 @@ const $407bba9f98210b35$export$49229ebf838c159b = (props)=>{
|
|
|
614
611
|
placement: "right-start",
|
|
615
612
|
offset: $407bba9f98210b35$var$SUBMENU_OFFSET,
|
|
616
613
|
isAutoalignmentEnabled: false
|
|
617
|
-
}))
|
|
614
|
+
}));
|
|
618
615
|
};
|
|
619
616
|
|
|
620
617
|
|
|
@@ -634,8 +631,7 @@ const $f5b15ecf1bfa860d$export$ce276565acbba1c9 = ()=>{
|
|
|
634
631
|
paddingRight: $eBAEH$contentfulf36tokens.spacingXs,
|
|
635
632
|
...isActive ? {
|
|
636
633
|
backgroundColor: $eBAEH$contentfulf36tokens.gray100
|
|
637
|
-
} : {
|
|
638
|
-
}
|
|
634
|
+
} : {}
|
|
639
635
|
})
|
|
640
636
|
,
|
|
641
637
|
content: /*#__PURE__*/ $eBAEH$css({
|
|
@@ -653,7 +649,7 @@ const $423d6b42721d64f8$var$_SubmenuTrigger = (props, ref)=>{
|
|
|
653
649
|
const { className: className , children: children } = props;
|
|
654
650
|
const { getSubmenuTriggerProps: getSubmenuTriggerProps , isOpen: isOpen } = $5f642d41e782730b$export$958673a266cbe049();
|
|
655
651
|
const styles = $f5b15ecf1bfa860d$export$ce276565acbba1c9();
|
|
656
|
-
return
|
|
652
|
+
return /*#__PURE__*/ $eBAEH$react.createElement($94016b6f927b504d$export$27d2ad3c5815583e, null, /*#__PURE__*/ $eBAEH$react.createElement($ea346231d142cd67$export$2ce376c2cc3355c8, {
|
|
657
653
|
...props,
|
|
658
654
|
...getSubmenuTriggerProps(props, ref),
|
|
659
655
|
className: $eBAEH$cx(styles.root({
|
|
@@ -663,7 +659,7 @@ const $423d6b42721d64f8$var$_SubmenuTrigger = (props, ref)=>{
|
|
|
663
659
|
className: styles.content
|
|
664
660
|
}, children), /*#__PURE__*/ $eBAEH$react.createElement($eBAEH$ChevronRightIcon, {
|
|
665
661
|
className: styles.icon
|
|
666
|
-
})))
|
|
662
|
+
})));
|
|
667
663
|
};
|
|
668
664
|
const $423d6b42721d64f8$export$ecabc99eeffab7ca = /*#__PURE__*/ $eBAEH$react.forwardRef($423d6b42721d64f8$var$_SubmenuTrigger);
|
|
669
665
|
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;AGSA,KAAA,CAAMmH,qCAAe,GAAG,CAAxB;IACEC,QAAQ,EAAE,CAAVA;QACEC,IAAI,EAAE,CADE;QAERC,IAAI,EAAE,CAANA;IAFQ,CADY;IAKtBC,UAAU,EAAE,CAAZA;QACEF,IAAI,EAAE,CADI;QAEVC,IAAI,EAAE,CAANA;IAFU,CAAA;AALU,CAAxB;AAWO,KAAA,CAAMnF,wCAAqB,IAAI,CAAtC,oBACE4B,iBADoC,kBAEpCC,aAFoC,YAGpCiD,OAAO,GAAG,CAAVA,WACCF,CAJkC,GAIH,CAJI;IAKpC,KAAA,EAAOnD,YAAD,EAAeE,eAAf,IAAkCgD,eAAQ,CAAS,CAAT;IAEhD,KAAA,CAAMjD,mBAAmB,GAAGjC,kBAAW,EACpCoD,KAAD,GAAgC,CADlC;QAEI,KAAA,CAAMwC,SAAS,GAAGzD,iBAAiB,CAACE,OAApC;QACA,EAAA,GAAKuD,SAAL,EAAgB,MAAhB;QAEA,KAAA,C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,KAAhC;IACA,KAAA,CAAM,CAAN,yBAAQyH,sBAAF,WAA0BhI,MAAAA,EAA1B,CAAA,GAAqCqG,yCAAiB;IAE5D,KAAA,CAAMmB,MAAM,GAAG6F,yCAAuB;IAEtC,MAAA,0CACG,yCAAD,iDACG,yCAAD;WACM9M,KAAJ;WACIyH,sBAAsB,CAACzH,KAAD,EAAQ0C,GAAR;QAC1B,SAAA,EAAW,SAAA,CAAGuE,MAAM,CAAC8C,IAAP,CAAY,CAHlC;YAGoCiD,QAAQ,EAAEvN,MAAVuN;QAAF,CAAZ,GAAmCxG,SAAtC;gDAEV,CAAD;QAAM,SAAA,EAAWS,MAAM,CAACgG,OAAR;OAAkBhN,QAAD,4CAChC,uBAAD;QAAkB,SAAA,EAAWgH,MAAM,CAACiG,IAAR;;AAInC,CArBD;AAuBO,KAAA,CAAMrP,yCAAc,iBAAGa,YAAK,CAAC4I,UAAN,CAAiByF,qCAAjB;;;AjBdvB,KAAA,CAAMhQ,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, { useCallback, useMemo, useRef, useEffect } from 'react';\nimport { mergeRefs, useId, useControllableState } from '@contentful/f36-core';\nimport { useArrowKeyNavigation } from './useArrowKeyNavigation';\nimport { Popover } from '@contentful/f36-popover';\nimport type { 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 * By default, the Menu is uncontrolled (manage it's expanded state by itself)\n * But you can make it controlled by providing boolean (true/false)\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 {\n isOpen,\n handleOpen,\n handleClose,\n isControlled,\n } = useControllableState({\n isOpen: props.isOpen,\n defaultIsOpen: props.defaultIsOpen,\n onOpen,\n onClose: props.onClose,\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","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 type {\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 { mergeRefs } from '@contentful/f36-core';\nimport type {\n CommonProps,\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\n_MenuItem.displayName = 'MenuItem';\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 '&:hover': {\n backgroundColor: tokens.gray100,\n },\n '&:focus': {\n boxShadow: `inset ${tokens.glowPrimary}`,\n // just to make boxShadow with rounded corners\n borderRadius: tokens.borderRadiusMedium,\n },\n '&:focus:not(:focus-visible)': {\n boxShadow: 'unset',\n borderRadius: 'unset',\n },\n '&:focus-visible': {\n boxShadow: `inset ${tokens.glowPrimary}`,\n borderRadius: tokens.borderRadiusMedium,\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 type { 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 type {\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 { SectionHeading } from '@contentful/f36-typography';\nimport type { SectionHeadingProps } from '@contentful/f36-typography';\nimport type { 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 type { 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","useCallback","useMemo","useRef","useEffect","mergeRefs","useId","useControllableState","useArrowKeyNavigation","Popover","PopoverProps","MenuContextProvider","MenuContextType","MENU_ITEMS_SELECTOR","Omit","isOpen","defaultIsOpen","onOpen","onClose","closeOnSelect","closeOnBlur","closeOnEsc","props","children","otherProps","handleOpen","handleClose","isControlled","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","useState","UseArrowKeyNavigationProps","MutableRefObject","keyType","initialFocusedIndex","ARROW_KEY_TYPES","vertical","prev","next","horizontal","container","items","lastItemIndex","focusFirstItem","focusLastItem","focusNextItem","focusPrevItem","keyToFnMap","fn","ComponentPropsWithRef","Ref","Pick","MenuContext","createContext","undefined","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","boxShadow","glowPrimary","borderRadius","borderRadiusMedium","gray200","opacity","only","cloneElement","getMenuDividerStyles","height","getMenuSectionTitleStyles","SectionHeading","SectionHeadingProps","marginTop","SUBMENU_OFFSET","isParentMenuOpen","mouseLeaveTimerRef","setIsOpen","window","clearTimeout","onMouseOver","onMouseLeave","ChevronRightIcon","getSubmenuTriggerStyles","_SubmenuTrigger","isActive","content","icon","alignItems","paddingRight","marginRight"],"version":3,"file":"module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;AEAA;;ACAA;AASA,MAAMmH,qCAAe,GAAG;IACtBC,QAAQ,EAAE;QACRC,IAAI,EAAE,SADE;QAERC,IAAI,EAAE,WAANA;KAHoB;IAKtBC,UAAU,EAAE;QACVF,IAAI,EAAE,WADI;QAEVC,IAAI,EAAE,YAANA;KAFU;CALd,AAAwB;AAWjB,MAAMnF,wCAAqB,GAAG,CAAC,EApBtC,mBAqBE4B,iBADoC,CAAA,EApBtC,eAsBEC,aAFoC,CAAA,WAGpCiD,OAAO,GAAG,UAAVA,GAHmC,G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AA,EAAWS,MAAM,CAACgG,OAAR;OAAkBhN,QAAD,CAAzC,gBACQ,2BAAC,uBAAD;QAAkB,SAAA,EAAWgH,MAAM,CAACiG,IAAR;MAApC,CACA,CATE,CAUF;CAnBA,AAqBC;AAEM,MAAMrP,yCAAc,iBAAGa,YAAK,CAAC4I,UAAN,CAAiByF,qCAAjB,CAAvB,AAAP;;;AjBdO,MAAMhQ,yCAAI,GAAGgB,yCAAb,AAAP;AACAhB,yCAAI,CAACoB,IAAL,GAAYlB,wCAAZ,CAAAF;AACAA,yCAAI,CAACqB,UAAL,GAAkBJ,yCAAlB,CAAAjB;AACAA,yCAAI,CAACsB,UAAL,GAAkBJ,yCAAlB,CAAAlB;AACAA,yCAAI,CAACuB,IAAL,GAAYnB,yCAAZ,CAAAJ;AACAA,yCAAI,CAACwB,OAAL,GAAelB,yCAAf,CAAAN;AACAA,yCAAI,CAACyB,OAAL,GAAejB,yCAAf,CAAAR;AACAA,yCAAI,CAAC0B,YAAL,GAAoBhB,yCAApB,CAAAV;AACAA,yCAAI,CAACY,OAAL,GAAeA,yCAAf,CAAAZ;AACAA,yCAAI,CAACc,cAAL,GAAsBA,yCAAtB,CAAAd;;ADhCA","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, { useCallback, useMemo, useRef, useEffect } from 'react';\nimport { mergeRefs, useId, useControllableState } from '@contentful/f36-core';\nimport { useArrowKeyNavigation } from './useArrowKeyNavigation';\nimport { Popover } from '@contentful/f36-popover';\nimport type { 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 * By default, the Menu is uncontrolled (manage it's expanded state by itself)\n * But you can make it controlled by providing boolean (true/false)\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 {\n isOpen,\n handleOpen,\n handleClose,\n isControlled,\n } = useControllableState({\n isOpen: props.isOpen,\n defaultIsOpen: props.defaultIsOpen,\n onOpen,\n onClose: props.onClose,\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","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 type {\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 { mergeRefs } from '@contentful/f36-core';\nimport type {\n CommonProps,\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\n_MenuItem.displayName = 'MenuItem';\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 '&:hover': {\n backgroundColor: tokens.gray100,\n },\n '&:focus': {\n boxShadow: `inset ${tokens.glowPrimary}`,\n // just to make boxShadow with rounded corners\n borderRadius: tokens.borderRadiusMedium,\n },\n '&:focus:not(:focus-visible)': {\n boxShadow: 'unset',\n borderRadius: 'unset',\n },\n '&:focus-visible': {\n boxShadow: `inset ${tokens.glowPrimary}`,\n borderRadius: tokens.borderRadiusMedium,\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 type { 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 type {\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 { SectionHeading } from '@contentful/f36-typography';\nimport type { SectionHeadingProps } from '@contentful/f36-typography';\nimport type { 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 type { 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","useCallback","useMemo","useRef","useEffect","mergeRefs","useId","useControllableState","useArrowKeyNavigation","Popover","PopoverProps","MenuContextProvider","MenuContextType","MENU_ITEMS_SELECTOR","Omit","isOpen","defaultIsOpen","onOpen","onClose","closeOnSelect","closeOnBlur","closeOnEsc","props","children","otherProps","handleOpen","handleClose","isControlled","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","useState","UseArrowKeyNavigationProps","MutableRefObject","keyType","initialFocusedIndex","ARROW_KEY_TYPES","vertical","prev","next","horizontal","container","items","lastItemIndex","focusFirstItem","focusLastItem","focusNextItem","focusPrevItem","keyToFnMap","fn","ComponentPropsWithRef","Ref","Pick","MenuContext","createContext","undefined","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","boxShadow","glowPrimary","borderRadius","borderRadiusMedium","gray200","opacity","only","cloneElement","getMenuDividerStyles","height","getMenuSectionTitleStyles","SectionHeading","SectionHeadingProps","marginTop","SUBMENU_OFFSET","isParentMenuOpen","mouseLeaveTimerRef","setIsOpen","window","clearTimeout","onMouseOver","onMouseLeave","ChevronRightIcon","getSubmenuTriggerStyles","_SubmenuTrigger","isActive","content","icon","alignItems","paddingRight","marginRight"],"version":3,"file":"module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/f36-menu",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.0",
|
|
4
4
|
"description": "Forma 36: Menu component",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "parcel build"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@babel/runtime": "^7.6.2",
|
|
10
|
-
"@contentful/f36-core": "^4.
|
|
11
|
-
"@contentful/f36-icons": "^4.
|
|
12
|
-
"@contentful/f36-popover": "^4.
|
|
10
|
+
"@contentful/f36-core": "^4.8.0",
|
|
11
|
+
"@contentful/f36-icons": "^4.8.0",
|
|
12
|
+
"@contentful/f36-popover": "^4.8.0",
|
|
13
13
|
"@contentful/f36-tokens": "^4.0.1",
|
|
14
|
-
"@contentful/f36-typography": "^4.
|
|
15
|
-
"@contentful/f36-utils": "^4.
|
|
14
|
+
"@contentful/f36-typography": "^4.8.0",
|
|
15
|
+
"@contentful/f36-utils": "^4.8.0",
|
|
16
16
|
"emotion": "^10.0.17"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|