@fluentui/react-popover 9.0.0-nightly.46b9ea7036.0 → 9.0.0-rc.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +368 -29
- package/CHANGELOG.md +89 -21
- package/dist/react-popover.d.ts +31 -20
- package/lib/components/Popover/Popover.js +5 -5
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.types.d.ts +2 -1
- package/lib/components/Popover/renderPopover.d.ts +1 -1
- package/lib/components/Popover/renderPopover.js +27 -25
- package/lib/components/Popover/renderPopover.js.map +1 -1
- package/lib/components/Popover/usePopover.d.ts +2 -2
- package/lib/components/Popover/usePopover.js +42 -53
- package/lib/components/Popover/usePopover.js.map +1 -1
- package/lib/components/PopoverSurface/PopoverSurface.js +7 -7
- package/lib/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/PopoverSurface.types.d.ts +2 -2
- package/lib/components/PopoverSurface/renderPopoverSurface.d.ts +1 -1
- package/lib/components/PopoverSurface/renderPopoverSurface.js +7 -8
- package/lib/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurface.d.ts +4 -5
- package/lib/components/PopoverSurface/usePopoverSurface.js +44 -58
- package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +2 -1
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js +34 -22
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.d.ts +2 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.js +6 -5
- package/lib/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.types.d.ts +9 -2
- package/lib/components/PopoverTrigger/renderPopoverTrigger.d.ts +1 -1
- package/lib/components/PopoverTrigger/renderPopoverTrigger.js +1 -1
- package/lib/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
- package/lib/components/PopoverTrigger/usePopoverTrigger.d.ts +2 -2
- package/lib/components/PopoverTrigger/usePopoverTrigger.js +39 -54
- package/lib/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
- package/lib/popoverContext.d.ts +1 -1
- package/lib/popoverContext.js +3 -7
- package/lib/popoverContext.js.map +1 -1
- package/lib-commonjs/Popover.js +1 -1
- package/lib-commonjs/PopoverSurface.js +1 -1
- package/lib-commonjs/PopoverTrigger.js +1 -1
- package/lib-commonjs/components/Popover/Popover.js +5 -5
- package/lib-commonjs/components/Popover/Popover.js.map +1 -1
- package/lib-commonjs/components/Popover/Popover.types.d.ts +2 -1
- package/lib-commonjs/components/Popover/index.js +1 -1
- package/lib-commonjs/components/Popover/renderPopover.d.ts +1 -1
- package/lib-commonjs/components/Popover/renderPopover.js +31 -29
- package/lib-commonjs/components/Popover/renderPopover.js.map +1 -1
- package/lib-commonjs/components/Popover/usePopover.d.ts +2 -2
- package/lib-commonjs/components/Popover/usePopover.js +50 -62
- package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js +8 -8
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.d.ts +2 -2
- package/lib-commonjs/components/PopoverSurface/index.js +1 -1
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.d.ts +1 -1
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js +12 -15
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.d.ts +4 -5
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js +50 -65
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +2 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js +38 -24
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.d.ts +2 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js +6 -5
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.d.ts +9 -2
- package/lib-commonjs/components/PopoverTrigger/index.js +1 -1
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.d.ts +1 -1
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js +3 -3
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.d.ts +2 -2
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js +44 -60
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
- package/lib-commonjs/index.js +1 -1
- package/lib-commonjs/popoverContext.d.ts +1 -1
- package/lib-commonjs/popoverContext.js +5 -9
- package/lib-commonjs/popoverContext.js.map +1 -1
- package/package.json +13 -15
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -13
- package/lib/common/isConformant.js.map +0 -1
- package/lib/common/mockUsePopoverContext.d.ts +0 -7
- package/lib/common/mockUsePopoverContext.js +0 -38
- package/lib/common/mockUsePopoverContext.js.map +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -24
- package/lib-commonjs/common/isConformant.js.map +0 -1
- package/lib-commonjs/common/mockUsePopoverContext.d.ts +0 -7
- package/lib-commonjs/common/mockUsePopoverContext.js +0 -49
- package/lib-commonjs/common/mockUsePopoverContext.js.map +0 -1
@@ -3,84 +3,67 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.usePopoverSurface_unstable = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
-
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
11
|
|
12
|
-
|
12
|
+
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
var popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
|
17
|
-
|
18
|
-
exports.popoverSurfaceSlots = ['root'];
|
14
|
+
const popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
|
19
15
|
/**
|
20
16
|
* Create the state required to render PopoverSurface.
|
21
17
|
*
|
22
|
-
* The returned state can be modified with hooks such as
|
23
|
-
* before being passed to
|
18
|
+
* The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,
|
19
|
+
* before being passed to renderPopoverSurface_unstable.
|
24
20
|
*
|
25
21
|
* @param props - props from this instance of PopoverSurface
|
26
22
|
* @param ref - reference to root HTMLDivElement of PopoverSurface
|
27
23
|
*/
|
28
24
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
var arrowRef = popoverContext_1.usePopoverContext(function (context) {
|
46
|
-
return context.arrowRef;
|
47
|
-
});
|
48
|
-
var size = popoverContext_1.usePopoverContext(function (context) {
|
49
|
-
return context.size;
|
50
|
-
});
|
51
|
-
var noArrow = popoverContext_1.usePopoverContext(function (context) {
|
52
|
-
return context.noArrow;
|
53
|
-
});
|
54
|
-
var appearance = popoverContext_1.usePopoverContext(function (context) {
|
55
|
-
return context.appearance;
|
56
|
-
});
|
57
|
-
var trapFocus = popoverContext_1.usePopoverContext(function (context) {
|
58
|
-
return context.trapFocus;
|
25
|
+
|
26
|
+
const usePopoverSurface_unstable = (props, ref) => {
|
27
|
+
const contentRef = popoverContext_1.usePopoverContext_unstable(context => context.contentRef);
|
28
|
+
const open = popoverContext_1.usePopoverContext_unstable(context => context.open);
|
29
|
+
const openOnHover = popoverContext_1.usePopoverContext_unstable(context => context.openOnHover);
|
30
|
+
const setOpen = popoverContext_1.usePopoverContext_unstable(context => context.setOpen);
|
31
|
+
const mountNode = popoverContext_1.usePopoverContext_unstable(context => context.mountNode);
|
32
|
+
const arrowRef = popoverContext_1.usePopoverContext_unstable(context => context.arrowRef);
|
33
|
+
const size = popoverContext_1.usePopoverContext_unstable(context => context.size);
|
34
|
+
const noArrow = popoverContext_1.usePopoverContext_unstable(context => context.noArrow);
|
35
|
+
const appearance = popoverContext_1.usePopoverContext_unstable(context => context.appearance);
|
36
|
+
const trapFocus = popoverContext_1.usePopoverContext_unstable(context => context.trapFocus);
|
37
|
+
const {
|
38
|
+
modalAttributes
|
39
|
+
} = react_tabster_1.useModalAttributes({
|
40
|
+
trapFocus
|
59
41
|
});
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
arrowRef: arrowRef,
|
68
|
-
open: open,
|
69
|
-
mountNode: mountNode,
|
42
|
+
const state = {
|
43
|
+
appearance,
|
44
|
+
noArrow,
|
45
|
+
size,
|
46
|
+
arrowRef,
|
47
|
+
open,
|
48
|
+
mountNode,
|
70
49
|
components: {
|
71
50
|
root: 'div'
|
72
51
|
},
|
73
|
-
root: react_utilities_1.getNativeElementProps('div',
|
52
|
+
root: react_utilities_1.getNativeElementProps('div', {
|
74
53
|
ref: react_utilities_1.useMergedRefs(ref, contentRef),
|
75
|
-
role: 'dialog'
|
76
|
-
|
54
|
+
role: trapFocus ? 'dialog' : 'complementary',
|
55
|
+
'aria-modal': trapFocus ? true : undefined,
|
56
|
+
...modalAttributes,
|
57
|
+
...props
|
58
|
+
})
|
77
59
|
};
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
60
|
+
const {
|
61
|
+
onMouseEnter: onMouseEnterOriginal,
|
62
|
+
onMouseLeave: onMouseLeaveOriginal,
|
63
|
+
onKeyDown: onKeyDownOriginal
|
64
|
+
} = state.root;
|
82
65
|
|
83
|
-
state.root.onMouseEnter =
|
66
|
+
state.root.onMouseEnter = e => {
|
84
67
|
if (openOnHover) {
|
85
68
|
setOpen(e, true);
|
86
69
|
}
|
@@ -88,7 +71,7 @@ var usePopoverSurface = function (props, ref) {
|
|
88
71
|
onMouseEnterOriginal === null || onMouseEnterOriginal === void 0 ? void 0 : onMouseEnterOriginal(e);
|
89
72
|
};
|
90
73
|
|
91
|
-
state.root.onMouseLeave =
|
74
|
+
state.root.onMouseLeave = e => {
|
92
75
|
if (openOnHover) {
|
93
76
|
setOpen(e, false);
|
94
77
|
}
|
@@ -96,7 +79,7 @@ var usePopoverSurface = function (props, ref) {
|
|
96
79
|
onMouseLeaveOriginal === null || onMouseLeaveOriginal === void 0 ? void 0 : onMouseLeaveOriginal(e);
|
97
80
|
};
|
98
81
|
|
99
|
-
state.root.onKeyDown =
|
82
|
+
state.root.onKeyDown = e => {
|
100
83
|
var _a; // only close if the event happened inside the current popover
|
101
84
|
// If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack
|
102
85
|
|
@@ -108,15 +91,17 @@ var usePopoverSurface = function (props, ref) {
|
|
108
91
|
onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(e);
|
109
92
|
};
|
110
93
|
|
111
|
-
|
112
|
-
|
94
|
+
const {
|
95
|
+
findFirstFocusable
|
96
|
+
} = react_tabster_1.useFocusFinders();
|
97
|
+
React.useEffect(() => {
|
113
98
|
if (state.open && contentRef.current) {
|
114
|
-
|
99
|
+
const firstFocusable = findFirstFocusable(contentRef.current);
|
115
100
|
firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
|
116
101
|
}
|
117
102
|
}, [contentRef, findFirstFocusable, state.open]);
|
118
103
|
return state;
|
119
104
|
};
|
120
105
|
|
121
|
-
exports.
|
106
|
+
exports.usePopoverSurface_unstable = usePopoverSurface_unstable;
|
122
107
|
//# sourceMappingURL=usePopoverSurface.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PopoverSurface/usePopoverSurface.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/PopoverSurface/usePopoverSurface.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;AAGA;;;;;;;;AAQG;;;AACI,MAAM,0BAA0B,GAAG,CACxC,KADwC,EAExC,GAFwC,KAGjB;AACvB,QAAM,UAAU,GAAG,gBAAA,CAAA,0BAAA,CAA2B,OAAO,IAAI,OAAO,CAAC,UAA9C,CAAnB;AACA,QAAM,IAAI,GAAG,gBAAA,CAAA,0BAAA,CAA2B,OAAO,IAAI,OAAO,CAAC,IAA9C,CAAb;AACA,QAAM,WAAW,GAAG,gBAAA,CAAA,0BAAA,CAA2B,OAAO,IAAI,OAAO,CAAC,WAA9C,CAApB;AACA,QAAM,OAAO,GAAG,gBAAA,CAAA,0BAAA,CAA2B,OAAO,IAAI,OAAO,CAAC,OAA9C,CAAhB;AACA,QAAM,SAAS,GAAG,gBAAA,CAAA,0BAAA,CAA2B,OAAO,IAAI,OAAO,CAAC,SAA9C,CAAlB;AACA,QAAM,QAAQ,GAAG,gBAAA,CAAA,0BAAA,CAA2B,OAAO,IAAI,OAAO,CAAC,QAA9C,CAAjB;AACA,QAAM,IAAI,GAAG,gBAAA,CAAA,0BAAA,CAA2B,OAAO,IAAI,OAAO,CAAC,IAA9C,CAAb;AACA,QAAM,OAAO,GAAG,gBAAA,CAAA,0BAAA,CAA2B,OAAO,IAAI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","sourceRoot":""}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import type { PopoverSize } from '../Popover/Popover.types';
|
2
2
|
import type { PopoverSurfaceState } from './PopoverSurface.types';
|
3
|
+
export declare const popoverSurfaceClassName = "fui-PopoverSurface";
|
3
4
|
export declare const arrowHeights: Record<PopoverSize, number>;
|
4
5
|
/**
|
5
6
|
* Apply styling to the PopoverSurface slots based on the state
|
6
7
|
*/
|
7
|
-
export declare const
|
8
|
+
export declare const usePopoverSurfaceStyles_unstable: (state: PopoverSurfaceState) => PopoverSurfaceState;
|
@@ -3,10 +3,15 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.usePopoverSurfaceStyles_unstable = exports.arrowHeights = exports.popoverSurfaceClassName = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
9
|
|
10
|
+
const react_positioning_1 = /*#__PURE__*/require("@fluentui/react-positioning");
|
11
|
+
|
12
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
13
|
+
|
14
|
+
exports.popoverSurfaceClassName = 'fui-PopoverSurface';
|
10
15
|
exports.arrowHeights = {
|
11
16
|
small: 6,
|
12
17
|
medium: 8,
|
@@ -16,11 +21,14 @@ exports.arrowHeights = {
|
|
16
21
|
* Styles for the root slot
|
17
22
|
*/
|
18
23
|
|
19
|
-
|
24
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
20
25
|
"root": {
|
21
26
|
"De3pzq": "fxugw4r",
|
22
|
-
"E5pizo":
|
23
|
-
"
|
27
|
+
"E5pizo": "f1hg901r",
|
28
|
+
"Bbmb7ep": ["fff7au0", "f1bjk9e1"],
|
29
|
+
"Beyfa6y": ["f1bjk9e1", "fff7au0"],
|
30
|
+
"B7oj6ja": ["fwsfkhu", "f8wkphi"],
|
31
|
+
"Btl43ni": ["f8wkphi", "fwsfkhu"],
|
24
32
|
"B4j52fo": "f5ogflp",
|
25
33
|
"Bekrc4i": ["f1hqa2wf", "finvdd3"],
|
26
34
|
"Bn0qgzm": "f1f09k3d",
|
@@ -61,50 +69,56 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
61
69
|
"uwmqm3": ["fekwl8i", "fat0sn4"]
|
62
70
|
},
|
63
71
|
"smallArrow": {
|
64
|
-
"a9b677": "
|
65
|
-
"Bqenvij": "
|
72
|
+
"a9b677": "f1ekdpwm",
|
73
|
+
"Bqenvij": "f83vc9z"
|
66
74
|
},
|
67
75
|
"mediumLargeArrow": {
|
68
|
-
"a9b677": "
|
69
|
-
"Bqenvij": "
|
76
|
+
"a9b677": "f1kmc0fn",
|
77
|
+
"Bqenvij": "fb6lvc5"
|
70
78
|
},
|
71
79
|
"arrow": {
|
72
80
|
"qhf8xq": "f1euv43f",
|
73
|
-
"
|
81
|
+
"De3pzq": "f1u2r49w",
|
74
82
|
"Bcdw1i0": "fd7fpy0",
|
75
83
|
"Bj3rh1h": "f1bsuimh",
|
76
84
|
"rurcny": "fuzzvh5",
|
77
|
-
"
|
85
|
+
"Bex5imi": "fkk33zh",
|
78
86
|
"xx9plb": "fxf9f1y",
|
87
|
+
"Bmqnesq": "f170vdtw",
|
79
88
|
"Bdn98qo": "f103af6e",
|
80
89
|
"Bbc2r3f": "f15umuo5",
|
81
|
-
"
|
82
|
-
"
|
90
|
+
"B1dvbpk": "f3wpjpt",
|
91
|
+
"D4ky5z": "f1k3tce7",
|
92
|
+
"cqycoz": "f1dkdgqi",
|
93
|
+
"I89eb": "f5ghsz",
|
94
|
+
"k1i1uq": "fyqop9u",
|
95
|
+
"Epwjcz": "f1m5ya7j",
|
96
|
+
"Bp1vogq": "f3sp63x",
|
83
97
|
"px8gyy": ["f5bg3dr", "f1rfdd74"],
|
84
|
-
"h6z6rw":
|
85
|
-
"hl6cv3": "
|
98
|
+
"h6z6rw": "fzd2j21",
|
99
|
+
"hl6cv3": "f1773hnp",
|
86
100
|
"Bh2vraf": "f1n8855c",
|
87
|
-
"yayu3t":
|
101
|
+
"yayu3t": "f1v7783n",
|
88
102
|
"wedwtw": "fsw6im5",
|
89
|
-
"rhl9o9": "
|
103
|
+
"rhl9o9": "fh2hsk5",
|
90
104
|
"Bu8t5uz": "f159pzir",
|
91
|
-
"B6q6orb":
|
105
|
+
"B6q6orb": "f11yvu4",
|
92
106
|
"Bwwlvwl": "fm1ycve"
|
93
107
|
}
|
94
108
|
}, {
|
95
|
-
"d": [".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f1hg901r{box-shadow:var(--shadow16);}", ".
|
109
|
+
"d": [".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f1hg901r{box-shadow:var(--shadow16);}", ".fff7au0{border-bottom-right-radius:4px;}", ".f1bjk9e1{border-bottom-left-radius:4px;}", ".fwsfkhu{border-top-right-radius:4px;}", ".f8wkphi{border-top-left-radius:4px;}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f1c73kur{background-color:var(--colorNeutralForeground1);}", ".fqpbvvt{color:var(--colorNeutralForegroundInverted);}", ".ffp7eso{background-color:var(--colorBrandBackground);}", ".f1kcqot9{padding-top:12px;}", ".f11qrl6u{padding-right:12px;}", ".fjlbh76{padding-left:12px;}", ".fpe6lb7{padding-bottom:12px;}", ".fqag9an{padding-top:16px;}", ".f1gbmcue{padding-right:16px;}", ".f1rh9g5y{padding-left:16px;}", ".fp67ikv{padding-bottom:16px;}", ".fc7z3ec{padding-top:20px;}", ".fat0sn4{padding-right:20px;}", ".fekwl8i{padding-left:20px;}", ".fe2my4m{padding-bottom:20px;}", ".f1ekdpwm{width:8.484px;}", ".f83vc9z{height:8.484px;}", ".f1kmc0fn{width:11.312px;}", ".fb6lvc5{height:11.312px;}", ".f1euv43f{position:absolute;}", ".f1u2r49w{background-color:inherit;}", ".fd7fpy0{visibility:hidden;}", ".f1bsuimh{z-index:-1;}", ".fuzzvh5:before{content:\"\";}", ".fkk33zh:before{visibility:visible;}", ".fxf9f1y:before{position:absolute;}", ".f170vdtw:before{box-sizing:border-box;}", ".f103af6e:before{width:inherit;}", ".f15umuo5:before{height:inherit;}", ".f3wpjpt:before{background-color:inherit;}", ".f1k3tce7:before{border-right-width:1px;}", ".f1dkdgqi:before{border-right-style:solid;}", ".f5ghsz:before{border-right-color:var(--colorTransparentStroke);}", ".fyqop9u:before{border-bottom-width:1px;}", ".f1m5ya7j:before{border-bottom-style:solid;}", ".f3sp63x:before{border-bottom-color:var(--colorTransparentStroke);}", ".f5bg3dr:before{border-bottom-right-radius:var(--borderRadiusSmall);}", ".f1rfdd74:before{border-bottom-left-radius:var(--borderRadiusSmall);}", ".fzd2j21:before{-webkit-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-moz-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-ms-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);}", "[data-popper-placement^=\"top\"] .f1773hnp{bottom:-1px;}", "[data-popper-placement^=\"top\"] .f1n8855c{--angle:0;}", "[data-popper-placement^=\"right\"] .f1v7783n{left:-1px;}", "[data-popper-placement^=\"right\"] .fsw6im5{--angle:90deg;}", "[data-popper-placement^=\"bottom\"] .fh2hsk5{top:-1px;}", "[data-popper-placement^=\"bottom\"] .f159pzir{--angle:180deg;}", "[data-popper-placement^=\"left\"] .f11yvu4{right:-1px;}", "[data-popper-placement^=\"left\"] .fm1ycve{--angle:270deg;}"]
|
96
110
|
});
|
97
111
|
/**
|
98
112
|
* Apply styling to the PopoverSurface slots based on the state
|
99
113
|
*/
|
100
114
|
|
101
115
|
|
102
|
-
|
103
|
-
|
104
|
-
state.root.className =
|
105
|
-
state.arrowClassName =
|
116
|
+
const usePopoverSurfaceStyles_unstable = state => {
|
117
|
+
const styles = useStyles();
|
118
|
+
state.root.className = react_1.mergeClasses(exports.popoverSurfaceClassName, styles.root, state.size === 'small' && styles.smallPadding, state.size === 'medium' && styles.mediumPadding, state.size === 'large' && styles.largePadding, state.appearance === 'inverted' && styles.inverted, state.appearance === 'brand' && styles.brand, state.root.className);
|
119
|
+
state.arrowClassName = react_1.mergeClasses(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);
|
106
120
|
return state;
|
107
121
|
};
|
108
122
|
|
109
|
-
exports.
|
123
|
+
exports.usePopoverSurfaceStyles_unstable = usePopoverSurfaceStyles_unstable;
|
110
124
|
//# sourceMappingURL=usePopoverSurfaceStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PopoverSurface/usePopoverSurfaceStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,
|
1
|
+
{"version":3,"sources":["../../../src/components/PopoverSurface/usePopoverSurfaceStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAIa,OAAA,CAAA,uBAAA,GAA0B,oBAA1B;AAEA,OAAA,CAAA,YAAA,GAA4C;AACvD,EAAA,KAAK,EAAE,CADgD;AAEvD,EAAA,MAAM,EAAE,CAF+C;AAGvD,EAAA,KAAK,EAAE;AAHgD,CAA5C;AAMb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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B;AAKA,SAAO,KAAP;AACD,CAnBM;;AAAM,OAAA,CAAA,gCAAA,GAAgC,gCAAhC","sourceRoot":""}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
+
import type { FluentTriggerComponent } from '@fluentui/react-utilities';
|
2
3
|
import type { PopoverTriggerProps } from './PopoverTrigger.types';
|
3
4
|
/**
|
4
5
|
* Wraps a trigger element as an only child and adds the necessary event handling to open a popover.
|
5
6
|
*/
|
6
|
-
export declare const PopoverTrigger: React.FC<PopoverTriggerProps
|
7
|
+
export declare const PopoverTrigger: React.FC<PopoverTriggerProps> & FluentTriggerComponent;
|
@@ -5,19 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.PopoverTrigger = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const usePopoverTrigger_1 = /*#__PURE__*/require("./usePopoverTrigger");
|
9
9
|
|
10
|
-
|
10
|
+
const renderPopoverTrigger_1 = /*#__PURE__*/require("./renderPopoverTrigger");
|
11
11
|
/**
|
12
12
|
* Wraps a trigger element as an only child and adds the necessary event handling to open a popover.
|
13
13
|
*/
|
14
14
|
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
return renderPopoverTrigger_1.
|
16
|
+
const PopoverTrigger = props => {
|
17
|
+
const state = usePopoverTrigger_1.usePopoverTrigger_unstable(props);
|
18
|
+
return renderPopoverTrigger_1.renderPopoverTrigger_unstable(state);
|
19
19
|
};
|
20
20
|
|
21
21
|
exports.PopoverTrigger = PopoverTrigger;
|
22
22
|
exports.PopoverTrigger.displayName = 'PopoverTrigger';
|
23
|
+
exports.PopoverTrigger.isFluentTriggerComponent = true;
|
23
24
|
//# sourceMappingURL=PopoverTrigger.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PopoverTrigger/PopoverTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,
|
1
|
+
{"version":3,"sources":["../../../src/components/PopoverTrigger/PopoverTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAIA;;AAEG;;;AACI,MAAM,cAAc,GAA2D,KAAK,IAAG;AAC5F,QAAM,KAAK,GAAG,mBAAA,CAAA,0BAAA,CAA2B,KAA3B,CAAd;AAEA,SAAO,sBAAA,CAAA,6BAAA,CAA8B,KAA9B,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd;AAMb,OAAA,CAAA,cAAA,CAAe,WAAf,GAA6B,gBAA7B;AACA,OAAA,CAAA,cAAA,CAAe,wBAAf,GAA0C,IAA1C","sourceRoot":""}
|
@@ -3,9 +3,16 @@ import * as React from 'react';
|
|
3
3
|
* PopoverTrigger Props
|
4
4
|
*/
|
5
5
|
export declare type PopoverTriggerProps = {
|
6
|
-
children: React.ReactElement
|
6
|
+
children: (React.ReactElement & {
|
7
|
+
ref?: React.Ref<unknown>;
|
8
|
+
}) | ((props: PopoverTriggerChildProps) => React.ReactElement | null);
|
7
9
|
};
|
8
10
|
/**
|
9
11
|
* PopoverTrigger State
|
10
12
|
*/
|
11
|
-
export declare type PopoverTriggerState =
|
13
|
+
export declare type PopoverTriggerState = {
|
14
|
+
children: React.ReactElement | null;
|
15
|
+
};
|
16
|
+
export declare type PopoverTriggerChildProps = {
|
17
|
+
ref?: React.Ref<never>;
|
18
|
+
} & Pick<React.HTMLAttributes<HTMLElement>, 'aria-haspopup' | 'onClick' | 'onMouseEnter' | 'onKeyDown' | 'onMouseLeave' | 'onContextMenu'>;
|
@@ -2,4 +2,4 @@ import type { PopoverTriggerState } from './PopoverTrigger.types';
|
|
2
2
|
/**
|
3
3
|
* Render the final JSX of PopoverTrigger
|
4
4
|
*/
|
5
|
-
export declare const
|
5
|
+
export declare const renderPopoverTrigger_unstable: (state: PopoverTriggerState) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
@@ -3,14 +3,14 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.renderPopoverTrigger_unstable = void 0;
|
7
7
|
/**
|
8
8
|
* Render the final JSX of PopoverTrigger
|
9
9
|
*/
|
10
10
|
|
11
|
-
|
11
|
+
const renderPopoverTrigger_unstable = state => {
|
12
12
|
return state.children;
|
13
13
|
};
|
14
14
|
|
15
|
-
exports.
|
15
|
+
exports.renderPopoverTrigger_unstable = renderPopoverTrigger_unstable;
|
16
16
|
//# sourceMappingURL=renderPopoverTrigger.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PopoverTrigger/renderPopoverTrigger.tsx"],"names":[],"mappings":";;;;;;AAEA;;AAEG;;AACI,
|
1
|
+
{"version":3,"sources":["../../../src/components/PopoverTrigger/renderPopoverTrigger.tsx"],"names":[],"mappings":";;;;;;AAEA;;AAEG;;AACI,MAAM,6BAA6B,GAAI,KAAD,IAA+B;AAC1E,SAAO,KAAK,CAAC,QAAb;AACD,CAFM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourceRoot":""}
|
@@ -3,8 +3,8 @@ import type { PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger.
|
|
3
3
|
* Create the state required to render PopoverTrigger.
|
4
4
|
*
|
5
5
|
* The returned state can be modified with hooks such as usePopoverTriggerStyles,
|
6
|
-
* before being passed to
|
6
|
+
* before being passed to renderPopoverTrigger_unstable.
|
7
7
|
*
|
8
8
|
* @param props - props from this instance of PopoverTrigger
|
9
9
|
*/
|
10
|
-
export declare const
|
10
|
+
export declare const usePopoverTrigger_unstable: (props: PopoverTriggerProps) => PopoverTriggerState;
|
@@ -3,65 +3,57 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.usePopoverTrigger_unstable = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
-
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
11
|
|
12
|
-
|
12
|
+
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
var popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
|
14
|
+
const popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
|
17
15
|
/**
|
18
16
|
* Create the state required to render PopoverTrigger.
|
19
17
|
*
|
20
18
|
* The returned state can be modified with hooks such as usePopoverTriggerStyles,
|
21
|
-
* before being passed to
|
19
|
+
* before being passed to renderPopoverTrigger_unstable.
|
22
20
|
*
|
23
21
|
* @param props - props from this instance of PopoverTrigger
|
24
22
|
*/
|
25
23
|
|
26
24
|
|
27
|
-
|
28
|
-
var
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
});
|
43
|
-
|
44
|
-
|
45
|
-
var _a, _b;
|
46
|
-
|
25
|
+
const usePopoverTrigger_unstable = props => {
|
26
|
+
var _a, _b, _c, _d, _e;
|
27
|
+
|
28
|
+
const {
|
29
|
+
children
|
30
|
+
} = props;
|
31
|
+
const child = React.isValidElement(children) ? react_utilities_1.getTriggerChild(children) : undefined;
|
32
|
+
const setOpen = popoverContext_1.usePopoverContext_unstable(context => context.setOpen);
|
33
|
+
const open = popoverContext_1.usePopoverContext_unstable(context => context.open);
|
34
|
+
const triggerRef = popoverContext_1.usePopoverContext_unstable(context => context.triggerRef);
|
35
|
+
const openOnHover = popoverContext_1.usePopoverContext_unstable(context => context.openOnHover);
|
36
|
+
const openOnContext = popoverContext_1.usePopoverContext_unstable(context => context.openOnContext);
|
37
|
+
const trapFocus = popoverContext_1.usePopoverContext_unstable(context => context.trapFocus);
|
38
|
+
const {
|
39
|
+
triggerAttributes
|
40
|
+
} = react_tabster_1.useModalAttributes();
|
41
|
+
|
42
|
+
const onContextMenu = e => {
|
47
43
|
if (openOnContext) {
|
48
44
|
e.preventDefault();
|
49
45
|
setOpen(e, true);
|
50
46
|
}
|
47
|
+
};
|
51
48
|
|
52
|
-
|
53
|
-
});
|
54
|
-
var onClick = react_utilities_1.useEventCallback(function (e) {
|
55
|
-
var _a, _b;
|
56
|
-
|
49
|
+
const onClick = e => {
|
57
50
|
if (!openOnContext) {
|
58
51
|
setOpen(e, !open);
|
59
52
|
}
|
53
|
+
};
|
60
54
|
|
61
|
-
|
62
|
-
|
63
|
-
var onKeyDown = react_utilities_1.useEventCallback(function (e) {
|
64
|
-
var _a, _b, _c;
|
55
|
+
const onKeyDown = e => {
|
56
|
+
var _a;
|
65
57
|
|
66
58
|
if (react_utilities_1.shouldPreventDefaultOnKeyDown(e) && (e.key === ' ' || e.key === 'Enter')) {
|
67
59
|
e.preventDefault();
|
@@ -71,41 +63,33 @@ var usePopoverTrigger = function (props) {
|
|
71
63
|
if (e.key === 'Escape') {
|
72
64
|
setOpen(e, false);
|
73
65
|
}
|
66
|
+
};
|
74
67
|
|
75
|
-
|
76
|
-
});
|
77
|
-
var onMouseEnter = react_utilities_1.useEventCallback(function (e) {
|
78
|
-
var _a, _b;
|
79
|
-
|
68
|
+
const onMouseEnter = react_utilities_1.useEventCallback(e => {
|
80
69
|
if (openOnHover) {
|
81
70
|
setOpen(e, true);
|
82
71
|
}
|
83
|
-
|
84
|
-
(_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onMouseEnter) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
85
72
|
});
|
86
|
-
var onMouseLeave = react_utilities_1.useEventCallback(function (e) {
|
87
|
-
var _a, _b;
|
88
73
|
|
74
|
+
const onMouseLeave = e => {
|
89
75
|
if (openOnHover) {
|
90
76
|
setOpen(e, false);
|
91
77
|
}
|
78
|
+
};
|
92
79
|
|
93
|
-
(_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onMouseLeave) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
94
|
-
});
|
95
|
-
var child = React.Children.only(props.children);
|
96
80
|
return {
|
97
|
-
children:
|
98
|
-
'aria-haspopup': 'true'
|
99
|
-
|
100
|
-
onClick: onClick,
|
101
|
-
onMouseEnter: onMouseEnter,
|
102
|
-
onKeyDown: onKeyDown,
|
103
|
-
onMouseLeave: onMouseLeave,
|
104
|
-
onContextMenu: onContextMenu,
|
105
|
-
ref: react_utilities_1.useMergedRefs(child.ref
|
106
|
-
})
|
81
|
+
children: react_utilities_1.applyTriggerPropsToChildren(props.children, { ...triggerAttributes,
|
82
|
+
'aria-haspopup': trapFocus ? 'dialog' : 'true',
|
83
|
+
...(child === null || child === void 0 ? void 0 : child.props),
|
84
|
+
onClick: react_utilities_1.useMergedEventCallbacks((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onClick, onClick),
|
85
|
+
onMouseEnter: react_utilities_1.useMergedEventCallbacks((_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.onMouseEnter, onMouseEnter),
|
86
|
+
onKeyDown: react_utilities_1.useMergedEventCallbacks((_c = child === null || child === void 0 ? void 0 : child.props) === null || _c === void 0 ? void 0 : _c.onKeyDown, onKeyDown),
|
87
|
+
onMouseLeave: react_utilities_1.useMergedEventCallbacks((_d = child === null || child === void 0 ? void 0 : child.props) === null || _d === void 0 ? void 0 : _d.onMouseLeave, onMouseLeave),
|
88
|
+
onContextMenu: react_utilities_1.useMergedEventCallbacks((_e = child === null || child === void 0 ? void 0 : child.props) === null || _e === void 0 ? void 0 : _e.onContextMenu, onContextMenu),
|
89
|
+
ref: react_utilities_1.useMergedRefs(triggerRef, child === null || child === void 0 ? void 0 : child.ref)
|
90
|
+
})
|
107
91
|
};
|
108
92
|
};
|
109
93
|
|
110
|
-
exports.
|
94
|
+
exports.usePopoverTrigger_unstable = usePopoverTrigger_unstable;
|
111
95
|
//# sourceMappingURL=usePopoverTrigger.js.map
|