@fluentui/react-popover 0.0.0-nightly-20230317-1454.1 → 0.0.0-nightly-20230321-0440.1
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.json +23 -23
- package/CHANGELOG.md +14 -14
- package/lib/Popover.js +1 -1
- package/lib/Popover.js.map +1 -1
- package/lib/PopoverSurface.js +1 -1
- package/lib/PopoverSurface.js.map +1 -1
- package/lib/PopoverTrigger.js +1 -1
- package/lib/PopoverTrigger.js.map +1 -1
- package/lib/components/Popover/Popover.js +3 -4
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.types.js +1 -1
- package/lib/components/Popover/Popover.types.js.map +1 -1
- package/lib/components/Popover/constants.js +2 -1
- package/lib/components/Popover/constants.js.map +1 -1
- package/lib/components/Popover/index.js +4 -4
- package/lib/components/Popover/index.js.map +1 -1
- package/lib/components/Popover/renderPopover.js +2 -2
- package/lib/components/Popover/renderPopover.js.map +1 -1
- package/lib/components/Popover/usePopover.js +28 -22
- package/lib/components/Popover/usePopover.js.map +1 -1
- package/lib/components/PopoverSurface/PopoverSurface.js +6 -6
- package/lib/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
- package/lib/components/PopoverSurface/index.js +5 -5
- package/lib/components/PopoverSurface/index.js.map +1 -1
- package/lib/components/PopoverSurface/renderPopoverSurface.js +6 -4
- package/lib/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurface.js +12 -12
- package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js +6 -6
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.js +3 -4
- package/lib/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.types.js +1 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
- package/lib/components/PopoverTrigger/index.js +4 -4
- package/lib/components/PopoverTrigger/index.js.map +1 -1
- package/lib/components/PopoverTrigger/renderPopoverTrigger.js +2 -1
- package/lib/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
- package/lib/components/PopoverTrigger/usePopoverTrigger.js +15 -16
- package/lib/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/popoverContext.js +2 -2
- package/lib/popoverContext.js.map +1 -1
- package/lib-commonjs/Popover.js +4 -5
- package/lib-commonjs/Popover.js.map +1 -1
- package/lib-commonjs/PopoverSurface.js +4 -5
- package/lib-commonjs/PopoverSurface.js.map +1 -1
- package/lib-commonjs/PopoverTrigger.js +4 -5
- package/lib-commonjs/PopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/Popover/Popover.js +13 -14
- package/lib-commonjs/components/Popover/Popover.js.map +1 -1
- package/lib-commonjs/components/Popover/Popover.types.js +2 -5
- package/lib-commonjs/components/Popover/Popover.types.js.map +1 -1
- package/lib-commonjs/components/Popover/constants.js +8 -10
- package/lib-commonjs/components/Popover/constants.js.map +1 -1
- package/lib-commonjs/components/Popover/index.js +7 -8
- package/lib-commonjs/components/Popover/index.js.map +1 -1
- package/lib-commonjs/components/Popover/renderPopover.js +47 -31
- package/lib-commonjs/components/Popover/renderPopover.js.map +1 -1
- package/lib-commonjs/components/Popover/usePopover.js +173 -173
- package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js +20 -19
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js +2 -3
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/index.js +8 -9
- package/lib-commonjs/components/PopoverSurface/index.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js +28 -23
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js +81 -69
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js +113 -243
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js +14 -15
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js +2 -5
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/index.js +7 -8
- package/lib-commonjs/components/PopoverTrigger/index.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js +11 -12
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js +80 -71
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
- package/lib-commonjs/index.js +92 -30
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/popoverContext.js +25 -34
- package/lib-commonjs/popoverContext.js.map +1 -1
- package/package.json +14 -13
- package/.swcrc +0 -39
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"names":[],"sources":["../../../../../../../../../packages/react-components/react-popover/src/components/PopoverSurface/PopoverSurface.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { PopoverContextValue } from '../../popoverContext';\n\n/**\n * PopoverSurface Props\n */\nexport type PopoverSurfaceProps = ComponentProps<PopoverSurfaceSlots>;\n\n/**\n * Names of the slots in PopoverSurfaceProps\n */\nexport type PopoverSurfaceSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * PopoverSurface State\n */\nexport type PopoverSurfaceState = ComponentState<PopoverSurfaceSlots> &\n Pick<PopoverContextValue, 'appearance' | 'arrowRef' | 'inline' | 'mountNode' | 'size' | 'withArrow'> & {\n /**\n * CSS class for the arrow element\n */\n arrowClassName?: string;\n };\n"],"mappings":""}
|
@@ -1,13 +1,12 @@
|
|
1
1
|
"use strict";
|
2
|
+
|
2
3
|
Object.defineProperty(exports, "__esModule", {
|
3
|
-
|
4
|
+
value: true
|
4
5
|
});
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
//# sourceMappingURL=index.js.map
|
12
|
-
|
6
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
7
|
+
tslib_1.__exportStar(require("./PopoverSurface"), exports);
|
8
|
+
tslib_1.__exportStar(require("./PopoverSurface.types"), exports);
|
9
|
+
tslib_1.__exportStar(require("./renderPopoverSurface"), exports);
|
10
|
+
tslib_1.__exportStar(require("./usePopoverSurface"), exports);
|
11
|
+
tslib_1.__exportStar(require("./usePopoverSurfaceStyles"), exports);
|
13
12
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../../../../../../../../../packages/react-components/react-popover/src/components/PopoverSurface/index.ts"],"sourcesContent":["export * from './PopoverSurface';\nexport * from './PopoverSurface.types';\nexport * from './renderPopoverSurface';\nexport * from './usePopoverSurface';\nexport * from './usePopoverSurfaceStyles';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,sBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,4BAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,4BAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,yBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,+BAAAC,OAAA"}
|
@@ -1,27 +1,32 @@
|
|
1
1
|
"use strict";
|
2
|
+
|
2
3
|
Object.defineProperty(exports, "__esModule", {
|
3
|
-
|
4
|
-
});
|
5
|
-
Object.defineProperty(exports, "renderPopoverSurface_unstable", {
|
6
|
-
enumerable: true,
|
7
|
-
get: ()=>renderPopoverSurface_unstable
|
4
|
+
value: true
|
8
5
|
});
|
9
|
-
|
10
|
-
const
|
11
|
-
const
|
12
|
-
const
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
6
|
+
exports.renderPopoverSurface_unstable = void 0;
|
7
|
+
const React = /*#__PURE__*/require("react");
|
8
|
+
const react_portal_1 = /*#__PURE__*/require("@fluentui/react-portal");
|
9
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
10
|
+
/**
|
11
|
+
* Render the final JSX of PopoverSurface
|
12
|
+
*/
|
13
|
+
const renderPopoverSurface_unstable = state => {
|
14
|
+
const {
|
15
|
+
slots,
|
16
|
+
slotProps
|
17
|
+
} = react_utilities_1.getSlots(state);
|
18
|
+
const surface = React.createElement(slots.root, {
|
19
|
+
...slotProps.root
|
20
|
+
}, state.withArrow && React.createElement("div", {
|
21
|
+
ref: state.arrowRef,
|
22
|
+
className: state.arrowClassName
|
23
|
+
}), slotProps.root.children);
|
24
|
+
if (state.inline) {
|
25
|
+
return surface;
|
26
|
+
}
|
27
|
+
return React.createElement(react_portal_1.Portal, {
|
28
|
+
mountNode: state.mountNode
|
29
|
+
}, surface);
|
30
|
+
};
|
31
|
+
exports.renderPopoverSurface_unstable = renderPopoverSurface_unstable;
|
27
32
|
//# sourceMappingURL=renderPopoverSurface.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"names":["React","require","react_portal_1","react_utilities_1","renderPopoverSurface_unstable","state","slots","slotProps","getSlots","surface","createElement","root","withArrow","ref","arrowRef","className","arrowClassName","children","inline","Portal","mountNode","exports"],"sources":["../../../../../../../../../packages/react-components/react-popover/src/components/PopoverSurface/renderPopoverSurface.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Portal } from '@fluentui/react-portal';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface.types';\n\n/**\n * Render the final JSX of PopoverSurface\n */\nexport const renderPopoverSurface_unstable = (state: PopoverSurfaceState) => {\n const { slots, slotProps } = getSlots<PopoverSurfaceSlots>(state);\n\n const surface = (\n <slots.root {...slotProps.root}>\n {state.withArrow && <div ref={state.arrowRef} className={state.arrowClassName} />}\n {slotProps.root.children}\n </slots.root>\n );\n\n if (state.inline) {\n return surface;\n }\n\n return <Portal mountNode={state.mountNode}>{surface}</Portal>;\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,cAAA,gBAAAD,OAAA;AACA,MAAAE,iBAAA,gBAAAF,OAAA;AAGA;;;AAGO,MAAMG,6BAA6B,GAAIC,KAA0B,IAAI;EAC1E,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,iBAAA,CAAAK,QAAQ,CAAsBH,KAAK,CAAC;EAEjE,MAAMI,OAAO,GACXT,KAAA,CAAAU,aAAA,CAACJ,KAAK,CAACK,IAAI;IAAA,GAAKJ,SAAS,CAACI;EAAI,GAC3BN,KAAK,CAACO,SAAS,IAAIZ,KAAA,CAAAU,aAAA;IAAKG,GAAG,EAAER,KAAK,CAACS,QAAQ;IAAEC,SAAS,EAAEV,KAAK,CAACW;EAAc,EAAI,EAChFT,SAAS,CAACI,IAAI,CAACM,QAAQ,CAE3B;EAED,IAAIZ,KAAK,CAACa,MAAM,EAAE;IAChB,OAAOT,OAAO;;EAGhB,OAAOT,KAAA,CAAAU,aAAA,CAACR,cAAA,CAAAiB,MAAM;IAACC,SAAS,EAAEf,KAAK,CAACe;EAAS,GAAGX,OAAO,CAAU;AAC/D,CAAC;AAfYY,OAAA,CAAAjB,6BAA6B,GAAAA,6BAAA"}
|
@@ -1,73 +1,85 @@
|
|
1
1
|
"use strict";
|
2
|
+
|
2
3
|
Object.defineProperty(exports, "__esModule", {
|
3
|
-
|
4
|
-
});
|
5
|
-
Object.defineProperty(exports, "usePopoverSurface_unstable", {
|
6
|
-
enumerable: true,
|
7
|
-
get: ()=>usePopoverSurface_unstable
|
4
|
+
value: true
|
8
5
|
});
|
9
|
-
|
10
|
-
const
|
11
|
-
const
|
12
|
-
const
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
6
|
+
exports.usePopoverSurface_unstable = void 0;
|
7
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
8
|
+
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
9
|
+
const popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
|
10
|
+
/**
|
11
|
+
* Create the state required to render PopoverSurface.
|
12
|
+
*
|
13
|
+
* The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,
|
14
|
+
* before being passed to renderPopoverSurface_unstable.
|
15
|
+
*
|
16
|
+
* @param props - props from this instance of PopoverSurface
|
17
|
+
* @param ref - reference to root HTMLDivElement of PopoverSurface
|
18
|
+
*/
|
19
|
+
const usePopoverSurface_unstable = (props, ref) => {
|
20
|
+
const contentRef = popoverContext_1.usePopoverContext_unstable(context => context.contentRef);
|
21
|
+
const openOnHover = popoverContext_1.usePopoverContext_unstable(context => context.openOnHover);
|
22
|
+
const setOpen = popoverContext_1.usePopoverContext_unstable(context => context.setOpen);
|
23
|
+
const mountNode = popoverContext_1.usePopoverContext_unstable(context => context.mountNode);
|
24
|
+
const arrowRef = popoverContext_1.usePopoverContext_unstable(context => context.arrowRef);
|
25
|
+
const size = popoverContext_1.usePopoverContext_unstable(context => context.size);
|
26
|
+
const withArrow = popoverContext_1.usePopoverContext_unstable(context => context.withArrow);
|
27
|
+
const appearance = popoverContext_1.usePopoverContext_unstable(context => context.appearance);
|
28
|
+
const trapFocus = popoverContext_1.usePopoverContext_unstable(context => context.trapFocus);
|
29
|
+
const inertTrapFocus = popoverContext_1.usePopoverContext_unstable(context => context.inertTrapFocus);
|
30
|
+
const inline = popoverContext_1.usePopoverContext_unstable(context => context.inline);
|
31
|
+
const {
|
32
|
+
modalAttributes
|
33
|
+
} = react_tabster_1.useModalAttributes({
|
34
|
+
trapFocus,
|
35
|
+
legacyTrapFocus: !inertTrapFocus,
|
36
|
+
alwaysFocusable: !trapFocus
|
37
|
+
});
|
38
|
+
const state = {
|
39
|
+
inline,
|
40
|
+
appearance,
|
41
|
+
withArrow,
|
42
|
+
size,
|
43
|
+
arrowRef,
|
44
|
+
mountNode,
|
45
|
+
components: {
|
46
|
+
root: 'div'
|
47
|
+
},
|
48
|
+
root: react_utilities_1.getNativeElementProps('div', {
|
49
|
+
ref: react_utilities_1.useMergedRefs(ref, contentRef),
|
50
|
+
role: trapFocus ? 'dialog' : 'group',
|
51
|
+
'aria-modal': trapFocus ? true : undefined,
|
52
|
+
...modalAttributes,
|
53
|
+
...props
|
54
|
+
})
|
55
|
+
};
|
56
|
+
const {
|
57
|
+
onMouseEnter: onMouseEnterOriginal,
|
58
|
+
onMouseLeave: onMouseLeaveOriginal,
|
59
|
+
onKeyDown: onKeyDownOriginal
|
60
|
+
} = state.root;
|
61
|
+
state.root.onMouseEnter = e => {
|
62
|
+
if (openOnHover) {
|
63
|
+
setOpen(e, true);
|
64
|
+
}
|
65
|
+
onMouseEnterOriginal === null || onMouseEnterOriginal === void 0 ? void 0 : onMouseEnterOriginal(e);
|
66
|
+
};
|
67
|
+
state.root.onMouseLeave = e => {
|
68
|
+
if (openOnHover) {
|
69
|
+
setOpen(e, false);
|
70
|
+
}
|
71
|
+
onMouseLeaveOriginal === null || onMouseLeaveOriginal === void 0 ? void 0 : onMouseLeaveOriginal(e);
|
72
|
+
};
|
73
|
+
state.root.onKeyDown = e => {
|
74
|
+
var _a;
|
75
|
+
// only close if the event happened inside the current popover
|
76
|
+
// If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack
|
77
|
+
if (e.key === 'Escape' && ((_a = contentRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
|
78
|
+
setOpen(e, false);
|
79
|
+
}
|
80
|
+
onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(e);
|
81
|
+
};
|
82
|
+
return state;
|
83
|
+
};
|
84
|
+
exports.usePopoverSurface_unstable = usePopoverSurface_unstable;
|
73
85
|
//# sourceMappingURL=usePopoverSurface.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"names":["react_utilities_1","require","react_tabster_1","popoverContext_1","usePopoverSurface_unstable","props","ref","contentRef","usePopoverContext_unstable","context","openOnHover","setOpen","mountNode","arrowRef","size","withArrow","appearance","trapFocus","inertTrapFocus","inline","modalAttributes","useModalAttributes","legacyTrapFocus","alwaysFocusable","state","components","root","getNativeElementProps","useMergedRefs","role","undefined","onMouseEnter","onMouseEnterOriginal","onMouseLeave","onMouseLeaveOriginal","onKeyDown","onKeyDownOriginal","e","key","_a","current","contains","target","exports"],"sources":["../../../../../../../../../packages/react-components/react-popover/src/components/PopoverSurface/usePopoverSurface.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopoverContext_unstable } from '../../popoverContext';\nimport type { PopoverSurfaceProps, PopoverSurfaceState } from './PopoverSurface.types';\n\n/**\n * Create the state required to render PopoverSurface.\n *\n * The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,\n * before being passed to renderPopoverSurface_unstable.\n *\n * @param props - props from this instance of PopoverSurface\n * @param ref - reference to root HTMLDivElement of PopoverSurface\n */\nexport const usePopoverSurface_unstable = (\n props: PopoverSurfaceProps,\n ref: React.Ref<HTMLDivElement>,\n): PopoverSurfaceState => {\n const contentRef = usePopoverContext_unstable(context => context.contentRef);\n const openOnHover = usePopoverContext_unstable(context => context.openOnHover);\n const setOpen = usePopoverContext_unstable(context => context.setOpen);\n const mountNode = usePopoverContext_unstable(context => context.mountNode);\n const arrowRef = usePopoverContext_unstable(context => context.arrowRef);\n const size = usePopoverContext_unstable(context => context.size);\n const withArrow = usePopoverContext_unstable(context => context.withArrow);\n const appearance = usePopoverContext_unstable(context => context.appearance);\n const trapFocus = usePopoverContext_unstable(context => context.trapFocus);\n const inertTrapFocus = usePopoverContext_unstable(context => context.inertTrapFocus);\n const inline = usePopoverContext_unstable(context => context.inline);\n const { modalAttributes } = useModalAttributes({\n trapFocus,\n legacyTrapFocus: !inertTrapFocus,\n alwaysFocusable: !trapFocus,\n });\n\n const state: PopoverSurfaceState = {\n inline,\n appearance,\n withArrow,\n size,\n arrowRef,\n mountNode,\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref: useMergedRefs(ref, contentRef),\n role: trapFocus ? 'dialog' : 'group',\n 'aria-modal': trapFocus ? true : undefined,\n ...modalAttributes,\n ...props,\n }),\n };\n\n const {\n onMouseEnter: onMouseEnterOriginal,\n onMouseLeave: onMouseLeaveOriginal,\n onKeyDown: onKeyDownOriginal,\n } = state.root;\n state.root.onMouseEnter = (e: React.MouseEvent<HTMLDivElement>) => {\n if (openOnHover) {\n setOpen(e, true);\n }\n\n onMouseEnterOriginal?.(e);\n };\n\n state.root.onMouseLeave = (e: React.MouseEvent<HTMLDivElement>) => {\n if (openOnHover) {\n setOpen(e, false);\n }\n\n onMouseLeaveOriginal?.(e);\n };\n\n state.root.onKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n // only close if the event happened inside the current popover\n // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack\n if (e.key === 'Escape' && contentRef.current?.contains(e.target as HTMLDivElement)) {\n setOpen(e, false);\n }\n\n onKeyDownOriginal?.(e);\n };\n\n return state;\n};\n"],"mappings":";;;;;;AACA,MAAAA,iBAAA,gBAAAC,OAAA;AACA,MAAAC,eAAA,gBAAAD,OAAA;AACA,MAAAE,gBAAA,gBAAAF,OAAA;AAGA;;;;;;;;;AASO,MAAMG,0BAA0B,GAAGA,CACxCC,KAA0B,EAC1BC,GAA8B,KACP;EACvB,MAAMC,UAAU,GAAGJ,gBAAA,CAAAK,0BAA0B,CAACC,OAAO,IAAIA,OAAO,CAACF,UAAU,CAAC;EAC5E,MAAMG,WAAW,GAAGP,gBAAA,CAAAK,0BAA0B,CAACC,OAAO,IAAIA,OAAO,CAACC,WAAW,CAAC;EAC9E,MAAMC,OAAO,GAAGR,gBAAA,CAAAK,0BAA0B,CAACC,OAAO,IAAIA,OAAO,CAACE,OAAO,CAAC;EACtE,MAAMC,SAAS,GAAGT,gBAAA,CAAAK,0BAA0B,CAACC,OAAO,IAAIA,OAAO,CAACG,SAAS,CAAC;EAC1E,MAAMC,QAAQ,GAAGV,gBA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