@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,19 +1,21 @@
1
- import { ComponentProps } from '@fluentui/react-utilities';
2
- import { ComponentState } from '@fluentui/react-utilities';
3
- import { Context } from '@fluentui/react-context-selector';
4
- import { ContextSelector } from '@fluentui/react-context-selector';
5
- import { PopperOptions } from '@fluentui/react-positioning';
6
- import { PopperVirtualElement } from '@fluentui/react-positioning';
7
- import { PortalProps } from '@fluentui/react-portal';
1
+ import type { ComponentProps } from '@fluentui/react-utilities';
2
+ import type { ComponentState } from '@fluentui/react-utilities';
3
+ import type { Context } from '@fluentui/react-context-selector';
4
+ import type { ContextSelector } from '@fluentui/react-context-selector';
5
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
6
+ import type { IntrinsicShorthandProps } from '@fluentui/react-utilities';
7
+ import type { PopperVirtualElement } from '@fluentui/react-positioning';
8
+ import type { PortalProps } from '@fluentui/react-portal';
9
+ import type { PositioningShorthand } from '@fluentui/react-positioning';
8
10
  import * as React_2 from 'react';
11
+ import type { usePopperMouseTarget } from '@fluentui/react-positioning';
9
12
 
10
13
  export declare const arrowHeights: Record<PopoverSize, number>;
11
14
 
12
15
  /**
13
16
  * Data attached to open/close events
14
17
  */
15
- export declare interface OnOpenChangeData extends Pick<PopoverState, 'open'> {
16
- }
18
+ export declare type OnOpenChangeData = Pick<PopoverState, 'open'>;
17
19
 
18
20
  /**
19
21
  * The supported events that will trigger open/close of the menu
@@ -21,32 +23,15 @@ export declare interface OnOpenChangeData extends Pick<PopoverState, 'open'> {
21
23
  export declare type OpenPopoverEvents = MouseEvent | TouchEvent | React_2.MouseEvent<HTMLElement> | React_2.KeyboardEvent<HTMLElement> | React_2.FocusEvent<HTMLElement>;
22
24
 
23
25
  /**
24
- * Popover component
26
+ * Wrapper component that manages state for a PopoverTrigger and a PopoverSurface components.
25
27
  */
26
28
  export declare const Popover: React_2.FC<PopoverProps>;
27
29
 
28
- export declare const PopoverContext: Context<PopoverContextValue>;
29
-
30
- /**
31
- * Context shared between Popover and its children components
32
- */
33
- export declare interface PopoverContextValue extends Pick<PopoverState, 'open' | 'setOpen' | 'triggerRef' | 'contentRef' | 'target' | 'openOnHover' | 'openOnContext' | 'mountNode' | 'noArrow' | 'arrowRef' | 'size' | 'brand' | 'inverted' | 'trapFocus'> {
34
- }
35
-
36
- /**
37
- * Names of PopoverProps that have a default value in usePopover
38
- */
39
- export declare type PopoverDefaultedProps = never;
40
-
41
- /**
42
- * Popover Props
43
- */
44
- export declare interface PopoverProps extends Pick<PopperOptions, 'position' | 'align' | 'offset' | 'coverTarget' | 'target'>, Pick<PortalProps, 'mountNode'> {
45
- children: React_2.ReactNode;
30
+ export declare type PopoverCommons = Pick<PortalProps, 'mountNode'> & {
46
31
  /**
47
32
  * Controls the opening of the Popover
48
33
  */
49
- open?: boolean;
34
+ open: boolean;
50
35
  /**
51
36
  * Used to set the initial open state of the Popover in uncontrolled mode
52
37
  */
@@ -74,25 +59,37 @@ export declare interface PopoverProps extends Pick<PopperOptions, 'position' | '
74
59
  */
75
60
  size?: PopoverSize;
76
61
  /**
77
- * Uses brand colour as background
78
- * Mutually exclusive with `inverted`
62
+ * A popover can appear styled with brand or inverted.
63
+ * When not specified, the default style is used.
79
64
  */
80
- brand?: boolean;
81
- /**
82
- * Inverts the foreground/background colour of the popover
83
- * Mutually exclusive with `brand`
84
- */
85
- inverted?: boolean;
65
+ appearance?: 'brand' | 'inverted';
86
66
  /**
87
67
  * Should trap focus
88
68
  */
89
69
  trapFocus?: boolean;
90
- }
70
+ /**
71
+ * Configures the position of the Popover
72
+ */
73
+ positioning?: PositioningShorthand;
74
+ };
75
+
76
+ export declare const PopoverContext: Context<PopoverContextValue>;
91
77
 
92
78
  /**
93
- * Names of the shorthand properties in PopoverProps
79
+ * Context shared between Popover and its children components
94
80
  */
95
- export declare type PopoverShorthandProps = never;
81
+ export declare type PopoverContextValue = Pick<PopoverState, 'open' | 'setOpen' | 'triggerRef' | 'contentRef' | 'openOnHover' | 'openOnContext' | 'mountNode' | 'noArrow' | 'arrowRef' | 'size' | 'appearance' | 'trapFocus'>;
82
+
83
+ /**
84
+ * Popover Props
85
+ */
86
+ export declare type PopoverProps = Partial<PopoverCommons> & {
87
+ /**
88
+ * Can contain two children including {@link PopoverTrigger} and {@link PopoverPopover}.
89
+ * Alternatively can only contain {@link PopoverPopover} if using a custom `target`.
90
+ */
91
+ children: [JSX.Element, JSX.Element] | JSX.Element;
92
+ };
96
93
 
97
94
  /**
98
95
  * Determines popover padding and arrow size
@@ -102,11 +99,7 @@ export declare type PopoverSize = 'small' | 'medium' | 'large';
102
99
  /**
103
100
  * Popover State
104
101
  */
105
- export declare interface PopoverState extends ComponentState<PopoverProps, PopoverShorthandProps, PopoverDefaultedProps> {
106
- /**
107
- * Open state of the Popover
108
- */
109
- open: boolean;
102
+ export declare type PopoverState = PopoverCommons & Pick<PopoverProps, 'children'> & {
110
103
  /**
111
104
  * Callback to open/close the Popover
112
105
  */
@@ -130,63 +123,55 @@ export declare interface PopoverState extends ComponentState<PopoverProps, Popov
130
123
  /**
131
124
  * A callback to set the target of the popper to the mouse click for context events
132
125
  */
133
- setContextTarget: React_2.Dispatch<PopperVirtualElement | undefined>;
126
+ setContextTarget: ReturnType<typeof usePopperMouseTarget>[1];
134
127
  size: NonNullable<PopoverProps['size']>;
135
- }
128
+ };
136
129
 
137
130
  /**
138
131
  * PopoverSurface component renders react children in a positioned box
139
132
  */
140
- export declare const PopoverSurface: React_2.ForwardRefExoticComponent<PopoverSurfaceProps & React_2.RefAttributes<HTMLElement>>;
141
-
142
- /**
143
- * Names of PopoverSurfaceProps that have a default value in usePopoverSurface
144
- */
145
- export declare type PopoverSurfaceDefaultedProps = never;
133
+ export declare const PopoverSurface: ForwardRefComponent<PopoverSurfaceProps>;
146
134
 
147
135
  /**
148
136
  * PopoverSurface Props
149
137
  */
150
- export declare interface PopoverSurfaceProps extends ComponentProps, React_2.HTMLAttributes<HTMLElement> {
151
- }
138
+ export declare type PopoverSurfaceProps = ComponentProps<PopoverSurfaceSlots>;
152
139
 
153
140
  /**
154
- * Names of the shorthand properties in PopoverSurfaceProps
141
+ * Names of the slots in PopoverSurfaceProps
155
142
  */
156
- export declare type PopoverSurfaceShorthandProps = never;
143
+ export declare type PopoverSurfaceSlots = {
144
+ root: IntrinsicShorthandProps<'div'>;
145
+ };
146
+
147
+ export declare const popoverSurfaceSlots: Array<keyof PopoverSurfaceSlots>;
157
148
 
158
149
  /**
159
150
  * PopoverSurface State
160
151
  */
161
- export declare interface PopoverSurfaceState extends ComponentState<PopoverSurfaceProps, PopoverSurfaceShorthandProps, PopoverSurfaceDefaultedProps>, Pick<PopoverContextValue, 'open' | 'mountNode' | 'noArrow' | 'size' | 'brand' | 'inverted'> {
162
- ref: React_2.Ref<HTMLElement>;
163
- /**
164
- * Ref to the arrow element
165
- */
166
- arrowRef?: React_2.Ref<HTMLDivElement>;
152
+ export declare type PopoverSurfaceState = ComponentState<PopoverSurfaceSlots> & Pick<PopoverContextValue, 'open' | 'mountNode' | 'noArrow' | 'size' | 'appearance' | 'arrowRef'> & {
167
153
  /**
168
154
  * CSS class for the arrow element
169
155
  */
170
156
  arrowClassName?: string;
171
- }
157
+ };
172
158
 
173
159
  /**
174
- * PopoverTrigger component
160
+ * Wraps a trigger element as an only child and adds the necessary event handling to open a popover.
175
161
  */
176
162
  export declare const PopoverTrigger: React_2.FC<PopoverTriggerProps>;
177
163
 
178
164
  /**
179
165
  * PopoverTrigger Props
180
166
  */
181
- export declare interface PopoverTriggerProps {
167
+ export declare type PopoverTriggerProps = {
182
168
  children: React_2.ReactElement;
183
- }
169
+ };
184
170
 
185
171
  /**
186
172
  * PopoverTrigger State
187
173
  */
188
- export declare interface PopoverTriggerState extends PopoverTriggerProps {
189
- }
174
+ export declare type PopoverTriggerState = PopoverTriggerProps;
190
175
 
191
176
  /**
192
177
  * Render the final JSX of Popover
@@ -210,11 +195,10 @@ export declare const renderPopoverTrigger: (state: PopoverTriggerState) => JSX.E
210
195
  * before being passed to renderPopover.
211
196
  *
212
197
  * @param props - props from this instance of Popover
213
- * @param defaultProps - (optional) default prop values provided by the implementing type
214
198
  */
215
- export declare const usePopover: (props: PopoverProps, defaultProps?: PopoverProps | undefined) => PopoverState;
199
+ export declare const usePopover: (props: PopoverProps) => PopoverState;
216
200
 
217
- export declare const usePopoverContext: <T>(selector: ContextSelector<PopoverContextValue, T>) => T;
201
+ export declare const usePopoverContext: <T>(selector: ContextSelector<Pick<PopoverState, "mountNode" | "open" | "setOpen" | "triggerRef" | "contentRef" | "openOnHover" | "openOnContext" | "noArrow" | "arrowRef" | "size" | "appearance" | "trapFocus">, T>) => T;
218
202
 
219
203
  /**
220
204
  * Create the state required to render PopoverSurface.
@@ -223,10 +207,9 @@ export declare const usePopoverContext: <T>(selector: ContextSelector<PopoverCon
223
207
  * before being passed to renderPopoverSurface.
224
208
  *
225
209
  * @param props - props from this instance of PopoverSurface
226
- * @param ref - reference to root HTMLElement of PopoverSurface
227
- * @param defaultProps - (optional) default prop values provided by the implementing type
210
+ * @param ref - reference to root HTMLDivElement of PopoverSurface
228
211
  */
229
- export declare const usePopoverSurface: (props: PopoverSurfaceProps, ref: React_2.Ref<HTMLElement>, defaultProps?: PopoverSurfaceProps | undefined) => PopoverSurfaceState;
212
+ export declare const usePopoverSurface: (props: PopoverSurfaceProps, ref: React_2.Ref<HTMLDivElement>) => PopoverSurfaceState;
230
213
 
231
214
  /**
232
215
  * Apply styling to the PopoverSurface slots based on the state
@@ -240,8 +223,7 @@ export declare const usePopoverSurfaceStyles: (state: PopoverSurfaceState) => Po
240
223
  * before being passed to renderPopoverTrigger.
241
224
  *
242
225
  * @param props - props from this instance of PopoverTrigger
243
- * @param defaultProps - (optional) default prop values provided by the implementing type
244
226
  */
245
- export declare const usePopoverTrigger: (props: PopoverTriggerProps, defaultProps?: PopoverTriggerProps | undefined) => PopoverTriggerState;
227
+ export declare const usePopoverTrigger: (props: PopoverTriggerProps) => PopoverTriggerState;
246
228
 
247
229
  export { }
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","sourceRoot":"../src/","sources":["Popover.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './components/Popover/index';\n"]}
1
+ {"version":3,"file":"Popover.js","sourceRoot":"","sources":["../src/Popover.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverSurface.js","sourceRoot":"../src/","sources":["PopoverSurface.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC","sourcesContent":["export * from './components/PopoverSurface/index';\n"]}
1
+ {"version":3,"file":"PopoverSurface.js","sourceRoot":"","sources":["../src/PopoverSurface.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverTrigger.js","sourceRoot":"../src/","sources":["PopoverTrigger.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC","sourcesContent":["export * from './components/PopoverTrigger/index';\n"]}
1
+ {"version":3,"file":"PopoverTrigger.js","sourceRoot":"","sources":["../src/PopoverTrigger.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { IsConformantOptions } from '@fluentui/react-conformance';
1
+ import type { IsConformantOptions } from '@fluentui/react-conformance';
2
2
  export declare function isConformant<TProps = {}>(testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & {
3
3
  componentPath?: string;
4
4
  }): void;
@@ -1,9 +1,13 @@
1
1
  import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
2
+ import makeStylesTests from '@fluentui/react-conformance-make-styles';
2
3
  export function isConformant(testInfo) {
3
- var defaultOptions = {
4
- asPropHandlesRef: true,
5
- componentPath: module.parent.filename.replace('.test', ''),
6
- };
7
- baseIsConformant(defaultOptions, testInfo);
4
+ var defaultOptions = {
5
+ asPropHandlesRef: true,
6
+ componentPath: module.parent.filename.replace('.test', ''),
7
+ // TODO // https://github.com/microsoft/fluentui/issues/19522
8
+ skipAsPropTests: true,
9
+ extraTests: makeStylesTests
10
+ };
11
+ baseIsConformant(defaultOptions, testInfo);
8
12
  }
9
13
  //# sourceMappingURL=isConformant.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isConformant.js","sourceRoot":"../src/","sources":["common/isConformant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAuB,MAAM,6BAA6B,CAAC;AAEpG,MAAM,UAAU,YAAY,CAC1B,QAAyF;IAEzF,IAAM,cAAc,GAAyC;QAC3D,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,MAAO,CAAC,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;KAC7D,CAAC;IAEF,gBAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["import { isConformant as baseIsConformant, IsConformantOptions } from '@fluentui/react-conformance';\n\nexport function isConformant<TProps = {}>(\n testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & { componentPath?: string },\n) {\n const defaultOptions: Partial<IsConformantOptions<TProps>> = {\n asPropHandlesRef: true,\n componentPath: module!.parent!.filename.replace('.test', ''),\n };\n\n baseIsConformant(defaultOptions, testInfo);\n}\n"]}
1
+ {"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AAEA,OAAO,eAAP,MAA4B,yCAA5B;AAEA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D;AACA,IAAA,eAAe,EAAE,IAJ0C;AAK3D,IAAA,UAAU,EAAE;AAL+C,GAA7D;AAQA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","sourceRoot":""}
@@ -1,4 +1,4 @@
1
- import { PopoverContextValue } from '../popoverContext';
1
+ import type { PopoverContextValue } from '../popoverContext';
2
2
  /**
3
3
  * A test utility to mock the usePopoverContext hook that relies on context selector
4
4
  * Don't forget to call `jest.mock(**\/popupContext.ts)` while using this
@@ -5,12 +5,34 @@ import { usePopoverContext } from '../popoverContext';
5
5
  * Don't forget to call `jest.mock(**\/popupContext.ts)` while using this
6
6
  * @param options Popover context values to set for testing
7
7
  */
8
+
8
9
  export var mockPopoverContext = function (options) {
9
- if (options === void 0) { options = {}; }
10
- var mockContext = __assign({ open: false, setOpen: function () { return null; }, triggerRef: { current: null }, contentRef: { current: null }, arrowRef: { current: null }, target: undefined, openOnContext: false, openOnHover: false, size: 'medium' }, options);
11
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
- usePopoverContext.mockImplementation(function (selector) {
13
- return selector(mockContext);
14
- });
10
+ if (options === void 0) {
11
+ options = {};
12
+ }
13
+
14
+ var mockContext = __assign({
15
+ open: false,
16
+ setOpen: function () {
17
+ return null;
18
+ },
19
+ triggerRef: {
20
+ current: null
21
+ },
22
+ contentRef: {
23
+ current: null
24
+ },
25
+ arrowRef: {
26
+ current: null
27
+ },
28
+ openOnContext: false,
29
+ openOnHover: false,
30
+ size: 'medium'
31
+ }, options); // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
+
33
+
34
+ usePopoverContext.mockImplementation(function (selector) {
35
+ return selector(mockContext);
36
+ });
15
37
  };
16
38
  //# sourceMappingURL=mockUsePopoverContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mockUsePopoverContext.js","sourceRoot":"../src/","sources":["common/mockUsePopoverContext.ts"],"names":[],"mappings":";AAAA,OAAO,EAAuB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3E;;;;GAIG;AACH,MAAM,CAAC,IAAM,kBAAkB,GAAG,UAAC,OAA0C;IAA1C,wBAAA,EAAA,YAA0C;IAC3E,IAAM,WAAW,cACf,IAAI,EAAE,KAAK,EACX,OAAO,EAAE,cAAM,OAAA,IAAI,EAAJ,CAAI,EACnB,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAC7B,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAC7B,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAC3B,MAAM,EAAE,SAAS,EACjB,aAAa,EAAE,KAAK,EACpB,WAAW,EAAE,KAAK,EAClB,IAAI,EAAE,QAAQ,IACX,OAAO,CACX,CAAC;IACF,8DAA8D;IAC7D,iBAA+B,CAAC,kBAAkB,CAAC,UAAC,QAA+C;QAClG,OAAO,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { PopoverContextValue, usePopoverContext } from '../popoverContext';\n\n/**\n * A test utility to mock the usePopoverContext hook that relies on context selector\n * Don't forget to call `jest.mock(**\\/popupContext.ts)` while using this\n * @param options Popover context values to set for testing\n */\nexport const mockPopoverContext = (options: Partial<PopoverContextValue> = {}) => {\n const mockContext: PopoverContextValue = {\n open: false,\n setOpen: () => null,\n triggerRef: { current: null },\n contentRef: { current: null },\n arrowRef: { current: null },\n target: undefined,\n openOnContext: false,\n openOnHover: false,\n size: 'medium',\n ...options,\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (usePopoverContext as jest.Mock).mockImplementation((selector: (context: PopoverContextValue) => any) => {\n return selector(mockContext);\n });\n};\n"]}
1
+ {"version":3,"sources":["../../src/common/mockUsePopoverContext.ts"],"names":[],"mappings":";AAAA,SAAS,iBAAT,QAAkC,mBAAlC;AAGA;;;;AAIG;;AACH,OAAO,IAAM,kBAAkB,GAAG,UAAC,OAAD,EAA2C;AAA1C,MAAA,OAAA,KAAA,KAAA,CAAA,EAAA;AAAA,IAAA,OAAA,GAAA,EAAA;AAA0C;;AAC3E,MAAM,WAAW,GAAA,QAAA,CAAA;AACf,IAAA,IAAI,EAAE,KADS;AAEf,IAAA,OAAO,EAAE,YAAA;AAAM,aAAA,IAAA;AAAI,KAFJ;AAGf,IAAA,UAAU,EAAE;AAAE,MAAA,OAAO,EAAE;AAAX,KAHG;AAIf,IAAA,UAAU,EAAE;AAAE,MAAA,OAAO,EAAE;AAAX,KAJG;AAKf,IAAA,QAAQ,EAAE;AAAE,MAAA,OAAO,EAAE;AAAX,KALK;AAMf,IAAA,aAAa,EAAE,KANA;AAOf,IAAA,WAAW,EAAE,KAPE;AAQf,IAAA,IAAI,EAAE;AARS,GAAA,EASZ,OATY,CAAjB,CAD2E,CAY3E;;;AACC,EAAA,iBAA+B,CAAC,kBAAhC,CAAmD,UAAC,QAAD,EAAgD;AAClG,WAAO,QAAQ,CAAC,WAAD,CAAf;AACD,GAFA;AAGF,CAhBM","sourceRoot":""}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { PopoverProps } from './Popover.types';
2
+ import type { PopoverProps } from './Popover.types';
3
3
  /**
4
- * Popover component
4
+ * Wrapper component that manages state for a PopoverTrigger and a PopoverSurface components.
5
5
  */
6
6
  export declare const Popover: React.FC<PopoverProps>;
@@ -1,11 +1,12 @@
1
1
  import { usePopover } from './usePopover';
2
2
  import { renderPopover } from './renderPopover';
3
3
  /**
4
- * Popover component
4
+ * Wrapper component that manages state for a PopoverTrigger and a PopoverSurface components.
5
5
  */
6
+
6
7
  export var Popover = function (props) {
7
- var state = usePopover(props);
8
- return renderPopover(state);
8
+ var state = usePopover(props);
9
+ return renderPopover(state);
9
10
  };
10
11
  Popover.displayName = 'Popover';
11
12
  //# sourceMappingURL=Popover.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","sourceRoot":"../src/","sources":["components/Popover/Popover.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,IAAM,OAAO,GAA2B,UAAA,KAAK;IAClD,IAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAEhC,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC","sourcesContent":["import * as React from 'react';\nimport { usePopover } from './usePopover';\nimport { PopoverProps } from './Popover.types';\nimport { renderPopover } from './renderPopover';\n\n/**\n * Popover component\n */\nexport const Popover: React.FC<PopoverProps> = props => {\n const state = usePopover(props);\n\n return renderPopover(state);\n};\n\nPopover.displayName = 'Popover';\n"]}
1
+ {"version":3,"sources":["../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":"AACA,SAAS,UAAT,QAA2B,cAA3B;AACA,SAAS,aAAT,QAA8B,iBAA9B;AAGA;;AAEG;;AACH,OAAO,IAAM,OAAO,GAA2B,UAAA,KAAA,EAAK;AAClD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAD,CAAxB;AAEA,SAAO,aAAa,CAAC,KAAD,CAApB;AACD,CAJM;AAMP,OAAO,CAAC,WAAR,GAAsB,SAAtB","sourceRoot":""}
@@ -1,20 +1,15 @@
1
1
  import * as React from 'react';
2
- import { PopperOptions, PopperVirtualElement } from '@fluentui/react-positioning';
3
- import { PortalProps } from '@fluentui/react-portal';
4
- import { ComponentState } from '@fluentui/react-utilities';
2
+ import type { PopperVirtualElement, PositioningShorthand, usePopperMouseTarget } from '@fluentui/react-positioning';
3
+ import type { PortalProps } from '@fluentui/react-portal';
5
4
  /**
6
5
  * Determines popover padding and arrow size
7
6
  */
8
7
  export declare type PopoverSize = 'small' | 'medium' | 'large';
9
- /**
10
- * Popover Props
11
- */
12
- export interface PopoverProps extends Pick<PopperOptions, 'position' | 'align' | 'offset' | 'coverTarget' | 'target'>, Pick<PortalProps, 'mountNode'> {
13
- children: React.ReactNode;
8
+ export declare type PopoverCommons = Pick<PortalProps, 'mountNode'> & {
14
9
  /**
15
10
  * Controls the opening of the Popover
16
11
  */
17
- open?: boolean;
12
+ open: boolean;
18
13
  /**
19
14
  * Used to set the initial open state of the Popover in uncontrolled mode
20
15
  */
@@ -42,36 +37,33 @@ export interface PopoverProps extends Pick<PopperOptions, 'position' | 'align' |
42
37
  */
43
38
  size?: PopoverSize;
44
39
  /**
45
- * Uses brand colour as background
46
- * Mutually exclusive with `inverted`
40
+ * A popover can appear styled with brand or inverted.
41
+ * When not specified, the default style is used.
47
42
  */
48
- brand?: boolean;
49
- /**
50
- * Inverts the foreground/background colour of the popover
51
- * Mutually exclusive with `brand`
52
- */
53
- inverted?: boolean;
43
+ appearance?: 'brand' | 'inverted';
54
44
  /**
55
45
  * Should trap focus
56
46
  */
57
47
  trapFocus?: boolean;
58
- }
59
- /**
60
- * Names of the shorthand properties in PopoverProps
61
- */
62
- export declare type PopoverShorthandProps = never;
48
+ /**
49
+ * Configures the position of the Popover
50
+ */
51
+ positioning?: PositioningShorthand;
52
+ };
63
53
  /**
64
- * Names of PopoverProps that have a default value in usePopover
54
+ * Popover Props
65
55
  */
66
- export declare type PopoverDefaultedProps = never;
56
+ export declare type PopoverProps = Partial<PopoverCommons> & {
57
+ /**
58
+ * Can contain two children including {@link PopoverTrigger} and {@link PopoverPopover}.
59
+ * Alternatively can only contain {@link PopoverPopover} if using a custom `target`.
60
+ */
61
+ children: [JSX.Element, JSX.Element] | JSX.Element;
62
+ };
67
63
  /**
68
64
  * Popover State
69
65
  */
70
- export interface PopoverState extends ComponentState<PopoverProps, PopoverShorthandProps, PopoverDefaultedProps> {
71
- /**
72
- * Open state of the Popover
73
- */
74
- open: boolean;
66
+ export declare type PopoverState = PopoverCommons & Pick<PopoverProps, 'children'> & {
75
67
  /**
76
68
  * Callback to open/close the Popover
77
69
  */
@@ -95,14 +87,13 @@ export interface PopoverState extends ComponentState<PopoverProps, PopoverShorth
95
87
  /**
96
88
  * A callback to set the target of the popper to the mouse click for context events
97
89
  */
98
- setContextTarget: React.Dispatch<PopperVirtualElement | undefined>;
90
+ setContextTarget: ReturnType<typeof usePopperMouseTarget>[1];
99
91
  size: NonNullable<PopoverProps['size']>;
100
- }
92
+ };
101
93
  /**
102
94
  * Data attached to open/close events
103
95
  */
104
- export interface OnOpenChangeData extends Pick<PopoverState, 'open'> {
105
- }
96
+ export declare type OnOpenChangeData = Pick<PopoverState, 'open'>;
106
97
  /**
107
98
  * The supported events that will trigger open/close of the menu
108
99
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.types.js","sourceRoot":"../src/","sources":["components/Popover/Popover.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { PopperOptions, PopperVirtualElement } from '@fluentui/react-positioning';\nimport { PortalProps } from '@fluentui/react-portal';\nimport { ComponentState } from '@fluentui/react-utilities';\n\n/**\n * Determines popover padding and arrow size\n */\nexport type PopoverSize = 'small' | 'medium' | 'large';\n\n/**\n * Popover Props\n */\nexport interface PopoverProps\n extends Pick<PopperOptions, 'position' | 'align' | 'offset' | 'coverTarget' | 'target'>,\n Pick<PortalProps, 'mountNode'> {\n children: React.ReactNode;\n /**\n * Controls the opening of the Popover\n */\n open?: boolean;\n /**\n * Used to set the initial open state of the Popover in uncontrolled mode\n */\n defaultOpen?: boolean;\n /**\n * Call back when the component requests to change value\n * The `open` value is used as a hint when directly controlling the component\n */\n onOpenChange?: (e: OpenPopoverEvents, data: OnOpenChangeData) => void;\n /**\n * Flag to open the Popover by hovering the trigger\n */\n openOnHover?: boolean;\n /**\n * Flag to open the Popover as a context menu. Disables all other interactions\n */\n openOnContext?: boolean;\n /**\n * Do not display the arrow\n */\n noArrow?: boolean;\n /**\n * Determines popover padding and arrow size\n * @default medium\n */\n size?: PopoverSize;\n /**\n * Uses brand colour as background\n * Mutually exclusive with `inverted`\n */\n brand?: boolean;\n /**\n * Inverts the foreground/background colour of the popover\n * Mutually exclusive with `brand`\n */\n inverted?: boolean;\n\n /**\n * Should trap focus\n */\n trapFocus?: boolean;\n}\n\n/**\n * Names of the shorthand properties in PopoverProps\n */\nexport type PopoverShorthandProps = never;\n\n/**\n * Names of PopoverProps that have a default value in usePopover\n */\nexport type PopoverDefaultedProps = never;\n\n/**\n * Popover State\n */\nexport interface PopoverState extends ComponentState<PopoverProps, PopoverShorthandProps, PopoverDefaultedProps> {\n /**\n * Open state of the Popover\n */\n open: boolean;\n /**\n * Callback to open/close the Popover\n */\n setOpen: (e: OpenPopoverEvents, open: boolean) => void;\n /**\n * Ref of the PopoverTrigger\n */\n triggerRef: React.MutableRefObject<HTMLElement | null>;\n /**\n * Ref of the PopoverSurface\n */\n contentRef: React.MutableRefObject<HTMLElement | null>;\n /**\n * Ref of the pointing arrow\n */\n arrowRef: React.MutableRefObject<HTMLDivElement | null>;\n /**\n * Anchors the popper to the mouse click for context events\n */\n contextTarget: PopperVirtualElement | undefined;\n /**\n * A callback to set the target of the popper to the mouse click for context events\n */\n setContextTarget: React.Dispatch<PopperVirtualElement | undefined>;\n\n size: NonNullable<PopoverProps['size']>;\n}\n\n/**\n * Data attached to open/close events\n */\nexport interface OnOpenChangeData extends Pick<PopoverState, 'open'> {}\n\n/**\n * The supported events that will trigger open/close of the menu\n */\nexport type OpenPopoverEvents =\n | MouseEvent\n | TouchEvent\n | React.MouseEvent<HTMLElement>\n | React.KeyboardEvent<HTMLElement>\n | React.FocusEvent<HTMLElement>;\n"]}
1
+ {"version":3,"file":"Popover.types.js","sourceRoot":"","sources":["../../../src/components/Popover/Popover.types.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Popover/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC","sourcesContent":["export * from './Popover';\nexport * from './Popover.types';\nexport * from './renderPopover';\nexport * from './usePopover';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Popover/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
@@ -1,4 +1,4 @@
1
- import { PopoverState } from './Popover.types';
1
+ import type { PopoverState } from './Popover.types';
2
2
  /**
3
3
  * Render the final JSX of Popover
4
4
  */
@@ -3,23 +3,35 @@ import { PopoverContext } from '../../popoverContext';
3
3
  /**
4
4
  * Render the final JSX of Popover
5
5
  */
6
+
6
7
  export var renderPopover = function (state) {
7
- var open = state.open, setOpen = state.setOpen, triggerRef = state.triggerRef, contentRef = state.contentRef, target = state.target, openOnContext = state.openOnContext, openOnHover = state.openOnHover, mountNode = state.mountNode, arrowRef = state.arrowRef, size = state.size, noArrow = state.noArrow, brand = state.brand, inverted = state.inverted, trapFocus = state.trapFocus;
8
- return (React.createElement(PopoverContext.Provider, { value: {
9
- open: open,
10
- setOpen: setOpen,
11
- triggerRef: triggerRef,
12
- contentRef: contentRef,
13
- target: target,
14
- openOnHover: openOnHover,
15
- openOnContext: openOnContext,
16
- mountNode: mountNode,
17
- arrowRef: arrowRef,
18
- size: size,
19
- noArrow: noArrow,
20
- brand: brand,
21
- inverted: inverted,
22
- trapFocus: trapFocus,
23
- } }, state.children));
8
+ var open = state.open,
9
+ setOpen = state.setOpen,
10
+ triggerRef = state.triggerRef,
11
+ contentRef = state.contentRef,
12
+ openOnContext = state.openOnContext,
13
+ openOnHover = state.openOnHover,
14
+ mountNode = state.mountNode,
15
+ arrowRef = state.arrowRef,
16
+ size = state.size,
17
+ noArrow = state.noArrow,
18
+ appearance = state.appearance,
19
+ trapFocus = state.trapFocus;
20
+ return /*#__PURE__*/React.createElement(PopoverContext.Provider, {
21
+ value: {
22
+ open: open,
23
+ setOpen: setOpen,
24
+ triggerRef: triggerRef,
25
+ contentRef: contentRef,
26
+ openOnHover: openOnHover,
27
+ openOnContext: openOnContext,
28
+ mountNode: mountNode,
29
+ arrowRef: arrowRef,
30
+ size: size,
31
+ noArrow: noArrow,
32
+ appearance: appearance,
33
+ trapFocus: trapFocus
34
+ }
35
+ }, state.children);
24
36
  };
25
37
  //# sourceMappingURL=renderPopover.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderPopover.js","sourceRoot":"../src/","sources":["components/Popover/renderPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD;;GAEG;AACH,MAAM,CAAC,IAAM,aAAa,GAAG,UAAC,KAAmB;IAE7C,IAAA,IAAI,GAcF,KAAK,KAdH,EACJ,OAAO,GAaL,KAAK,QAbA,EACP,UAAU,GAYR,KAAK,WAZG,EACV,UAAU,GAWR,KAAK,WAXG,EACV,MAAM,GAUJ,KAAK,OAVD,EACN,aAAa,GASX,KAAK,cATM,EACb,WAAW,GAQT,KAAK,YARI,EACX,SAAS,GAOP,KAAK,UAPE,EACT,QAAQ,GAMN,KAAK,SANC,EACR,IAAI,GAKF,KAAK,KALH,EACJ,OAAO,GAIL,KAAK,QAJA,EACP,KAAK,GAGH,KAAK,MAHF,EACL,QAAQ,GAEN,KAAK,SAFC,EACR,SAAS,GACP,KAAK,UADE,CACD;IAEV,OAAO,CACL,oBAAC,cAAc,CAAC,QAAQ,IACtB,KAAK,EAAE;YACL,IAAI,MAAA;YACJ,OAAO,SAAA;YACP,UAAU,YAAA;YACV,UAAU,YAAA;YACV,MAAM,QAAA;YACN,WAAW,aAAA;YACX,aAAa,eAAA;YACb,SAAS,WAAA;YACT,QAAQ,UAAA;YACR,IAAI,MAAA;YACJ,OAAO,SAAA;YACP,KAAK,OAAA;YACL,QAAQ,UAAA;YACR,SAAS,WAAA;SACV,IAEA,KAAK,CAAC,QAAQ,CACS,CAC3B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { PopoverContext } from '../../popoverContext';\nimport { PopoverState } from './Popover.types';\n\n/**\n * Render the final JSX of Popover\n */\nexport const renderPopover = (state: PopoverState) => {\n const {\n open,\n setOpen,\n triggerRef,\n contentRef,\n target,\n openOnContext,\n openOnHover,\n mountNode,\n arrowRef,\n size,\n noArrow,\n brand,\n inverted,\n trapFocus,\n } = state;\n\n return (\n <PopoverContext.Provider\n value={{\n open,\n setOpen,\n triggerRef,\n contentRef,\n target,\n openOnHover,\n openOnContext,\n mountNode,\n arrowRef,\n size,\n noArrow,\n brand,\n inverted,\n trapFocus,\n }}\n >\n {state.children}\n </PopoverContext.Provider>\n );\n};\n"]}
1
+ {"version":3,"sources":["../../../src/components/Popover/renderPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,cAAT,QAA+B,sBAA/B;AAGA;;AAEG;;AACH,OAAO,IAAM,aAAa,GAAG,UAAC,KAAD,EAAoB;AAE7C,MAAA,IAAI,GAYF,KAAK,CAZH,IAAJ;AAAA,MACA,OAAO,GAWL,KAAK,CAXA,OADP;AAAA,MAEA,UAAU,GAUR,KAAK,CAVG,UAFV;AAAA,MAGA,UAAU,GASR,KAAK,CATG,UAHV;AAAA,MAIA,aAAa,GAQX,KAAK,CARM,aAJb;AAAA,MAKA,WAAW,GAOT,KAAK,CAPI,WALX;AAAA,MAMA,SAAS,GAMP,KAAK,CANE,SANT;AAAA,MAOA,QAAQ,GAKN,KAAK,CALC,QAPR;AAAA,MAQA,IAAI,GAIF,KAAK,CAJH,IARJ;AAAA,MASA,OAAO,GAGL,KAAK,CAHA,OATP;AAAA,MAUA,UAAU,GAER,KAAK,CAFG,UAVV;AAAA,MAWA,SAAS,GACP,KAAK,CADE,SAXT;AAcF,sBACE,KAAA,CAAA,aAAA,CAAC,cAAc,CAAC,QAAhB,EAAwB;AACtB,IAAA,KAAK,EAAE;AACL,MAAA,IAAI,EAAA,IADC;AAEL,MAAA,OAAO,EAAA,OAFF;AAGL,MAAA,UAAU,EAAA,UAHL;AAIL,MAAA,UAAU,EAAA,UAJL;AAKL,MAAA,WAAW,EAAA,WALN;AAML,MAAA,aAAa,EAAA,aANR;AAOL,MAAA,SAAS,EAAA,SAPJ;AAQL,MAAA,QAAQ,EAAA,QARH;AASL,MAAA,IAAI,EAAA,IATC;AAUL,MAAA,OAAO,EAAA,OAVF;AAWL,MAAA,UAAU,EAAA,UAXL;AAYL,MAAA,SAAS,EAAA;AAZJ;AADe,GAAxB,EAgBG,KAAK,CAAC,QAhBT,CADF;AAoBD,CApCM","sourceRoot":""}
@@ -1,4 +1,4 @@
1
- import { PopoverProps, PopoverState } from './Popover.types';
1
+ import type { PopoverProps, PopoverState } from './Popover.types';
2
2
  /**
3
3
  * Create the state required to render Popover.
4
4
  *
@@ -6,6 +6,5 @@ import { PopoverProps, PopoverState } from './Popover.types';
6
6
  * before being passed to renderPopover.
7
7
  *
8
8
  * @param props - props from this instance of Popover
9
- * @param defaultProps - (optional) default prop values provided by the implementing type
10
9
  */
11
- export declare const usePopover: (props: PopoverProps, defaultProps?: PopoverProps | undefined) => PopoverState;
10
+ export declare const usePopover: (props: PopoverProps) => PopoverState;