@fluentui/react-popover 9.0.0-rc.6 → 9.0.0-rc.9
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +176 -9
- package/CHANGELOG.md +129 -83
- package/Spec.md +20 -0
- package/dist/{react-popover.d.ts → index.d.ts} +14 -2
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/components/Popover/Popover.types.js.map +1 -1
- package/lib/components/Popover/renderPopover.js +4 -2
- package/lib/components/Popover/renderPopover.js.map +1 -1
- package/lib/components/Popover/usePopover.js +38 -5
- package/lib/components/Popover/usePopover.js.map +1 -1
- package/lib/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
- package/lib/components/PopoverSurface/renderPopoverSurface.js +10 -4
- package/lib/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurface.js +2 -0
- package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib/index.js +5 -4
- package/lib/index.js.map +1 -1
- package/lib/popoverContext.js +2 -1
- package/lib/popoverContext.js.map +1 -1
- package/lib-commonjs/components/Popover/renderPopover.js +4 -2
- package/lib-commonjs/components/Popover/renderPopover.js.map +1 -1
- package/lib-commonjs/components/Popover/usePopover.js +38 -5
- package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js +10 -4
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js +2 -0
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib-commonjs/index.js +99 -5
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/popoverContext.js +2 -1
- package/lib-commonjs/popoverContext.js.map +1 -1
- package/package.json +12 -12
- package/lib/Popover.d.ts +0 -1
- package/lib/PopoverSurface.d.ts +0 -1
- package/lib/PopoverTrigger.d.ts +0 -1
- package/lib/components/Popover/Popover.d.ts +0 -6
- package/lib/components/Popover/Popover.types.d.ts +0 -109
- package/lib/components/Popover/index.d.ts +0 -4
- package/lib/components/Popover/renderPopover.d.ts +0 -5
- package/lib/components/Popover/usePopover.d.ts +0 -10
- package/lib/components/PopoverSurface/PopoverSurface.d.ts +0 -6
- package/lib/components/PopoverSurface/PopoverSurface.types.d.ts +0 -21
- package/lib/components/PopoverSurface/index.d.ts +0 -5
- package/lib/components/PopoverSurface/renderPopoverSurface.d.ts +0 -5
- package/lib/components/PopoverSurface/usePopoverSurface.d.ts +0 -12
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +0 -13
- package/lib/components/PopoverTrigger/PopoverTrigger.d.ts +0 -7
- package/lib/components/PopoverTrigger/PopoverTrigger.types.d.ts +0 -18
- package/lib/components/PopoverTrigger/index.d.ts +0 -4
- package/lib/components/PopoverTrigger/renderPopoverTrigger.d.ts +0 -5
- package/lib/components/PopoverTrigger/usePopoverTrigger.d.ts +0 -10
- package/lib/index.d.ts +0 -4
- package/lib/popoverContext.d.ts +0 -8
- package/lib-commonjs/Popover.d.ts +0 -1
- package/lib-commonjs/PopoverSurface.d.ts +0 -1
- package/lib-commonjs/PopoverTrigger.d.ts +0 -1
- package/lib-commonjs/components/Popover/Popover.d.ts +0 -6
- package/lib-commonjs/components/Popover/Popover.types.d.ts +0 -109
- package/lib-commonjs/components/Popover/index.d.ts +0 -4
- package/lib-commonjs/components/Popover/renderPopover.d.ts +0 -5
- package/lib-commonjs/components/Popover/usePopover.d.ts +0 -10
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.d.ts +0 -6
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.d.ts +0 -21
- package/lib-commonjs/components/PopoverSurface/index.d.ts +0 -5
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.d.ts +0 -5
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.d.ts +0 -12
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +0 -13
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.d.ts +0 -7
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.d.ts +0 -18
- package/lib-commonjs/components/PopoverTrigger/index.d.ts +0 -4
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.d.ts +0 -5
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.d.ts +0 -10
- package/lib-commonjs/index.d.ts +0 -4
- package/lib-commonjs/popoverContext.d.ts +0 -8
@@ -31,12 +31,14 @@ const usePopoverSurface_unstable = (props, ref) => {
|
|
31
31
|
const noArrow = popoverContext_1.usePopoverContext_unstable(context => context.noArrow);
|
32
32
|
const appearance = popoverContext_1.usePopoverContext_unstable(context => context.appearance);
|
33
33
|
const trapFocus = popoverContext_1.usePopoverContext_unstable(context => context.trapFocus);
|
34
|
+
const inline = popoverContext_1.usePopoverContext_unstable(context => context.inline);
|
34
35
|
const {
|
35
36
|
modalAttributes
|
36
37
|
} = react_tabster_1.useModalAttributes({
|
37
38
|
trapFocus
|
38
39
|
});
|
39
40
|
const state = {
|
41
|
+
inline,
|
40
42
|
appearance,
|
41
43
|
noArrow,
|
42
44
|
size,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/PopoverSurface/usePopoverSurface.ts"],"names":[],"mappings":";;;;;;;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,WAAW,GAAG,gBAAA,CAAA,0BAAA,CAA2B,OAAO,IAAI,OAAO,CAAC,WAA9C,CAApB;AACA,QAAM,OAAO,GAAG,gBAA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,SAAO,KAAP;AACD,CAnEM;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B","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 noArrow = usePopoverContext_unstable(context => context.noArrow);\n const appearance = usePopoverContext_unstable(context => context.appearance);\n const trapFocus = usePopoverContext_unstable(context => context.trapFocus);\n const inline = usePopoverContext_unstable(context => context.inline);\n const { modalAttributes } = useModalAttributes({ trapFocus });\n\n const state: PopoverSurfaceState = {\n inline,\n appearance,\n noArrow,\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' : 'complementary',\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"],"sourceRoot":"../src/"}
|
package/lib-commonjs/index.js
CHANGED
@@ -3,14 +3,108 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
+
exports.usePopoverTrigger_unstable = exports.renderPopoverTrigger_unstable = exports.PopoverTrigger = exports.usePopoverContext_unstable = exports.PopoverContext = exports.usePopoverSurface_unstable = exports.usePopoverSurfaceStyles_unstable = exports.renderPopoverSurface_unstable = exports.popoverSurfaceClassNames = exports.popoverSurfaceClassName = exports.arrowHeights = exports.PopoverSurface = exports.usePopover_unstable = exports.renderPopover_unstable = exports.Popover = void 0;
|
6
7
|
|
7
|
-
|
8
|
+
var Popover_1 = /*#__PURE__*/require("./Popover");
|
8
9
|
|
9
|
-
|
10
|
+
Object.defineProperty(exports, "Popover", {
|
11
|
+
enumerable: true,
|
12
|
+
get: function () {
|
13
|
+
return Popover_1.Popover;
|
14
|
+
}
|
15
|
+
});
|
16
|
+
Object.defineProperty(exports, "renderPopover_unstable", {
|
17
|
+
enumerable: true,
|
18
|
+
get: function () {
|
19
|
+
return Popover_1.renderPopover_unstable;
|
20
|
+
}
|
21
|
+
});
|
22
|
+
Object.defineProperty(exports, "usePopover_unstable", {
|
23
|
+
enumerable: true,
|
24
|
+
get: function () {
|
25
|
+
return Popover_1.usePopover_unstable;
|
26
|
+
}
|
27
|
+
});
|
28
|
+
|
29
|
+
var PopoverSurface_1 = /*#__PURE__*/require("./PopoverSurface");
|
30
|
+
|
31
|
+
Object.defineProperty(exports, "PopoverSurface", {
|
32
|
+
enumerable: true,
|
33
|
+
get: function () {
|
34
|
+
return PopoverSurface_1.PopoverSurface;
|
35
|
+
}
|
36
|
+
});
|
37
|
+
Object.defineProperty(exports, "arrowHeights", {
|
38
|
+
enumerable: true,
|
39
|
+
get: function () {
|
40
|
+
return PopoverSurface_1.arrowHeights;
|
41
|
+
}
|
42
|
+
}); // eslint-disable-next-line deprecation/deprecation
|
43
|
+
|
44
|
+
Object.defineProperty(exports, "popoverSurfaceClassName", {
|
45
|
+
enumerable: true,
|
46
|
+
get: function () {
|
47
|
+
return PopoverSurface_1.popoverSurfaceClassName;
|
48
|
+
}
|
49
|
+
});
|
50
|
+
Object.defineProperty(exports, "popoverSurfaceClassNames", {
|
51
|
+
enumerable: true,
|
52
|
+
get: function () {
|
53
|
+
return PopoverSurface_1.popoverSurfaceClassNames;
|
54
|
+
}
|
55
|
+
});
|
56
|
+
Object.defineProperty(exports, "renderPopoverSurface_unstable", {
|
57
|
+
enumerable: true,
|
58
|
+
get: function () {
|
59
|
+
return PopoverSurface_1.renderPopoverSurface_unstable;
|
60
|
+
}
|
61
|
+
});
|
62
|
+
Object.defineProperty(exports, "usePopoverSurfaceStyles_unstable", {
|
63
|
+
enumerable: true,
|
64
|
+
get: function () {
|
65
|
+
return PopoverSurface_1.usePopoverSurfaceStyles_unstable;
|
66
|
+
}
|
67
|
+
});
|
68
|
+
Object.defineProperty(exports, "usePopoverSurface_unstable", {
|
69
|
+
enumerable: true,
|
70
|
+
get: function () {
|
71
|
+
return PopoverSurface_1.usePopoverSurface_unstable;
|
72
|
+
}
|
73
|
+
});
|
10
74
|
|
11
|
-
|
75
|
+
var popoverContext_1 = /*#__PURE__*/require("./popoverContext");
|
12
76
|
|
13
|
-
|
77
|
+
Object.defineProperty(exports, "PopoverContext", {
|
78
|
+
enumerable: true,
|
79
|
+
get: function () {
|
80
|
+
return popoverContext_1.PopoverContext;
|
81
|
+
}
|
82
|
+
});
|
83
|
+
Object.defineProperty(exports, "usePopoverContext_unstable", {
|
84
|
+
enumerable: true,
|
85
|
+
get: function () {
|
86
|
+
return popoverContext_1.usePopoverContext_unstable;
|
87
|
+
}
|
88
|
+
});
|
14
89
|
|
15
|
-
|
90
|
+
var PopoverTrigger_1 = /*#__PURE__*/require("./PopoverTrigger");
|
91
|
+
|
92
|
+
Object.defineProperty(exports, "PopoverTrigger", {
|
93
|
+
enumerable: true,
|
94
|
+
get: function () {
|
95
|
+
return PopoverTrigger_1.PopoverTrigger;
|
96
|
+
}
|
97
|
+
});
|
98
|
+
Object.defineProperty(exports, "renderPopoverTrigger_unstable", {
|
99
|
+
enumerable: true,
|
100
|
+
get: function () {
|
101
|
+
return PopoverTrigger_1.renderPopoverTrigger_unstable;
|
102
|
+
}
|
103
|
+
});
|
104
|
+
Object.defineProperty(exports, "usePopoverTrigger_unstable", {
|
105
|
+
enumerable: true,
|
106
|
+
get: function () {
|
107
|
+
return PopoverTrigger_1.usePopoverTrigger_unstable;
|
108
|
+
}
|
109
|
+
});
|
16
110
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,SAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,SAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,SAAA,CAAA,OAAA;AAAO;AAAP,CAAA;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,wBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,SAAA,CAAA,sBAAA;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gC;AAAhC,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,4BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,gBAAA,CAAA,0BAAA;AAA0B;AAA1B,CAAA;;AAGF,IAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,gBAAA,CAAA,cAAA;AAAc;AAAd,CAAA;AAAgB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,4BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,gBAAA,CAAA,0BAAA;AAA0B;AAA1B,CAAA;;AAEzB,IAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,gBAAA,CAAA,cAAA;AAAc;AAAd,CAAA;AAAgB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,+BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,gBAAA,CAAA,6BAAA;AAA6B;AAA7B,CAAA;AAA+B,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,4BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,gBAAA,CAAA,0BAAA;AAA0B;AAA1B,CAAA","sourcesContent":["export { Popover, renderPopover_unstable, usePopover_unstable } from './Popover';\nexport type { OnOpenChangeData, OpenPopoverEvents, PopoverProps, PopoverSize, PopoverState } from './Popover';\nexport {\n PopoverSurface,\n arrowHeights,\n // eslint-disable-next-line deprecation/deprecation\n popoverSurfaceClassName,\n popoverSurfaceClassNames,\n renderPopoverSurface_unstable,\n usePopoverSurfaceStyles_unstable,\n usePopoverSurface_unstable,\n} from './PopoverSurface';\nexport type { PopoverSurfaceProps, PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface';\nexport { PopoverContext, usePopoverContext_unstable } from './popoverContext';\nexport type { PopoverContextValue } from './popoverContext';\nexport { PopoverTrigger, renderPopoverTrigger_unstable, usePopoverTrigger_unstable } from './PopoverTrigger';\nexport type { PopoverTriggerChildProps, PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger';\n"],"sourceRoot":"../src/"}
|
@@ -22,7 +22,8 @@ exports.PopoverContext = /*#__PURE__*/react_context_selector_1.createContext({
|
|
22
22
|
openOnContext: false,
|
23
23
|
openOnHover: false,
|
24
24
|
size: 'medium',
|
25
|
-
trapFocus: false
|
25
|
+
trapFocus: false,
|
26
|
+
inline: false
|
26
27
|
});
|
27
28
|
|
28
29
|
const usePopoverContext_unstable = selector => react_context_selector_1.useContextSelector(exports.PopoverContext, selector);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["popoverContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;;AAIa,OAAA,CAAA,cAAA,gBAA+C,wBAAA,CAAA,aAAA,CAAmC;AAC7F,EAAA,OAAO,EAAE,MAAM,IAD8E;AAE7F,EAAA,UAAU,EAAE,MAAM,IAF2E;AAG7F,EAAA,UAAU,EAAE;AAAE,IAAA,OAAO,EAAE;AAAX,GAHiF;AAI7F,EAAA,UAAU,EAAE;AAAE,IAAA,OAAO,EAAE;AAAX,GAJiF;AAK7F,EAAA,QAAQ,EAAE;AAAE,IAAA,OAAO,EAAE;AAAX,GALmF;AAM7F,EAAA,aAAa,EAAE,KAN8E;AAO7F,EAAA,WAAW,EAAE,KAPgF;AAQ7F,EAAA,IAAI,EAAE,QARuF;AAS7F,EAAA,SAAS,EAAE;
|
1
|
+
{"version":3,"sources":["popoverContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;;AAIa,OAAA,CAAA,cAAA,gBAA+C,wBAAA,CAAA,aAAA,CAAmC;AAC7F,EAAA,OAAO,EAAE,MAAM,IAD8E;AAE7F,EAAA,UAAU,EAAE,MAAM,IAF2E;AAG7F,EAAA,UAAU,EAAE;AAAE,IAAA,OAAO,EAAE;AAAX,GAHiF;AAI7F,EAAA,UAAU,EAAE;AAAE,IAAA,OAAO,EAAE;AAAX,GAJiF;AAK7F,EAAA,QAAQ,EAAE;AAAE,IAAA,OAAO,EAAE;AAAX,GALmF;AAM7F,EAAA,aAAa,EAAE,KAN8E;AAO7F,EAAA,WAAW,EAAE,KAPgF;AAQ7F,EAAA,IAAI,EAAE,QARuF;AAS7F,EAAA,SAAS,EAAE,KATkF;AAU7F,EAAA,MAAM,EAAE;AAVqF,CAAnC,CAA/C;;AAiCN,MAAM,0BAA0B,GAAO,QAAJ,IACxC,wBAAA,CAAA,kBAAA,CAAmB,OAAA,CAAA,cAAnB,EAAmC,QAAnC,CADK;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B","sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector, Context } from '@fluentui/react-context-selector';\nimport type { PopoverState } from './components/Popover/index';\n\nexport const PopoverContext: Context<PopoverContextValue> = createContext<PopoverContextValue>({\n setOpen: () => null,\n toggleOpen: () => null,\n triggerRef: { current: null },\n contentRef: { current: null },\n arrowRef: { current: null },\n openOnContext: false,\n openOnHover: false,\n size: 'medium',\n trapFocus: false,\n inline: false,\n});\n\n/**\n * Context shared between Popover and its children components\n */\nexport type PopoverContextValue = Pick<\n PopoverState,\n | 'toggleOpen'\n | 'setOpen'\n | 'triggerRef'\n | 'contentRef'\n | 'openOnHover'\n | 'openOnContext'\n | 'mountNode'\n | 'noArrow'\n | 'arrowRef'\n | 'size'\n | 'appearance'\n | 'trapFocus'\n | 'inline'\n>;\n\nexport const usePopoverContext_unstable = <T>(selector: ContextSelector<PopoverContextValue, T>): T =>\n useContextSelector(PopoverContext, selector);\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-popover",
|
3
|
-
"version": "9.0.0-rc.
|
3
|
+
"version": "9.0.0-rc.9",
|
4
4
|
"description": "Popover component for Fluent UI",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
7
|
-
"typings": "
|
7
|
+
"typings": "dist/index.d.ts",
|
8
8
|
"sideEffects": false,
|
9
9
|
"repository": {
|
10
10
|
"type": "git",
|
@@ -20,27 +20,27 @@
|
|
20
20
|
"lint": "just-scripts lint",
|
21
21
|
"start": "yarn storybook",
|
22
22
|
"e2e": "e2e",
|
23
|
-
"storybook": "node
|
23
|
+
"storybook": "node ../../../scripts/storybook/runner",
|
24
24
|
"test": "jest --passWithNoTests",
|
25
25
|
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
26
|
-
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node
|
26
|
+
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/packages/react-components/react-popover/src && yarn docs",
|
27
27
|
"type-check": "tsc -b tsconfig.json"
|
28
28
|
},
|
29
29
|
"devDependencies": {
|
30
30
|
"@fluentui/eslint-plugin": "*",
|
31
31
|
"@fluentui/react-conformance": "*",
|
32
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
32
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.5",
|
33
33
|
"@fluentui/scripts": "^1.0.0"
|
34
34
|
},
|
35
35
|
"dependencies": {
|
36
|
-
"@fluentui/react-context-selector": "9.0.0-rc.
|
36
|
+
"@fluentui/react-context-selector": "9.0.0-rc.8",
|
37
37
|
"@griffel/react": "1.0.3",
|
38
|
-
"@fluentui/react-portal": "9.0.0-rc.
|
39
|
-
"@fluentui/react-positioning": "9.0.0-rc.
|
40
|
-
"@fluentui/react-shared-contexts": "9.0.0-rc.
|
41
|
-
"@fluentui/react-tabster": "9.0.0-rc.
|
42
|
-
"@fluentui/react-theme": "9.0.0-rc.
|
43
|
-
"@fluentui/react-utilities": "9.0.0-rc.
|
38
|
+
"@fluentui/react-portal": "9.0.0-rc.9",
|
39
|
+
"@fluentui/react-positioning": "9.0.0-rc.8",
|
40
|
+
"@fluentui/react-shared-contexts": "9.0.0-rc.7",
|
41
|
+
"@fluentui/react-tabster": "9.0.0-rc.9",
|
42
|
+
"@fluentui/react-theme": "9.0.0-rc.7",
|
43
|
+
"@fluentui/react-utilities": "9.0.0-rc.8",
|
44
44
|
"tslib": "^2.1.0"
|
45
45
|
},
|
46
46
|
"peerDependencies": {
|
package/lib/Popover.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/Popover/index';
|
package/lib/PopoverSurface.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/PopoverSurface/index';
|
package/lib/PopoverTrigger.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/PopoverTrigger/index';
|
@@ -1,109 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { PopperVirtualElement, PositioningShorthand, usePopperMouseTarget } from '@fluentui/react-positioning';
|
3
|
-
import type { PortalProps } from '@fluentui/react-portal';
|
4
|
-
/**
|
5
|
-
* Determines popover padding and arrow size
|
6
|
-
*/
|
7
|
-
export declare type PopoverSize = 'small' | 'medium' | 'large';
|
8
|
-
declare type PopoverCommons = Pick<PortalProps, 'mountNode'> & {
|
9
|
-
/**
|
10
|
-
* Controls the opening of the Popover
|
11
|
-
*/
|
12
|
-
open: boolean;
|
13
|
-
/**
|
14
|
-
* Used to set the initial open state of the Popover in uncontrolled mode
|
15
|
-
*/
|
16
|
-
defaultOpen?: boolean;
|
17
|
-
/**
|
18
|
-
* Call back when the component requests to change value
|
19
|
-
* The `open` value is used as a hint when directly controlling the component
|
20
|
-
*/
|
21
|
-
onOpenChange?: (e: OpenPopoverEvents, data: OnOpenChangeData) => void;
|
22
|
-
/**
|
23
|
-
* Flag to open the Popover by hovering the trigger
|
24
|
-
*/
|
25
|
-
openOnHover?: boolean;
|
26
|
-
/**
|
27
|
-
* Flag to open the Popover as a context menu. Disables all other interactions
|
28
|
-
*/
|
29
|
-
openOnContext?: boolean;
|
30
|
-
/**
|
31
|
-
* Do not display the arrow
|
32
|
-
*/
|
33
|
-
noArrow?: boolean;
|
34
|
-
/**
|
35
|
-
* Determines popover padding and arrow size
|
36
|
-
* @default medium
|
37
|
-
*/
|
38
|
-
size?: PopoverSize;
|
39
|
-
/**
|
40
|
-
* A popover can appear styled with brand or inverted.
|
41
|
-
* When not specified, the default style is used.
|
42
|
-
*/
|
43
|
-
appearance?: 'brand' | 'inverted';
|
44
|
-
/**
|
45
|
-
* Should trap focus
|
46
|
-
*/
|
47
|
-
trapFocus?: boolean;
|
48
|
-
/**
|
49
|
-
* Configures the position of the Popover
|
50
|
-
*/
|
51
|
-
positioning?: PositioningShorthand;
|
52
|
-
};
|
53
|
-
/**
|
54
|
-
* Popover Props
|
55
|
-
*/
|
56
|
-
export declare type PopoverProps = Partial<PopoverCommons> & {
|
57
|
-
/**
|
58
|
-
* Can contain two children including {@link PopoverTrigger} and {@link PopoverSurface}.
|
59
|
-
* Alternatively can only contain {@link PopoverSurface} if using a custom `target`.
|
60
|
-
*/
|
61
|
-
children: [JSX.Element, JSX.Element] | JSX.Element;
|
62
|
-
};
|
63
|
-
/**
|
64
|
-
* Popover State
|
65
|
-
*/
|
66
|
-
export declare type PopoverState = PopoverCommons & Pick<PopoverProps, 'children'> & {
|
67
|
-
/**
|
68
|
-
* Callback to open/close the Popover
|
69
|
-
*/
|
70
|
-
setOpen: (e: OpenPopoverEvents, open: boolean) => void;
|
71
|
-
/**
|
72
|
-
* Callback to toggle the open state of the Popover
|
73
|
-
*/
|
74
|
-
toggleOpen: (e: OpenPopoverEvents) => void;
|
75
|
-
/**
|
76
|
-
* Ref of the PopoverTrigger
|
77
|
-
*/
|
78
|
-
triggerRef: React.MutableRefObject<HTMLElement | null>;
|
79
|
-
/**
|
80
|
-
* Ref of the PopoverSurface
|
81
|
-
*/
|
82
|
-
contentRef: React.MutableRefObject<HTMLElement | null>;
|
83
|
-
/**
|
84
|
-
* Ref of the pointing arrow
|
85
|
-
*/
|
86
|
-
arrowRef: React.MutableRefObject<HTMLDivElement | null>;
|
87
|
-
/**
|
88
|
-
* Anchors the popper to the mouse click for context events
|
89
|
-
*/
|
90
|
-
contextTarget: PopperVirtualElement | undefined;
|
91
|
-
/**
|
92
|
-
* A callback to set the target of the popper to the mouse click for context events
|
93
|
-
*/
|
94
|
-
setContextTarget: ReturnType<typeof usePopperMouseTarget>[1];
|
95
|
-
size: NonNullable<PopoverProps['size']>;
|
96
|
-
popoverTrigger: React.ReactElement | undefined;
|
97
|
-
popoverSurface: React.ReactElement | undefined;
|
98
|
-
};
|
99
|
-
/**
|
100
|
-
* Data attached to open/close events
|
101
|
-
*/
|
102
|
-
export declare type OnOpenChangeData = {
|
103
|
-
open: boolean;
|
104
|
-
};
|
105
|
-
/**
|
106
|
-
* The supported events that will trigger open/close of the menu
|
107
|
-
*/
|
108
|
-
export declare type OpenPopoverEvents = MouseEvent | TouchEvent | React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement> | React.FocusEvent<HTMLElement>;
|
109
|
-
export {};
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { PopoverProps, PopoverState } from './Popover.types';
|
2
|
-
/**
|
3
|
-
* Create the state required to render Popover.
|
4
|
-
*
|
5
|
-
* The returned state can be modified with hooks such as usePopoverStyles,
|
6
|
-
* before being passed to renderPopover_unstable.
|
7
|
-
*
|
8
|
-
* @param props - props from this instance of Popover
|
9
|
-
*/
|
10
|
-
export declare const usePopover_unstable: (props: PopoverProps) => PopoverState;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { PopoverSurfaceProps } from './PopoverSurface.types';
|
2
|
-
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* PopoverSurface component renders react children in a positioned box
|
5
|
-
*/
|
6
|
-
export declare const PopoverSurface: ForwardRefComponent<PopoverSurfaceProps>;
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
|
-
import type { PopoverContextValue } from '../../popoverContext';
|
3
|
-
/**
|
4
|
-
* PopoverSurface Props
|
5
|
-
*/
|
6
|
-
export declare type PopoverSurfaceProps = ComponentProps<PopoverSurfaceSlots>;
|
7
|
-
/**
|
8
|
-
* Names of the slots in PopoverSurfaceProps
|
9
|
-
*/
|
10
|
-
export declare type PopoverSurfaceSlots = {
|
11
|
-
root: Slot<'div'>;
|
12
|
-
};
|
13
|
-
/**
|
14
|
-
* PopoverSurface State
|
15
|
-
*/
|
16
|
-
export declare type PopoverSurfaceState = ComponentState<PopoverSurfaceSlots> & Pick<PopoverContextValue, 'mountNode' | 'noArrow' | 'size' | 'appearance' | 'arrowRef'> & {
|
17
|
-
/**
|
18
|
-
* CSS class for the arrow element
|
19
|
-
*/
|
20
|
-
arrowClassName?: string;
|
21
|
-
};
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { PopoverSurfaceProps, PopoverSurfaceState } from './PopoverSurface.types';
|
3
|
-
/**
|
4
|
-
* Create the state required to render PopoverSurface.
|
5
|
-
*
|
6
|
-
* The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,
|
7
|
-
* before being passed to renderPopoverSurface_unstable.
|
8
|
-
*
|
9
|
-
* @param props - props from this instance of PopoverSurface
|
10
|
-
* @param ref - reference to root HTMLDivElement of PopoverSurface
|
11
|
-
*/
|
12
|
-
export declare const usePopoverSurface_unstable: (props: PopoverSurfaceProps, ref: React.Ref<HTMLDivElement>) => PopoverSurfaceState;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import type { PopoverSize } from '../Popover/Popover.types';
|
2
|
-
import type { PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface.types';
|
3
|
-
import type { SlotClassNames } from '@fluentui/react-utilities';
|
4
|
-
/**
|
5
|
-
* @deprecated Use `popoverSurfaceClassNames.root` instead.
|
6
|
-
*/
|
7
|
-
export declare const popoverSurfaceClassName = "fui-PopoverSurface";
|
8
|
-
export declare const popoverSurfaceClassNames: SlotClassNames<PopoverSurfaceSlots>;
|
9
|
-
export declare const arrowHeights: Record<PopoverSize, number>;
|
10
|
-
/**
|
11
|
-
* Apply styling to the PopoverSurface slots based on the state
|
12
|
-
*/
|
13
|
-
export declare const usePopoverSurfaceStyles_unstable: (state: PopoverSurfaceState) => PopoverSurfaceState;
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { FluentTriggerComponent } from '@fluentui/react-utilities';
|
3
|
-
import type { PopoverTriggerProps } from './PopoverTrigger.types';
|
4
|
-
/**
|
5
|
-
* Wraps a trigger element as an only child and adds the necessary event handling to open a popover.
|
6
|
-
*/
|
7
|
-
export declare const PopoverTrigger: React.FC<PopoverTriggerProps> & FluentTriggerComponent;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
/**
|
3
|
-
* PopoverTrigger Props
|
4
|
-
*/
|
5
|
-
export declare type PopoverTriggerProps = {
|
6
|
-
children: (React.ReactElement & {
|
7
|
-
ref?: React.Ref<unknown>;
|
8
|
-
}) | ((props: PopoverTriggerChildProps) => React.ReactElement | null);
|
9
|
-
};
|
10
|
-
/**
|
11
|
-
* PopoverTrigger State
|
12
|
-
*/
|
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'>;
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import type { PopoverTriggerState } from './PopoverTrigger.types';
|
2
|
-
/**
|
3
|
-
* Render the final JSX of PopoverTrigger
|
4
|
-
*/
|
5
|
-
export declare const renderPopoverTrigger_unstable: (state: PopoverTriggerState) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger.types';
|
2
|
-
/**
|
3
|
-
* Create the state required to render PopoverTrigger.
|
4
|
-
*
|
5
|
-
* The returned state can be modified with hooks such as usePopoverTriggerStyles,
|
6
|
-
* before being passed to renderPopoverTrigger_unstable.
|
7
|
-
*
|
8
|
-
* @param props - props from this instance of PopoverTrigger
|
9
|
-
*/
|
10
|
-
export declare const usePopoverTrigger_unstable: (props: PopoverTriggerProps) => PopoverTriggerState;
|
package/lib/index.d.ts
DELETED
package/lib/popoverContext.d.ts
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { ContextSelector, Context } from '@fluentui/react-context-selector';
|
2
|
-
import type { PopoverState } from './components/Popover/index';
|
3
|
-
export declare const PopoverContext: Context<PopoverContextValue>;
|
4
|
-
/**
|
5
|
-
* Context shared between Popover and its children components
|
6
|
-
*/
|
7
|
-
export declare type PopoverContextValue = Pick<PopoverState, 'toggleOpen' | 'setOpen' | 'triggerRef' | 'contentRef' | 'openOnHover' | 'openOnContext' | 'mountNode' | 'noArrow' | 'arrowRef' | 'size' | 'appearance' | 'trapFocus'>;
|
8
|
-
export declare const usePopoverContext_unstable: <T>(selector: ContextSelector<PopoverContextValue, T>) => T;
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/Popover/index';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/PopoverSurface/index';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/PopoverTrigger/index';
|