@fluentui/react-popover 9.0.0-alpha.8 → 9.0.0-nightly.f81b28ceb3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. package/CHANGELOG.json +1800 -1
  2. package/CHANGELOG.md +566 -2
  3. package/Spec.md +6 -6
  4. package/dist/react-popover.d.ts +59 -77
  5. package/lib/Popover.js.map +1 -1
  6. package/lib/PopoverSurface.js.map +1 -1
  7. package/lib/PopoverTrigger.js.map +1 -1
  8. package/lib/common/isConformant.d.ts +1 -1
  9. package/lib/common/isConformant.js +9 -5
  10. package/lib/common/isConformant.js.map +1 -1
  11. package/lib/common/mockUsePopoverContext.d.ts +1 -1
  12. package/lib/common/mockUsePopoverContext.js +28 -6
  13. package/lib/common/mockUsePopoverContext.js.map +1 -1
  14. package/lib/components/Popover/Popover.d.ts +2 -2
  15. package/lib/components/Popover/Popover.js +4 -3
  16. package/lib/components/Popover/Popover.js.map +1 -1
  17. package/lib/components/Popover/Popover.types.d.ts +24 -33
  18. package/lib/components/Popover/Popover.types.js.map +1 -1
  19. package/lib/components/Popover/index.js.map +1 -1
  20. package/lib/components/Popover/renderPopover.d.ts +1 -1
  21. package/lib/components/Popover/renderPopover.js +29 -17
  22. package/lib/components/Popover/renderPopover.js.map +1 -1
  23. package/lib/components/Popover/usePopover.d.ts +2 -3
  24. package/lib/components/Popover/usePopover.js +110 -88
  25. package/lib/components/Popover/usePopover.js.map +1 -1
  26. package/lib/components/PopoverSurface/PopoverSurface.d.ts +3 -3
  27. package/lib/components/PopoverSurface/PopoverSurface.js +5 -4
  28. package/lib/components/PopoverSurface/PopoverSurface.js.map +1 -1
  29. package/lib/components/PopoverSurface/PopoverSurface.types.d.ts +9 -18
  30. package/lib/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
  31. package/lib/components/PopoverSurface/index.js.map +1 -1
  32. package/lib/components/PopoverSurface/renderPopoverSurface.d.ts +1 -1
  33. package/lib/components/PopoverSurface/renderPopoverSurface.js +18 -10
  34. package/lib/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
  35. package/lib/components/PopoverSurface/usePopoverSurface.d.ts +4 -4
  36. package/lib/components/PopoverSurface/usePopoverSurface.js +94 -54
  37. package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
  38. package/lib/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +2 -2
  39. package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js +88 -64
  40. package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
  41. package/lib/components/PopoverTrigger/PopoverTrigger.d.ts +2 -2
  42. package/lib/components/PopoverTrigger/PopoverTrigger.js +4 -3
  43. package/lib/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
  44. package/lib/components/PopoverTrigger/PopoverTrigger.types.d.ts +3 -4
  45. package/lib/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
  46. package/lib/components/PopoverTrigger/index.js.map +1 -1
  47. package/lib/components/PopoverTrigger/renderPopoverTrigger.d.ts +1 -1
  48. package/lib/components/PopoverTrigger/renderPopoverTrigger.js +1 -1
  49. package/lib/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
  50. package/lib/components/PopoverTrigger/usePopoverTrigger.d.ts +2 -3
  51. package/lib/components/PopoverTrigger/usePopoverTrigger.js +83 -60
  52. package/lib/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
  53. package/lib/index.js.map +1 -1
  54. package/lib/popoverContext.d.ts +4 -5
  55. package/lib/popoverContext.js +19 -12
  56. package/lib/popoverContext.js.map +1 -1
  57. package/lib/tsdoc-metadata.json +1 -1
  58. package/lib-commonjs/Popover.js +7 -2
  59. package/lib-commonjs/Popover.js.map +1 -1
  60. package/lib-commonjs/PopoverSurface.js +7 -2
  61. package/lib-commonjs/PopoverSurface.js.map +1 -1
  62. package/lib-commonjs/PopoverTrigger.js +7 -2
  63. package/lib-commonjs/PopoverTrigger.js.map +1 -1
  64. package/lib-commonjs/common/isConformant.d.ts +1 -1
  65. package/lib-commonjs/common/isConformant.js +18 -7
  66. package/lib-commonjs/common/isConformant.js.map +1 -1
  67. package/lib-commonjs/common/mockUsePopoverContext.d.ts +1 -1
  68. package/lib-commonjs/common/mockUsePopoverContext.js +38 -9
  69. package/lib-commonjs/common/mockUsePopoverContext.js.map +1 -1
  70. package/lib-commonjs/components/Popover/Popover.d.ts +2 -2
  71. package/lib-commonjs/components/Popover/Popover.js +14 -6
  72. package/lib-commonjs/components/Popover/Popover.js.map +1 -1
  73. package/lib-commonjs/components/Popover/Popover.types.d.ts +24 -33
  74. package/lib-commonjs/components/Popover/Popover.types.js +4 -1
  75. package/lib-commonjs/components/Popover/Popover.types.js.map +1 -1
  76. package/lib-commonjs/components/Popover/index.js +10 -2
  77. package/lib-commonjs/components/Popover/index.js.map +1 -1
  78. package/lib-commonjs/components/Popover/renderPopover.d.ts +1 -1
  79. package/lib-commonjs/components/Popover/renderPopover.js +39 -20
  80. package/lib-commonjs/components/Popover/renderPopover.js.map +1 -1
  81. package/lib-commonjs/components/Popover/usePopover.d.ts +2 -3
  82. package/lib-commonjs/components/Popover/usePopover.js +127 -93
  83. package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
  84. package/lib-commonjs/components/PopoverSurface/PopoverSurface.d.ts +3 -3
  85. package/lib-commonjs/components/PopoverSurface/PopoverSurface.js +18 -9
  86. package/lib-commonjs/components/PopoverSurface/PopoverSurface.js.map +1 -1
  87. package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.d.ts +9 -18
  88. package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js +4 -1
  89. package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
  90. package/lib-commonjs/components/PopoverSurface/index.js +11 -2
  91. package/lib-commonjs/components/PopoverSurface/index.js.map +1 -1
  92. package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.d.ts +1 -1
  93. package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js +32 -14
  94. package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
  95. package/lib-commonjs/components/PopoverSurface/usePopoverSurface.d.ts +4 -4
  96. package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js +110 -60
  97. package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js.map +1 -1
  98. package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +2 -2
  99. package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js +95 -65
  100. package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
  101. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.d.ts +2 -2
  102. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js +14 -6
  103. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
  104. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.d.ts +3 -4
  105. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js +4 -1
  106. package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
  107. package/lib-commonjs/components/PopoverTrigger/index.js +10 -2
  108. package/lib-commonjs/components/PopoverTrigger/index.js.map +1 -1
  109. package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.d.ts +1 -1
  110. package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js +7 -2
  111. package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
  112. package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.d.ts +2 -3
  113. package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js +98 -65
  114. package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
  115. package/lib-commonjs/index.js +10 -2
  116. package/lib-commonjs/index.js.map +1 -1
  117. package/lib-commonjs/popoverContext.d.ts +4 -5
  118. package/lib-commonjs/popoverContext.js +28 -14
  119. package/lib-commonjs/popoverContext.js.map +1 -1
  120. package/package.json +18 -15
  121. package/.storybook/main.js +0 -11
  122. package/.storybook/preview.js +0 -4
  123. package/bundle-size/Popover.fixture.js +0 -7
  124. package/config/api-extractor.json +0 -3
  125. package/config/tests.js +0 -7
  126. package/e2e/Popover.e2e.ts +0 -139
  127. package/etc/react-popover.api.md +0 -135
  128. package/just.config.ts +0 -3
  129. package/lib/Popover.stories.d.ts +0 -62
  130. package/lib/Popover.stories.js +0 -114
  131. package/lib/Popover.stories.js.map +0 -1
  132. package/lib/components/Popover/getOffsetWithArrow.d.ts +0 -7
  133. package/lib/components/Popover/getOffsetWithArrow.js +0 -34
  134. package/lib/components/Popover/getOffsetWithArrow.js.map +0 -1
  135. package/lib-amd/Popover.d.ts +0 -1
  136. package/lib-amd/Popover.js +0 -6
  137. package/lib-amd/Popover.js.map +0 -1
  138. package/lib-amd/Popover.stories.d.ts +0 -62
  139. package/lib-amd/Popover.stories.js +0 -121
  140. package/lib-amd/Popover.stories.js.map +0 -1
  141. package/lib-amd/PopoverSurface.d.ts +0 -1
  142. package/lib-amd/PopoverSurface.js +0 -6
  143. package/lib-amd/PopoverSurface.js.map +0 -1
  144. package/lib-amd/PopoverTrigger.d.ts +0 -1
  145. package/lib-amd/PopoverTrigger.js +0 -6
  146. package/lib-amd/PopoverTrigger.js.map +0 -1
  147. package/lib-amd/common/isConformant.d.ts +0 -4
  148. package/lib-amd/common/isConformant.js +0 -14
  149. package/lib-amd/common/isConformant.js.map +0 -1
  150. package/lib-amd/common/mockUsePopoverContext.d.ts +0 -7
  151. package/lib-amd/common/mockUsePopoverContext.js +0 -20
  152. package/lib-amd/common/mockUsePopoverContext.js.map +0 -1
  153. package/lib-amd/components/Popover/Popover.d.ts +0 -6
  154. package/lib-amd/components/Popover/Popover.js +0 -15
  155. package/lib-amd/components/Popover/Popover.js.map +0 -1
  156. package/lib-amd/components/Popover/Popover.types.d.ts +0 -109
  157. package/lib-amd/components/Popover/Popover.types.js +0 -5
  158. package/lib-amd/components/Popover/Popover.types.js.map +0 -1
  159. package/lib-amd/components/Popover/getOffsetWithArrow.d.ts +0 -7
  160. package/lib-amd/components/Popover/getOffsetWithArrow.js +0 -40
  161. package/lib-amd/components/Popover/getOffsetWithArrow.js.map +0 -1
  162. package/lib-amd/components/Popover/index.d.ts +0 -4
  163. package/lib-amd/components/Popover/index.js +0 -9
  164. package/lib-amd/components/Popover/index.js.map +0 -1
  165. package/lib-amd/components/Popover/renderPopover.d.ts +0 -5
  166. package/lib-amd/components/Popover/renderPopover.js +0 -29
  167. package/lib-amd/components/Popover/renderPopover.js.map +0 -1
  168. package/lib-amd/components/Popover/usePopover.d.ts +0 -11
  169. package/lib-amd/components/Popover/usePopover.js +0 -112
  170. package/lib-amd/components/Popover/usePopover.js.map +0 -1
  171. package/lib-amd/components/PopoverSurface/PopoverSurface.d.ts +0 -6
  172. package/lib-amd/components/PopoverSurface/PopoverSurface.js +0 -15
  173. package/lib-amd/components/PopoverSurface/PopoverSurface.js.map +0 -1
  174. package/lib-amd/components/PopoverSurface/PopoverSurface.types.d.ts +0 -30
  175. package/lib-amd/components/PopoverSurface/PopoverSurface.types.js +0 -5
  176. package/lib-amd/components/PopoverSurface/PopoverSurface.types.js.map +0 -1
  177. package/lib-amd/components/PopoverSurface/index.d.ts +0 -5
  178. package/lib-amd/components/PopoverSurface/index.js +0 -10
  179. package/lib-amd/components/PopoverSurface/index.js.map +0 -1
  180. package/lib-amd/components/PopoverSurface/renderPopoverSurface.d.ts +0 -5
  181. package/lib-amd/components/PopoverSurface/renderPopoverSurface.js +0 -21
  182. package/lib-amd/components/PopoverSurface/renderPopoverSurface.js.map +0 -1
  183. package/lib-amd/components/PopoverSurface/usePopoverSurface.d.ts +0 -13
  184. package/lib-amd/components/PopoverSurface/usePopoverSurface.js +0 -69
  185. package/lib-amd/components/PopoverSurface/usePopoverSurface.js.map +0 -1
  186. package/lib-amd/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +0 -7
  187. package/lib-amd/components/PopoverSurface/usePopoverSurfaceStyles.js +0 -81
  188. package/lib-amd/components/PopoverSurface/usePopoverSurfaceStyles.js.map +0 -1
  189. package/lib-amd/components/PopoverTrigger/PopoverTrigger.d.ts +0 -6
  190. package/lib-amd/components/PopoverTrigger/PopoverTrigger.js +0 -15
  191. package/lib-amd/components/PopoverTrigger/PopoverTrigger.js.map +0 -1
  192. package/lib-amd/components/PopoverTrigger/PopoverTrigger.types.d.ts +0 -12
  193. package/lib-amd/components/PopoverTrigger/PopoverTrigger.types.js +0 -5
  194. package/lib-amd/components/PopoverTrigger/PopoverTrigger.types.js.map +0 -1
  195. package/lib-amd/components/PopoverTrigger/index.d.ts +0 -4
  196. package/lib-amd/components/PopoverTrigger/index.js +0 -9
  197. package/lib-amd/components/PopoverTrigger/index.js.map +0 -1
  198. package/lib-amd/components/PopoverTrigger/renderPopoverTrigger.d.ts +0 -5
  199. package/lib-amd/components/PopoverTrigger/renderPopoverTrigger.js +0 -13
  200. package/lib-amd/components/PopoverTrigger/renderPopoverTrigger.js.map +0 -1
  201. package/lib-amd/components/PopoverTrigger/usePopoverTrigger.d.ts +0 -11
  202. package/lib-amd/components/PopoverTrigger/usePopoverTrigger.js +0 -75
  203. package/lib-amd/components/PopoverTrigger/usePopoverTrigger.js.map +0 -1
  204. package/lib-amd/index.d.ts +0 -4
  205. package/lib-amd/index.js +0 -9
  206. package/lib-amd/index.js.map +0 -1
  207. package/lib-amd/popoverContext.d.ts +0 -9
  208. package/lib-amd/popoverContext.js +0 -22
  209. package/lib-amd/popoverContext.js.map +0 -1
  210. package/lib-commonjs/Popover.stories.d.ts +0 -62
  211. package/lib-commonjs/Popover.stories.js +0 -122
  212. package/lib-commonjs/Popover.stories.js.map +0 -1
  213. package/lib-commonjs/components/Popover/getOffsetWithArrow.d.ts +0 -7
  214. package/lib-commonjs/components/Popover/getOffsetWithArrow.js +0 -38
  215. package/lib-commonjs/components/Popover/getOffsetWithArrow.js.map +0 -1
  216. package/src/components/Popover/Popover.types.ts +0 -124
  217. package/src/components/PopoverSurface/PopoverSurface.types.ts +0 -36
  218. package/src/components/PopoverTrigger/PopoverTrigger.types.ts +0 -13
@@ -1,12 +1,21 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.usePopoverSurface = void 0;
4
- var tslib_1 = require("tslib");
5
- var React = require("react");
6
- var react_utilities_1 = require("@fluentui/react-utilities");
7
- var react_tabster_1 = require("@fluentui/react-tabster");
8
- var popoverContext_1 = require("../../popoverContext");
9
- var mergeProps = react_utilities_1.makeMergeProps({});
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.usePopoverSurface = exports.popoverSurfaceSlots = void 0;
7
+
8
+ var tslib_1 = /*#__PURE__*/require("tslib");
9
+
10
+ var React = /*#__PURE__*/require("react");
11
+
12
+ var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
13
+
14
+ var react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
15
+
16
+ var popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
17
+
18
+ exports.popoverSurfaceSlots = ['root'];
10
19
  /**
11
20
  * Create the state required to render PopoverSurface.
12
21
  *
@@ -14,59 +23,100 @@ var mergeProps = react_utilities_1.makeMergeProps({});
14
23
  * before being passed to renderPopoverSurface.
15
24
  *
16
25
  * @param props - props from this instance of PopoverSurface
17
- * @param ref - reference to root HTMLElement of PopoverSurface
18
- * @param defaultProps - (optional) default prop values provided by the implementing type
26
+ * @param ref - reference to root HTMLDivElement of PopoverSurface
19
27
  */
20
- var usePopoverSurface = function (props, ref, defaultProps) {
21
- var contentRef = popoverContext_1.usePopoverContext(function (context) { return context.contentRef; });
22
- var open = popoverContext_1.usePopoverContext(function (context) { return context.open; });
23
- var openOnHover = popoverContext_1.usePopoverContext(function (context) { return context.openOnHover; });
24
- var setOpen = popoverContext_1.usePopoverContext(function (context) { return context.setOpen; });
25
- var mountNode = popoverContext_1.usePopoverContext(function (context) { return context.mountNode; });
26
- var arrowRef = popoverContext_1.usePopoverContext(function (context) { return context.arrowRef; });
27
- var size = popoverContext_1.usePopoverContext(function (context) { return context.size; });
28
- var noArrow = popoverContext_1.usePopoverContext(function (context) { return context.noArrow; });
29
- var brand = popoverContext_1.usePopoverContext(function (context) { return context.brand; });
30
- var inverted = popoverContext_1.usePopoverContext(function (context) { return context.inverted; });
31
- var trapFocus = popoverContext_1.usePopoverContext(function (context) { return context.trapFocus; });
32
- var modalAttributes = react_tabster_1.useModalAttributes({ trapFocus: trapFocus }).modalAttributes;
33
- var state = mergeProps(tslib_1.__assign({ brand: brand,
34
- inverted: inverted,
35
- noArrow: noArrow,
36
- size: size,
37
- arrowRef: arrowRef,
38
- open: open,
39
- mountNode: mountNode, role: 'dialog', ref: react_utilities_1.useMergedRefs(ref, contentRef) }, modalAttributes), defaultProps, props);
40
- var onMouseEnterOriginal = state.onMouseEnter, onMouseLeaveOriginal = state.onMouseLeave, onKeyDownOriginal = state.onKeyDown;
41
- state.onMouseEnter = function (e) {
42
- if (openOnHover) {
43
- setOpen(e, true);
44
- }
45
- onMouseEnterOriginal === null || onMouseEnterOriginal === void 0 ? void 0 : onMouseEnterOriginal(e);
46
- };
47
- state.onMouseLeave = function (e) {
48
- if (openOnHover) {
49
- setOpen(e, false);
50
- }
51
- onMouseLeaveOriginal === null || onMouseLeaveOriginal === void 0 ? void 0 : onMouseLeaveOriginal(e);
52
- };
53
- state.onKeyDown = function (e) {
54
- var _a;
55
- // only close if the event happened inside the current popover
56
- // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack
57
- if (e.key === 'Escape' && ((_a = contentRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
58
- setOpen(e, false);
59
- }
60
- onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(e);
61
- };
62
- var findFirstFocusable = react_tabster_1.useFocusFinders().findFirstFocusable;
63
- React.useEffect(function () {
64
- if (state.open && contentRef.current) {
65
- var firstFocusable = findFirstFocusable(contentRef.current);
66
- firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
67
- }
68
- }, [contentRef, findFirstFocusable, state.open]);
69
- return state;
28
+
29
+ var usePopoverSurface = function (props, ref) {
30
+ var contentRef = popoverContext_1.usePopoverContext(function (context) {
31
+ return context.contentRef;
32
+ });
33
+ var open = popoverContext_1.usePopoverContext(function (context) {
34
+ return context.open;
35
+ });
36
+ var openOnHover = popoverContext_1.usePopoverContext(function (context) {
37
+ return context.openOnHover;
38
+ });
39
+ var setOpen = popoverContext_1.usePopoverContext(function (context) {
40
+ return context.setOpen;
41
+ });
42
+ var mountNode = popoverContext_1.usePopoverContext(function (context) {
43
+ return context.mountNode;
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;
59
+ });
60
+ var modalAttributes = react_tabster_1.useModalAttributes({
61
+ trapFocus: trapFocus
62
+ }).modalAttributes;
63
+ var state = {
64
+ appearance: appearance,
65
+ noArrow: noArrow,
66
+ size: size,
67
+ arrowRef: arrowRef,
68
+ open: open,
69
+ mountNode: mountNode,
70
+ components: {
71
+ root: 'div'
72
+ },
73
+ root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign(tslib_1.__assign({
74
+ ref: react_utilities_1.useMergedRefs(ref, contentRef),
75
+ role: 'dialog'
76
+ }, modalAttributes), props))
77
+ };
78
+ var _a = state.root,
79
+ onMouseEnterOriginal = _a.onMouseEnter,
80
+ onMouseLeaveOriginal = _a.onMouseLeave,
81
+ onKeyDownOriginal = _a.onKeyDown;
82
+
83
+ state.root.onMouseEnter = function (e) {
84
+ if (openOnHover) {
85
+ setOpen(e, true);
86
+ }
87
+
88
+ onMouseEnterOriginal === null || onMouseEnterOriginal === void 0 ? void 0 : onMouseEnterOriginal(e);
89
+ };
90
+
91
+ state.root.onMouseLeave = function (e) {
92
+ if (openOnHover) {
93
+ setOpen(e, false);
94
+ }
95
+
96
+ onMouseLeaveOriginal === null || onMouseLeaveOriginal === void 0 ? void 0 : onMouseLeaveOriginal(e);
97
+ };
98
+
99
+ state.root.onKeyDown = function (e) {
100
+ var _a; // only close if the event happened inside the current popover
101
+ // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack
102
+
103
+
104
+ if (e.key === 'Escape' && ((_a = contentRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
105
+ setOpen(e, false);
106
+ }
107
+
108
+ onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(e);
109
+ };
110
+
111
+ var findFirstFocusable = react_tabster_1.useFocusFinders().findFirstFocusable;
112
+ React.useEffect(function () {
113
+ if (state.open && contentRef.current) {
114
+ var firstFocusable = findFirstFocusable(contentRef.current);
115
+ firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
116
+ }
117
+ }, [contentRef, findFirstFocusable, state.open]);
118
+ return state;
70
119
  };
120
+
71
121
  exports.usePopoverSurface = usePopoverSurface;
72
122
  //# sourceMappingURL=usePopoverSurface.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePopoverSurface.js","sourceRoot":"../src/","sources":["components/PopoverSurface/usePopoverSurface.ts"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,6DAA0E;AAC1E,yDAA8E;AAE9E,uDAAyD;AAEzD,IAAM,UAAU,GAAG,gCAAc,CAAsB,EAAE,CAAC,CAAC;AAE3D;;;;;;;;;GASG;AACI,IAAM,iBAAiB,GAAG,UAC/B,KAA0B,EAC1B,GAA2B,EAC3B,YAAkC;IAElC,IAAM,UAAU,GAAG,kCAAiB,CAAC,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,UAAU,EAAlB,C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Ac,GAAG,kBAAkB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAC9D,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,KAAK,GAAG;SACzB;IACH,CAAC,EAAE,CAAC,UAAU,EAAE,kBAAkB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AA3EW,QAAA,iBAAiB,qBA2E5B","sourcesContent":["import * as React from 'react';\nimport { makeMergeProps, useMergedRefs } from '@fluentui/react-utilities';\nimport { useFocusFinders, useModalAttributes } from '@fluentui/react-tabster';\nimport { PopoverSurfaceProps, PopoverSurfaceState } from './PopoverSurface.types';\nimport { usePopoverContext } from '../../popoverContext';\n\nconst mergeProps = makeMergeProps<PopoverSurfaceState>({});\n\n/**\n * Create the state required to render PopoverSurface.\n *\n * The returned state can be modified with hooks such as usePopoverSurfaceStyles,\n * before being passed to renderPopoverSurface.\n *\n * @param props - props from this instance of PopoverSurface\n * @param ref - reference to root HTMLElement of PopoverSurface\n * @param defaultProps - (optional) default prop values provided by the implementing type\n */\nexport const usePopoverSurface = (\n props: PopoverSurfaceProps,\n ref: React.Ref<HTMLElement>,\n defaultProps?: PopoverSurfaceProps,\n): PopoverSurfaceState => {\n const contentRef = usePopoverContext(context => context.contentRef);\n const open = usePopoverContext(context => context.open);\n const openOnHover = usePopoverContext(context => context.openOnHover);\n const setOpen = usePopoverContext(context => context.setOpen);\n const mountNode = usePopoverContext(context => context.mountNode);\n const arrowRef = usePopoverContext(context => context.arrowRef);\n const size = usePopoverContext(context => context.size);\n const noArrow = usePopoverContext(context => context.noArrow);\n const brand = usePopoverContext(context => context.brand);\n const inverted = usePopoverContext(context => context.inverted);\n const trapFocus = usePopoverContext(context => context.trapFocus);\n const { modalAttributes } = useModalAttributes({ trapFocus });\n\n const state = mergeProps(\n {\n brand,\n inverted,\n noArrow,\n size,\n arrowRef,\n open,\n mountNode,\n role: 'dialog',\n ref: useMergedRefs(ref, contentRef),\n ...modalAttributes,\n },\n defaultProps,\n props,\n );\n\n const {\n onMouseEnter: onMouseEnterOriginal,\n onMouseLeave: onMouseLeaveOriginal,\n onKeyDown: onKeyDownOriginal,\n } = state;\n state.onMouseEnter = (e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover) {\n setOpen(e, true);\n }\n\n onMouseEnterOriginal?.(e);\n };\n\n state.onMouseLeave = (e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover) {\n setOpen(e, false);\n }\n\n onMouseLeaveOriginal?.(e);\n };\n\n state.onKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {\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 HTMLElement)) {\n setOpen(e, false);\n }\n\n onKeyDownOriginal?.(e);\n };\n\n const { findFirstFocusable } = useFocusFinders();\n\n React.useEffect(() => {\n if (state.open && contentRef.current) {\n const firstFocusable = findFirstFocusable(contentRef.current);\n firstFocusable?.focus();\n }\n }, [contentRef, findFirstFocusable, state.open]);\n return state;\n};\n"]}
1
+ {"version":3,"sources":["../../../src/components/PopoverSurface/usePopoverSurface.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,IAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,IAAA,gBAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;;AAGa,OAAA,CAAA,mBAAA,GAAwD,CAAC,MAAD,CAAxD;AAEb;;;;;;;;AAQG;;AACI,IAAM,iBAAiB,GAAG,UAAC,KAAD,EAA6B,GAA7B,EAA2D;AAC1F,MAAM,UAAU,GAAG,gBAAA,CAAA,iBAAA,CAAkB,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,UAAA;AAAkB,GAA/C,CAAnB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ApB;AACD,GAND;;AAQA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,UAAC,CAAD,EAAuC;WAAA,CAC5D;AACA;;;AACA,QAAI,CAAC,CAAC,GAAF,KAAU,QAAV,KAAkB,CAAA,EAAA,GAAI,UAAU,CAAC,OAAf,MAAsB,IAAtB,IAAsB,EAAA,KAAA,KAAA,CAAtB,GAAsB,KAAA,CAAtB,GAAsB,EAAA,CAAE,QAAF,CAAW,CAAC,CAAC,MAAb,CAAxC,CAAJ,EAAoF;AAClF,MAAA,OAAO,CAAC,CAAD,EAAI,KAAJ,CAAP;AACD;;AAED,IAAA,iBAAiB,KAAA,IAAjB,IAAA,iBAAiB,KAAA,KAAA,CAAjB,GAAiB,KAAA,CAAjB,GAAA,iBAAiB,CAAG,CAAH,CAAjB;AACD,GARD;;AAUQ,MAAA,kBAAkB,GAAK,eAAA,CAAA,eAAA,GAAL,kBAAlB;AAER,EAAA,KAAK,CAAC,SAAN,CAAgB,YAAA;AACd,QAAI,KAAK,CAAC,IAAN,IAAc,UAAU,CAAC,OAA7B,EAAsC;AACpC,UAAM,cAAc,GAAG,kBAAkB,CAAC,UAAU,CAAC,OAAZ,CAAzC;AACA,MAAA,cAAc,KAAA,IAAd,IAAA,cAAc,KAAA,KAAA,CAAd,GAAc,KAAA,CAAd,GAAA,cAAc,CAAE,KAAhB,EAAA;AACD;AACF,GALD,EAKG,CAAC,UAAD,EAAa,kBAAb,EAAiC,KAAK,CAAC,IAAvC,CALH;AAMA,SAAO,KAAP;AACD,CAvEM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourceRoot":""}
@@ -1,5 +1,5 @@
1
- import { PopoverSize } from '../Popover/Popover.types';
2
- import { PopoverSurfaceState } from './PopoverSurface.types';
1
+ import type { PopoverSize } from '../Popover/Popover.types';
2
+ import type { PopoverSurfaceState } from './PopoverSurface.types';
3
3
  export declare const arrowHeights: Record<PopoverSize, number>;
4
4
  /**
5
5
  * Apply styling to the PopoverSurface slots based on the state
@@ -1,80 +1,110 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  exports.usePopoverSurfaceStyles = exports.arrowHeights = void 0;
4
- var react_make_styles_1 = require("@fluentui/react-make-styles");
7
+
8
+ var react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
9
+
5
10
  exports.arrowHeights = {
6
- small: 6,
7
- medium: 8,
8
- large: 8,
11
+ small: 6,
12
+ medium: 8,
13
+ large: 8
9
14
  };
10
15
  /**
11
16
  * Styles for the root slot
12
17
  */
13
- var useStyles = react_make_styles_1.makeStyles({
14
- root: function (theme) { return ({
15
- backgroundColor: theme.alias.color.neutral.neutralBackground1,
16
- boxShadow: theme.alias.shadow.shadow16,
17
- borderRadius: '4px',
18
- }); },
19
- inverted: function (theme) { return ({
20
- // TODO: neutral background inverted missing from superset and theme
21
- backgroundColor: theme.global.palette.grey[16],
22
- color: theme.alias.color.neutral.neutralForegroundInverted,
23
- }); },
24
- brand: function (theme) { return ({
25
- backgroundColor: theme.alias.color.neutral.brandBackground,
26
- // TODO: clarify with designers what foreground color should be with brand background,
27
- color: theme.alias.color.neutral.neutralForegroundInverted,
28
- }); },
29
- smallPadding: function () { return ({
30
- padding: '12px',
31
- }); },
32
- mediumPadding: function () { return ({
33
- padding: '16px',
34
- }); },
35
- largePadding: function () { return ({
36
- padding: '20px',
37
- }); },
38
- smallArrow: function () { return ({
39
- width: Math.SQRT2 * exports.arrowHeights.small + "px",
40
- height: Math.SQRT2 * exports.arrowHeights.small + "px",
41
- }); },
42
- mediumLargeArrow: function () { return ({
43
- width: Math.SQRT2 * exports.arrowHeights.medium + "px",
44
- height: Math.SQRT2 * exports.arrowHeights.medium + "px",
45
- }); },
46
- // TODO dedupe these styles with tooltip
47
- arrow: function (theme) { return ({
48
- position: 'absolute',
49
- background: 'inherit',
50
- visibility: 'hidden',
51
- zIndex: -1,
52
- ':before': {
53
- content: '""',
54
- borderRadius: '4px',
55
- position: 'absolute',
56
- width: 'inherit',
57
- height: 'inherit',
58
- background: 'inherit',
59
- visibility: 'visible',
60
- borderBottomRightRadius: theme.global.borderRadius.small,
61
- transform: 'rotate(var(--angle)) translate(0, 50%) rotate(45deg)',
62
- },
63
- // Popper sets data-popper-placement on the root element, which is used to align the arrow
64
- ':global([data-popper-placement^="top"])': { bottom: 0, '--angle': '0' },
65
- ':global([data-popper-placement^="right"])': { left: 0, '--angle': '90deg' },
66
- ':global([data-popper-placement^="bottom"])': { top: 0, '--angle': '180deg' },
67
- ':global([data-popper-placement^="left"])': { right: 0, '--angle': '270deg' },
68
- }); },
18
+
19
+ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
20
+ "root": {
21
+ "De3pzq": "fxugw4r",
22
+ "E5pizo": ["f1hg901r", "f136t921"],
23
+ "Dimara": "ff3glw6",
24
+ "B4j52fo": "f5ogflp",
25
+ "Bekrc4i": ["f1hqa2wf", "finvdd3"],
26
+ "Bn0qgzm": "f1f09k3d",
27
+ "ibv6hh": ["finvdd3", "f1hqa2wf"],
28
+ "icvyot": "fzkkow9",
29
+ "vrafjx": ["fcdblym", "fjik90z"],
30
+ "oivjwe": "fg706s2",
31
+ "wvpqe5": ["fjik90z", "fcdblym"],
32
+ "g2u3we": "fghlq4f",
33
+ "h3c5rm": ["f1gn591s", "fjscplz"],
34
+ "B9xav0g": "fb073pr",
35
+ "zhjwy3": ["fjscplz", "f1gn591s"]
36
+ },
37
+ "inverted": {
38
+ "De3pzq": "f1c73kur",
39
+ "sj55zd": "fqpbvvt"
40
+ },
41
+ "brand": {
42
+ "De3pzq": "ffp7eso",
43
+ "sj55zd": "fqpbvvt"
44
+ },
45
+ "smallPadding": {
46
+ "z8tnut": "f1kcqot9",
47
+ "z189sj": ["f11qrl6u", "fjlbh76"],
48
+ "Byoj8tv": "fpe6lb7",
49
+ "uwmqm3": ["fjlbh76", "f11qrl6u"]
50
+ },
51
+ "mediumPadding": {
52
+ "z8tnut": "fqag9an",
53
+ "z189sj": ["f1gbmcue", "f1rh9g5y"],
54
+ "Byoj8tv": "fp67ikv",
55
+ "uwmqm3": ["f1rh9g5y", "f1gbmcue"]
56
+ },
57
+ "largePadding": {
58
+ "z8tnut": "fc7z3ec",
59
+ "z189sj": ["fat0sn4", "fekwl8i"],
60
+ "Byoj8tv": "fe2my4m",
61
+ "uwmqm3": ["fekwl8i", "fat0sn4"]
62
+ },
63
+ "smallArrow": {
64
+ "a9b677": "f1smug5u",
65
+ "Bqenvij": "f11ci07v"
66
+ },
67
+ "mediumLargeArrow": {
68
+ "a9b677": "ftmg478",
69
+ "Bqenvij": "f7bsbfx"
70
+ },
71
+ "arrow": {
72
+ "qhf8xq": "f1euv43f",
73
+ "ayd6f0": "f1uo6wrk",
74
+ "Bcdw1i0": "fd7fpy0",
75
+ "Bj3rh1h": "f1bsuimh",
76
+ "rurcny": "fuzzvh5",
77
+ "zf3lio": "f1qudtws",
78
+ "xx9plb": "fxf9f1y",
79
+ "Bdn98qo": "f103af6e",
80
+ "Bbc2r3f": "f15umuo5",
81
+ "B4zgs9e": "ffo048g",
82
+ "Bex5imi": "fkk33zh",
83
+ "px8gyy": ["f5bg3dr", "f1rfdd74"],
84
+ "h6z6rw": ["fzd2j21", "f2549he"],
85
+ "hl6cv3": "fotnskf",
86
+ "Bh2vraf": "f1n8855c",
87
+ "yayu3t": ["f1nq055x", "f13ohf3"],
88
+ "wedwtw": "fsw6im5",
89
+ "rhl9o9": "ftghsr9",
90
+ "Bu8t5uz": "f159pzir",
91
+ "B6q6orb": ["f1l8vbt4", "fsxzh25"],
92
+ "Bwwlvwl": "fm1ycve"
93
+ }
94
+ }, {
95
+ "d": [".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f1hg901r{box-shadow:var(--shadow16);}", ".f136t921{box-shadow:var(--shadow-16);}", ".ff3glw6{border-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;}", ".f1smug5u{width:8.485281374238571px;}", ".f11ci07v{height:8.485281374238571px;}", ".ftmg478{width:11.313708498984761px;}", ".f7bsbfx{height:11.313708498984761px;}", ".f1euv43f{position:absolute;}", ".f1uo6wrk{background:inherit;}", ".fd7fpy0{visibility:hidden;}", ".f1bsuimh{z-index:-1;}", ".fuzzvh5:before{content:\"\";}", ".f1qudtws:before{border-radius:4px;}", ".fxf9f1y:before{position:absolute;}", ".f103af6e:before{width:inherit;}", ".f15umuo5:before{height:inherit;}", ".ffo048g:before{background:inherit;}", ".fkk33zh:before{visibility:visible;}", ".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);}", ".f2549he: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\"] .fotnskf{bottom:0;}", "[data-popper-placement^=\"top\"] .f1n8855c{--angle:0;}", "[data-popper-placement^=\"right\"] .f1nq055x{left:0;}", "[data-popper-placement^=\"right\"] .f13ohf3{right:0;}", "[data-popper-placement^=\"right\"] .fsw6im5{--angle:90deg;}", "[data-popper-placement^=\"bottom\"] .ftghsr9{top:0;}", "[data-popper-placement^=\"bottom\"] .f159pzir{--angle:180deg;}", "[data-popper-placement^=\"left\"] .f1l8vbt4{right:0;}", "[data-popper-placement^=\"left\"] .fsxzh25{left:0;}", "[data-popper-placement^=\"left\"] .fm1ycve{--angle:270deg;}"]
69
96
  });
70
97
  /**
71
98
  * Apply styling to the PopoverSurface slots based on the state
72
99
  */
100
+
101
+
73
102
  var usePopoverSurfaceStyles = function (state) {
74
- var styles = useStyles();
75
- state.className = react_make_styles_1.mergeClasses(styles.root, state.className, state.size === 'small' && styles.smallPadding, state.size === 'medium' && styles.mediumPadding, state.size === 'large' && styles.largePadding, state.inverted && styles.inverted, state.brand && styles.brand);
76
- state.arrowClassName = react_make_styles_1.mergeClasses(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);
77
- return state;
103
+ var styles = useStyles();
104
+ state.root.className = react_make_styles_1.mergeClasses(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);
105
+ state.arrowClassName = react_make_styles_1.mergeClasses(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);
106
+ return state;
78
107
  };
108
+
79
109
  exports.usePopoverSurfaceStyles = usePopoverSurfaceStyles;
80
110
  //# sourceMappingURL=usePopoverSurfaceStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePopoverSurfaceStyles.js","sourceRoot":"../src/","sources":["components/PopoverSurface/usePopoverSurfaceStyles.ts"],"names":[],"mappings":";;;AAAA,iEAAuE;AAI1D,QAAA,YAAY,GAAgC;IACvD,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;CACT,CAAC;AAEF;;GAEG;AACH,IAAM,SAAS,GAAG,8BAAU,CAAC;IAC3B,IAAI,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;QACd,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB;QAC7D,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ;QACtC,YAAY,EAAE,KAAK;KACpB,CAAC,EAJa,CAIb;IAEF,QAAQ,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;QAClB,oEAAoE;QACpE,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,yBAAyB;KAC3D,CAAC,EAJiB,CAIjB;IAEF,KAAK,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;QACf,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe;QAC1D,sFAAsF;QACtF,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,yBAAyB;KAC3D,CAAC,EAJc,CAId;IAEF,YAAY,EAAE,cAAM,OAAA,CAAC;QACnB,OAAO,EAAE,MAAM;KAChB,CAAC,EAFkB,CAEl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AAE,SAAS,EAAE,QAAQ,EAAE;QAC7E,0CAA0C,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE;KAC9E,CAAC,EAvBc,CAuBd;CACH,CAAC,CAAC;AAEH;;GAEG;AACI,IAAM,uBAAuB,GAAG,UAAC,KAA0B;IAChE,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,KAAK,CAAC,SAAS,GAAG,gCAAY,CAC5B,MAAM,CAAC,IAAI,EACX,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,YAAY,EAC7C,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,aAAa,EAC/C,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,YAAY,EAC7C,KAAK,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,EACjC,KAAK,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAC5B,CAAC;IAEF,KAAK,CAAC,cAAc,GAAG,gCAAY,CACjC,MAAM,CAAC,KAAK,EACZ,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CACrE,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAlBW,QAAA,uBAAuB,2BAkBlC","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport { PopoverSize } from '../Popover/Popover.types';\nimport { PopoverSurfaceState } from './PopoverSurface.types';\n\nexport const arrowHeights: Record<PopoverSize, number> = {\n small: 6,\n medium: 8,\n large: 8,\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: theme => ({\n backgroundColor: theme.alias.color.neutral.neutralBackground1,\n boxShadow: theme.alias.shadow.shadow16,\n borderRadius: '4px',\n }),\n\n inverted: theme => ({\n // TODO: neutral background inverted missing from superset and theme\n backgroundColor: theme.global.palette.grey[16],\n color: theme.alias.color.neutral.neutralForegroundInverted,\n }),\n\n brand: theme => ({\n backgroundColor: theme.alias.color.neutral.brandBackground,\n // TODO: clarify with designers what foreground color should be with brand background,\n color: theme.alias.color.neutral.neutralForegroundInverted,\n }),\n\n smallPadding: () => ({\n padding: '12px',\n }),\n\n mediumPadding: () => ({\n padding: '16px',\n }),\n\n largePadding: () => ({\n padding: '20px',\n }),\n\n smallArrow: () => ({\n width: `${Math.SQRT2 * arrowHeights.small}px`,\n height: `${Math.SQRT2 * arrowHeights.small}px`,\n }),\n\n mediumLargeArrow: () => ({\n width: `${Math.SQRT2 * arrowHeights.medium}px`,\n height: `${Math.SQRT2 * arrowHeights.medium}px`,\n }),\n\n // TODO dedupe these styles with tooltip\n arrow: theme => ({\n position: 'absolute',\n background: 'inherit',\n visibility: 'hidden',\n zIndex: -1,\n\n ':before': {\n content: '\"\"',\n borderRadius: '4px',\n position: 'absolute',\n width: 'inherit',\n height: 'inherit',\n background: 'inherit',\n visibility: 'visible',\n borderBottomRightRadius: theme.global.borderRadius.small,\n transform: 'rotate(var(--angle)) translate(0, 50%) rotate(45deg)',\n },\n\n // Popper sets data-popper-placement on the root element, which is used to align the arrow\n ':global([data-popper-placement^=\"top\"])': { bottom: 0, '--angle': '0' },\n ':global([data-popper-placement^=\"right\"])': { left: 0, '--angle': '90deg' },\n ':global([data-popper-placement^=\"bottom\"])': { top: 0, '--angle': '180deg' },\n ':global([data-popper-placement^=\"left\"])': { right: 0, '--angle': '270deg' },\n }),\n});\n\n/**\n * Apply styling to the PopoverSurface slots based on the state\n */\nexport const usePopoverSurfaceStyles = (state: PopoverSurfaceState): PopoverSurfaceState => {\n const styles = useStyles();\n state.className = mergeClasses(\n styles.root,\n state.className,\n state.size === 'small' && styles.smallPadding,\n state.size === 'medium' && styles.mediumPadding,\n state.size === 'large' && styles.largePadding,\n state.inverted && styles.inverted,\n state.brand && styles.brand,\n );\n\n state.arrowClassName = mergeClasses(\n styles.arrow,\n state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow,\n );\n\n return state;\n};\n"]}
1
+ {"version":3,"sources":["../../../src/components/PopoverSurface/usePopoverSurfaceStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAIa,OAAA,CAAA,YAAA,GAA4C;AACvD,EAAA,KAAK,EAAE,CADgD;AAEvD,EAAA,MAAM,EAAE,CAF+C;AAGvD,EAAA,KAAK,EAAE;AAHgD,CAA5C;AAMb;;AAEG;;AACH,IAAM,SAAS,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAqEA;;AAEG;;;AACI,IAAM,uBAAuB,GAAG,UAAC,KAAD,EAA2B;AAChE,MAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,mBAAA,CAAA,YAAA,CACrB,MAAM,CAAC,IADc,EAErB,KAAK,CAAC,IAAN,KAAe,OAAf,IAA0B,MAAM,CAAC,YAFZ,EAGrB,KAAK,CAAC,IAAN,KAAe,QAAf,IAA2B,MAAM,CAAC,aAHb,EAIrB,KAAK,CAAC,IAAN,KAAe,OAAf,IAA0B,MAAM,CAAC,YAJZ,EAKrB,KAAK,CAAC,UAAN,KAAqB,UAArB,IAAmC,MAAM,CAAC,QALrB,EAMrB,KAAK,CAAC,UAAN,KAAqB,OAArB,IAAgC,MAAM,CAAC,KANlB,EAOrB,KAAK,CAAC,IAAN,CAAW,SAPU,CAAvB;AAUA,EAAA,KAAK,CAAC,cAAN,GAAuB,mBAAA,CAAA,YAAA,CACrB,MAAM,CAAC,KADc,EAErB,KAAK,CAAC,IAAN,KAAe,OAAf,GAAyB,MAAM,CAAC,UAAhC,GAA6C,MAAM,CAAC,gBAF/B,CAAvB;AAKA,SAAO,KAAP;AACD,CAlBM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourceRoot":""}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { PopoverTriggerProps } from './PopoverTrigger.types';
2
+ import type { PopoverTriggerProps } from './PopoverTrigger.types';
3
3
  /**
4
- * PopoverTrigger component
4
+ * Wraps a trigger element as an only child and adds the necessary event handling to open a popover.
5
5
  */
6
6
  export declare const PopoverTrigger: React.FC<PopoverTriggerProps>;
@@ -1,15 +1,23 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  exports.PopoverTrigger = void 0;
4
- var usePopoverTrigger_1 = require("./usePopoverTrigger");
5
- var renderPopoverTrigger_1 = require("./renderPopoverTrigger");
7
+
8
+ var usePopoverTrigger_1 = /*#__PURE__*/require("./usePopoverTrigger");
9
+
10
+ var renderPopoverTrigger_1 = /*#__PURE__*/require("./renderPopoverTrigger");
6
11
  /**
7
- * PopoverTrigger component
12
+ * Wraps a trigger element as an only child and adds the necessary event handling to open a popover.
8
13
  */
14
+
15
+
9
16
  var PopoverTrigger = function (props) {
10
- var state = usePopoverTrigger_1.usePopoverTrigger(props);
11
- return renderPopoverTrigger_1.renderPopoverTrigger(state);
17
+ var state = usePopoverTrigger_1.usePopoverTrigger(props);
18
+ return renderPopoverTrigger_1.renderPopoverTrigger(state);
12
19
  };
20
+
13
21
  exports.PopoverTrigger = PopoverTrigger;
14
22
  exports.PopoverTrigger.displayName = 'PopoverTrigger';
15
23
  //# sourceMappingURL=PopoverTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverTrigger.js","sourceRoot":"../src/","sources":["components/PopoverTrigger/PopoverTrigger.tsx"],"names":[],"mappings":";;;AACA,yDAAwD;AAExD,+DAA8D;AAE9D;;GAEG;AACI,IAAM,cAAc,GAAkC,UAAA,KAAK;IAChE,IAAM,KAAK,GAAG,qCAAiB,CAAC,KAAK,CAAC,CAAC;IAEvC,OAAO,2CAAoB,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAC;AAJW,QAAA,cAAc,kBAIzB;AAEF,sBAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC","sourcesContent":["import * as React from 'react';\nimport { usePopoverTrigger } from './usePopoverTrigger';\nimport { PopoverTriggerProps } from './PopoverTrigger.types';\nimport { renderPopoverTrigger } from './renderPopoverTrigger';\n\n/**\n * PopoverTrigger component\n */\nexport const PopoverTrigger: React.FC<PopoverTriggerProps> = props => {\n const state = usePopoverTrigger(props);\n\n return renderPopoverTrigger(state);\n};\n\nPopoverTrigger.displayName = 'PopoverTrigger';\n"]}
1
+ {"version":3,"sources":["../../../src/components/PopoverTrigger/PopoverTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,IAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,cAAc,GAAkC,UAAA,KAAA,EAAK;AAChE,MAAM,KAAK,GAAG,mBAAA,CAAA,iBAAA,CAAkB,KAAlB,CAAd;AAEA,SAAO,sBAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd;AAMb,OAAA,CAAA,cAAA,CAAe,WAAf,GAA6B,gBAA7B","sourceRoot":""}
@@ -2,11 +2,10 @@ import * as React from 'react';
2
2
  /**
3
3
  * PopoverTrigger Props
4
4
  */
5
- export interface PopoverTriggerProps {
5
+ export declare type PopoverTriggerProps = {
6
6
  children: React.ReactElement;
7
- }
7
+ };
8
8
  /**
9
9
  * PopoverTrigger State
10
10
  */
11
- export interface PopoverTriggerState extends PopoverTriggerProps {
12
- }
11
+ export declare type PopoverTriggerState = PopoverTriggerProps;
@@ -1,3 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  //# sourceMappingURL=PopoverTrigger.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverTrigger.types.js","sourceRoot":"../src/","sources":["components/PopoverTrigger/PopoverTrigger.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\n/**\n * PopoverTrigger Props\n */\nexport interface PopoverTriggerProps {\n children: React.ReactElement;\n}\n\n/**\n * PopoverTrigger State\n */\nexport interface PopoverTriggerState extends PopoverTriggerProps {}\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
@@ -1,8 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var tslib_1 = /*#__PURE__*/require("tslib");
8
+
4
9
  tslib_1.__exportStar(require("./PopoverTrigger"), exports);
10
+
5
11
  tslib_1.__exportStar(require("./PopoverTrigger.types"), exports);
12
+
6
13
  tslib_1.__exportStar(require("./renderPopoverTrigger"), exports);
14
+
7
15
  tslib_1.__exportStar(require("./usePopoverTrigger"), exports);
8
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/PopoverTrigger/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,iEAAuC;AACvC,iEAAuC;AACvC,8DAAoC","sourcesContent":["export * from './PopoverTrigger';\nexport * from './PopoverTrigger.types';\nexport * from './renderPopoverTrigger';\nexport * from './usePopoverTrigger';\n"]}
1
+ {"version":3,"sources":["../../../src/components/PopoverTrigger/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA","sourceRoot":""}
@@ -1,4 +1,4 @@
1
- import { PopoverTriggerState } from './PopoverTrigger.types';
1
+ import type { PopoverTriggerState } from './PopoverTrigger.types';
2
2
  /**
3
3
  * Render the final JSX of PopoverTrigger
4
4
  */
@@ -1,11 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  exports.renderPopoverTrigger = void 0;
4
7
  /**
5
8
  * Render the final JSX of PopoverTrigger
6
9
  */
10
+
7
11
  var renderPopoverTrigger = function (state) {
8
- return state.children;
12
+ return state.children;
9
13
  };
14
+
10
15
  exports.renderPopoverTrigger = renderPopoverTrigger;
11
16
  //# sourceMappingURL=renderPopoverTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderPopoverTrigger.js","sourceRoot":"../src/","sources":["components/PopoverTrigger/renderPopoverTrigger.tsx"],"names":[],"mappings":";;;AAEA;;GAEG;AACI,IAAM,oBAAoB,GAAG,UAAC,KAA0B;IAC7D,OAAO,KAAK,CAAC,QAAQ,CAAC;AACxB,CAAC,CAAC;AAFW,QAAA,oBAAoB,wBAE/B","sourcesContent":["import { PopoverTriggerState } from './PopoverTrigger.types';\n\n/**\n * Render the final JSX of PopoverTrigger\n */\nexport const renderPopoverTrigger = (state: PopoverTriggerState): JSX.Element => {\n return state.children;\n};\n"]}
1
+ {"version":3,"sources":["../../../src/components/PopoverTrigger/renderPopoverTrigger.tsx"],"names":[],"mappings":";;;;;;AAEA;;AAEG;;AACI,IAAM,oBAAoB,GAAG,UAAC,KAAD,EAA2B;AAC7D,SAAO,KAAK,CAAC,QAAb;AACD,CAFM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourceRoot":""}
@@ -1,4 +1,4 @@
1
- import { PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger.types';
1
+ import type { PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger.types';
2
2
  /**
3
3
  * Create the state required to render PopoverTrigger.
4
4
  *
@@ -6,6 +6,5 @@ import { PopoverTriggerProps, PopoverTriggerState } from './PopoverTrigger.types
6
6
  * before being passed to renderPopoverTrigger.
7
7
  *
8
8
  * @param props - props from this instance of PopoverTrigger
9
- * @param defaultProps - (optional) default prop values provided by the implementing type
10
9
  */
11
- export declare const usePopoverTrigger: (props: PopoverTriggerProps, defaultProps?: PopoverTriggerProps | undefined) => PopoverTriggerState;
10
+ export declare const usePopoverTrigger: (props: PopoverTriggerProps) => PopoverTriggerState;