@instructure/ui-popover 8.8.1-snapshot.7 → 8.9.1-snapshot.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-popover",
3
- "version": "8.8.1-snapshot.7+90b251d58",
3
+ "version": "8.9.1-snapshot.2+7f5faa3df",
4
4
  "description": "A component for hiding or showing content based on user interaction.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -25,28 +25,28 @@
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
27
  "@babel/runtime": "^7.13.10",
28
- "@instructure/console": "8.8.1-snapshot.7+90b251d58",
29
- "@instructure/emotion": "8.8.1-snapshot.7+90b251d58",
30
- "@instructure/ui-a11y-utils": "8.8.1-snapshot.7+90b251d58",
31
- "@instructure/ui-dialog": "8.8.1-snapshot.7+90b251d58",
32
- "@instructure/ui-dom-utils": "8.8.1-snapshot.7+90b251d58",
33
- "@instructure/ui-i18n": "8.8.1-snapshot.7+90b251d58",
34
- "@instructure/ui-position": "8.8.1-snapshot.7+90b251d58",
35
- "@instructure/ui-prop-types": "8.8.1-snapshot.7+90b251d58",
36
- "@instructure/ui-react-utils": "8.8.1-snapshot.7+90b251d58",
37
- "@instructure/ui-testable": "8.8.1-snapshot.7+90b251d58",
38
- "@instructure/ui-utils": "8.8.1-snapshot.7+90b251d58",
39
- "@instructure/ui-view": "8.8.1-snapshot.7+90b251d58",
40
- "@instructure/uid": "8.8.1-snapshot.7+90b251d58",
28
+ "@instructure/console": "8.9.1-snapshot.2+7f5faa3df",
29
+ "@instructure/emotion": "8.9.1-snapshot.2+7f5faa3df",
30
+ "@instructure/ui-a11y-utils": "8.9.1-snapshot.2+7f5faa3df",
31
+ "@instructure/ui-dialog": "8.9.1-snapshot.2+7f5faa3df",
32
+ "@instructure/ui-dom-utils": "8.9.1-snapshot.2+7f5faa3df",
33
+ "@instructure/ui-i18n": "8.9.1-snapshot.2+7f5faa3df",
34
+ "@instructure/ui-position": "8.9.1-snapshot.2+7f5faa3df",
35
+ "@instructure/ui-prop-types": "8.9.1-snapshot.2+7f5faa3df",
36
+ "@instructure/ui-react-utils": "8.9.1-snapshot.2+7f5faa3df",
37
+ "@instructure/ui-testable": "8.9.1-snapshot.2+7f5faa3df",
38
+ "@instructure/ui-utils": "8.9.1-snapshot.2+7f5faa3df",
39
+ "@instructure/ui-view": "8.9.1-snapshot.2+7f5faa3df",
40
+ "@instructure/uid": "8.9.1-snapshot.2+7f5faa3df",
41
41
  "keycode": "^2",
42
42
  "prop-types": "^15"
43
43
  },
44
44
  "devDependencies": {
45
- "@instructure/ui-babel-preset": "8.8.1-snapshot.7+90b251d58",
46
- "@instructure/ui-color-utils": "8.8.1-snapshot.7+90b251d58",
47
- "@instructure/ui-test-locator": "8.8.1-snapshot.7+90b251d58",
48
- "@instructure/ui-test-queries": "8.8.1-snapshot.7+90b251d58",
49
- "@instructure/ui-test-utils": "8.8.1-snapshot.7+90b251d58"
45
+ "@instructure/ui-babel-preset": "8.9.1-snapshot.2+7f5faa3df",
46
+ "@instructure/ui-color-utils": "8.9.1-snapshot.2+7f5faa3df",
47
+ "@instructure/ui-test-locator": "8.9.1-snapshot.2+7f5faa3df",
48
+ "@instructure/ui-test-queries": "8.9.1-snapshot.2+7f5faa3df",
49
+ "@instructure/ui-test-utils": "8.9.1-snapshot.2+7f5faa3df"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "react": ">=16.8 <=17"
@@ -55,5 +55,5 @@
55
55
  "access": "public"
56
56
  },
57
57
  "sideEffects": false,
58
- "gitHead": "90b251d580c75205b6cbb884fe922059cfc494dd"
58
+ "gitHead": "7f5faa3df83667636304e0901ef1008d98dffc9a"
59
59
  }
@@ -23,19 +23,16 @@
23
23
  */
24
24
 
25
25
  import React, { Component } from 'react'
26
- import PropTypes from 'prop-types'
27
26
  import keycode from 'keycode'
28
27
 
29
28
  import {
30
29
  Position,
31
- PositionPropTypes,
32
30
  parsePlacement,
33
31
  mirrorHorizontalPlacement
34
32
  } from '@instructure/ui-position'
35
33
  import { ContextView, View } from '@instructure/ui-view'
36
34
  import { Dialog } from '@instructure/ui-dialog'
37
35
  import { bidirectional } from '@instructure/ui-i18n'
38
- import { element } from '@instructure/ui-prop-types'
39
36
  import {
40
37
  findDOMNode,
41
38
  containsActiveElement,
@@ -48,11 +45,11 @@ import { safeCloneElement, callRenderProp } from '@instructure/ui-react-utils'
48
45
  import { createChainedFunction, shallowEqual, px } from '@instructure/ui-utils'
49
46
  import { logError as error } from '@instructure/console'
50
47
  import { uid } from '@instructure/uid'
51
- import { ThemeablePropTypes } from '@instructure/emotion'
52
48
  import { testable } from '@instructure/ui-testable'
53
49
 
54
50
  import { FocusRegion } from '@instructure/ui-a11y-utils'
55
- import { PopoverProps } from './types'
51
+ import type { PopoverProps } from './props'
52
+ import { allowedProps, propTypes } from './props'
56
53
 
57
54
  /**
58
55
  ---
@@ -65,192 +62,10 @@ tags: overlay, portal, dialog
65
62
  class Popover extends Component<PopoverProps> {
66
63
  static readonly componentId = 'Popover'
67
64
 
68
- static propTypes = {
69
- /**
70
- * Whether or not the `<Popover />` content is shown
71
- */
72
- isShowingContent: PropTypes.bool,
73
- /**
74
- * Whether or not to show the content by default, when uncontrolled
75
- */
76
- defaultIsShowingContent: PropTypes.bool,
77
- /**
78
- * The action that causes the content to display (`click`, `hover`, `focus`)
79
- */
80
- on: PropTypes.oneOfType([
81
- PropTypes.oneOf(['click', 'hover', 'focus']),
82
- PropTypes.arrayOf(PropTypes.oneOf(['click', 'hover', 'focus']))
83
- ]),
84
- /**
85
- * Whether or not an arrow pointing to the trigger should be rendered
86
- */
87
- withArrow: PropTypes.bool,
88
- /**
89
- * Color variant of the popover content
90
- */
91
- color: PropTypes.oneOf(['primary', 'primary-inverse']),
92
- /**
93
- * The placement of the content in relation to the trigger
94
- */
95
- placement: PositionPropTypes.placement,
96
- /**
97
- * Controls the shadow depth for the `<Popover />`
98
- */
99
- shadow: ThemeablePropTypes.shadow,
100
- /**
101
- * Controls the z-index depth for the `<Popover />` content
102
- */
103
- stacking: ThemeablePropTypes.stacking,
104
- /**
105
- * A function that returns a reference to the content element
106
- */
107
- contentRef: PropTypes.func,
108
- /**
109
- * An element or a function returning an element to focus by default
110
- */
111
- defaultFocusElement: PropTypes.oneOfType([
112
- PropTypes.element,
113
- PropTypes.func
114
- ]),
115
- /**
116
- * An accessible label for the `<Popover />` content
117
- */
118
- screenReaderLabel: PropTypes.string,
119
- /**
120
- * The horizontal offset for the positioned content
121
- */
122
- offsetX: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
123
- /**
124
- * The vertical offset for the positioned content
125
- */
126
- offsetY: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
127
- /**
128
- * The parent in which to constrain the popover.
129
- * One of: 'window', 'scroll-parent', 'parent', 'none', an element,
130
- * or a function returning an element
131
- */
132
- constrain: PositionPropTypes.constrain,
133
- /**
134
- * Target element for positioning the Popover (if it differs from the trigger)
135
- */
136
- positionTarget: PropTypes.oneOfType([element, PropTypes.func]),
137
- /**
138
- * An element or a function returning an element to use as the mount node
139
- * for the `<Popover />` (defaults to `document.body`)
140
- */
141
- mountNode: PositionPropTypes.mountNode,
142
- /**
143
- * Insert the element at the 'top' of the mountNode or at the 'bottom'
144
- */
145
- insertAt: PropTypes.oneOf(['bottom', 'top']),
146
- /**
147
- * An element, function returning an element, or array of elements that will
148
- * not be hidden from the screen reader when the `<Popover />` is open
149
- */
150
- liveRegion: PropTypes.oneOfType([
151
- PropTypes.arrayOf(PropTypes.element),
152
- PropTypes.element,
153
- PropTypes.func
154
- ]),
155
- /**
156
- * An id is generated if not supplied.
157
- */
158
- id: PropTypes.string,
159
- /**
160
- * Whether or not the content should offset to align by its arrow
161
- */
162
- shouldAlignArrow: PropTypes.bool,
163
- /**
164
- * Whether or not position should be tracked or just set on initial render
165
- */
166
- shouldTrackPosition: PropTypes.bool,
167
- /**
168
- * Should the `<Popover />` render offscreen when visually hidden
169
- */
170
- shouldRenderOffscreen: PropTypes.bool,
171
- /**
172
- * Whether focus should contained within the `<Popover/>` when it is open
173
- */
174
- shouldContainFocus: PropTypes.bool,
175
- /**
176
- * Whether focus should be returned to the trigger when the `<Popover/>` is closed
177
- */
178
- shouldReturnFocus: PropTypes.bool,
179
- /**
180
- * Should the `<Popover />` hide when clicks occur outside the content
181
- */
182
- shouldCloseOnDocumentClick: PropTypes.bool,
183
- /**
184
- * Should the `<Popover />` hide when the escape key is pressed
185
- */
186
- shouldCloseOnEscape: PropTypes.bool,
187
- /**
188
- * Should the content become focused when the trigger is blurred
189
- */
190
- shouldFocusContentOnTriggerBlur: PropTypes.bool,
191
- /**
192
- * Callback fired when content is shown. When controlled, this callback is
193
- * fired when the Popover expects to be shown
194
- */
195
- onShowContent: PropTypes.func,
196
- /**
197
- * Callback fired when content is hidden. When controlled, this callback is
198
- * fired when the Popover expects to be hidden
199
- */
200
- onHideContent: PropTypes.func,
201
- /**
202
- * Callback fired when content has been is initially positioned.
203
- * If `shouldRenderOffscreen` is true, it will only fire once, the first
204
- * time the content is shown
205
- */
206
- onPositioned: PropTypes.func,
207
- /**
208
- * Callback fired when the position changes
209
- */
210
- onPositionChanged: PropTypes.func,
211
- /**
212
- * Callback fired when component is clicked
213
- */
214
- onClick: PropTypes.func,
215
- /**
216
- * Callback fired when trigger is focused
217
- */
218
- onFocus: PropTypes.func,
219
- /**
220
- * Callback fired when component is blurred
221
- */
222
- onBlur: PropTypes.func,
223
- /**
224
- * Callback fired on keydown
225
- */
226
- onKeyDown: PropTypes.func,
227
- /**
228
- * Callback fired on keyup
229
- */
230
- onKeyUp: PropTypes.func,
231
- /**
232
- /**
233
- * Callback fired when mouse is over trigger
234
- */
235
- onMouseOver: PropTypes.func,
236
- /**
237
- * Callback fired when mouse leaves trigger
238
- */
239
- onMouseOut: PropTypes.func,
240
- /**
241
- * The element that triggers the popover
242
- */
243
- renderTrigger: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
244
- /**
245
- * The content to be shown by the popover
246
- */
247
- children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
248
- // eslint-disable-next-line react/require-default-props
249
- dir: PropTypes.oneOf(Object.values(bidirectional.DIRECTION))
250
- }
65
+ static allowedProps = allowedProps
66
+ static propTypes = propTypes
251
67
 
252
68
  static defaultProps = {
253
- isShowingContent: undefined,
254
69
  defaultIsShowingContent: false,
255
70
  placement: 'bottom center',
256
71
  stacking: 'topmost',
@@ -263,13 +78,7 @@ class Popover extends Component<PopoverProps> {
263
78
  contentRef: (el) => {},
264
79
  withArrow: true,
265
80
  constrain: 'window',
266
- defaultFocusElement: undefined,
267
- screenReaderLabel: undefined,
268
- mountNode: undefined,
269
81
  insertAt: 'bottom',
270
- liveRegion: undefined,
271
- positionTarget: undefined,
272
- id: undefined,
273
82
  shouldAlignArrow: false,
274
83
  shouldTrackPosition: true,
275
84
  shouldRenderOffscreen: false,
@@ -0,0 +1,316 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ import React from 'react'
25
+ import PropTypes from 'prop-types'
26
+
27
+ import { element } from '@instructure/ui-prop-types'
28
+ import { ThemeablePropTypes } from '@instructure/emotion'
29
+ import { PositionPropTypes } from '@instructure/ui-position'
30
+
31
+ import type { Shadow, Stacking } from '@instructure/emotion'
32
+
33
+ import type {
34
+ PlacementPropValues,
35
+ PositionConstraint,
36
+ PositionMountNode
37
+ } from '@instructure/ui-position'
38
+ import type { BidirectionalProps } from '@instructure/ui-i18n'
39
+ import type { PropValidators } from '@instructure/shared-types'
40
+
41
+ type PopoverOwnProps = {
42
+ isShowingContent?: boolean
43
+ defaultIsShowingContent?: boolean
44
+ on?: ('click' | 'hover' | 'focus') | ('click' | 'hover' | 'focus')[]
45
+ withArrow?: boolean
46
+ color?: 'primary' | 'primary-inverse'
47
+ shadow?: Shadow
48
+ stacking?: Stacking
49
+ contentRef?: (...args: any[]) => any
50
+ defaultFocusElement?: React.ReactElement | ((...args: any[]) => any)
51
+ screenReaderLabel?: string
52
+ offsetX?: string | number
53
+ offsetY?: string | number
54
+ placement: PlacementPropValues
55
+ constrain?: PositionConstraint
56
+ mountNode?: PositionMountNode
57
+ positionTarget?: PositionMountNode
58
+ insertAt?: 'bottom' | 'top'
59
+ liveRegion?:
60
+ | React.ReactElement[]
61
+ | React.ReactElement
62
+ | ((...args: any[]) => any)
63
+ id?: string
64
+ shouldAlignArrow?: boolean
65
+ shouldTrackPosition?: boolean
66
+ shouldRenderOffscreen?: boolean
67
+ shouldContainFocus?: boolean
68
+ shouldReturnFocus?: boolean
69
+ shouldCloseOnDocumentClick?: boolean
70
+ shouldCloseOnEscape?: boolean
71
+ shouldFocusContentOnTriggerBlur?: boolean
72
+ onShowContent?: (...args: any[]) => any
73
+ onHideContent?: (...args: any[]) => any
74
+ onPositioned?: (...args: any[]) => any
75
+ onPositionChanged?: (...args: any[]) => any
76
+ onClick?: (...args: any[]) => any
77
+ onFocus?: (...args: any[]) => any
78
+ onBlur?: (...args: any[]) => any
79
+ onKeyDown?: (...args: any[]) => any
80
+ onKeyUp?: (...args: any[]) => any
81
+ onMouseOver?: (...args: any[]) => any
82
+ onMouseOut?: (...args: any[]) => any
83
+ renderTrigger?: React.ReactNode | ((...args: any[]) => any)
84
+ children?: React.ReactNode | ((...args: any[]) => React.ReactNode)
85
+ }
86
+
87
+ type PopoverProps = PopoverOwnProps & BidirectionalProps
88
+
89
+ type PropKeys = keyof PopoverOwnProps
90
+
91
+ type AllowedPropKeys = Readonly<Array<PropKeys>>
92
+
93
+ const propTypes: PropValidators<PropKeys> = {
94
+ /**
95
+ * Whether or not the `<Popover />` content is shown
96
+ */
97
+ isShowingContent: PropTypes.bool,
98
+ /**
99
+ * Whether or not to show the content by default, when uncontrolled
100
+ */
101
+ defaultIsShowingContent: PropTypes.bool,
102
+ /**
103
+ * The action that causes the content to display (`click`, `hover`, `focus`)
104
+ */
105
+ on: PropTypes.oneOfType([
106
+ PropTypes.oneOf(['click', 'hover', 'focus']),
107
+ PropTypes.arrayOf(PropTypes.oneOf(['click', 'hover', 'focus']))
108
+ ]),
109
+ /**
110
+ * Whether or not an arrow pointing to the trigger should be rendered
111
+ */
112
+ withArrow: PropTypes.bool,
113
+ /**
114
+ * Color variant of the popover content
115
+ */
116
+ color: PropTypes.oneOf(['primary', 'primary-inverse']),
117
+ /**
118
+ * The placement of the content in relation to the trigger
119
+ */
120
+ placement: PositionPropTypes.placement,
121
+ /**
122
+ * Controls the shadow depth for the `<Popover />`
123
+ */
124
+ shadow: ThemeablePropTypes.shadow,
125
+ /**
126
+ * Controls the z-index depth for the `<Popover />` content
127
+ */
128
+ stacking: ThemeablePropTypes.stacking,
129
+ /**
130
+ * A function that returns a reference to the content element
131
+ */
132
+ contentRef: PropTypes.func,
133
+ /**
134
+ * An element or a function returning an element to focus by default
135
+ */
136
+ defaultFocusElement: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
137
+ /**
138
+ * An accessible label for the `<Popover />` content
139
+ */
140
+ screenReaderLabel: PropTypes.string,
141
+ /**
142
+ * The horizontal offset for the positioned content
143
+ */
144
+ offsetX: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
145
+ /**
146
+ * The vertical offset for the positioned content
147
+ */
148
+ offsetY: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
149
+ /**
150
+ * The parent in which to constrain the popover.
151
+ * One of: 'window', 'scroll-parent', 'parent', 'none', an element,
152
+ * or a function returning an element
153
+ */
154
+ constrain: PositionPropTypes.constrain,
155
+ /**
156
+ * Target element for positioning the Popover (if it differs from the trigger)
157
+ */
158
+ positionTarget: PropTypes.oneOfType([element, PropTypes.func]),
159
+ /**
160
+ * An element or a function returning an element to use as the mount node
161
+ * for the `<Popover />` (defaults to `document.body`)
162
+ */
163
+ mountNode: PositionPropTypes.mountNode,
164
+ /**
165
+ * Insert the element at the 'top' of the mountNode or at the 'bottom'
166
+ */
167
+ insertAt: PropTypes.oneOf(['bottom', 'top']),
168
+ /**
169
+ * An element, function returning an element, or array of elements that will
170
+ * not be hidden from the screen reader when the `<Popover />` is open
171
+ */
172
+ liveRegion: PropTypes.oneOfType([
173
+ PropTypes.arrayOf(PropTypes.element),
174
+ PropTypes.element,
175
+ PropTypes.func
176
+ ]),
177
+ /**
178
+ * An id is generated if not supplied.
179
+ */
180
+ id: PropTypes.string,
181
+ /**
182
+ * Whether or not the content should offset to align by its arrow
183
+ */
184
+ shouldAlignArrow: PropTypes.bool,
185
+ /**
186
+ * Whether or not position should be tracked or just set on initial render
187
+ */
188
+ shouldTrackPosition: PropTypes.bool,
189
+ /**
190
+ * Should the `<Popover />` render offscreen when visually hidden
191
+ */
192
+ shouldRenderOffscreen: PropTypes.bool,
193
+ /**
194
+ * Whether focus should contained within the `<Popover/>` when it is open
195
+ */
196
+ shouldContainFocus: PropTypes.bool,
197
+ /**
198
+ * Whether focus should be returned to the trigger when the `<Popover/>` is closed
199
+ */
200
+ shouldReturnFocus: PropTypes.bool,
201
+ /**
202
+ * Should the `<Popover />` hide when clicks occur outside the content
203
+ */
204
+ shouldCloseOnDocumentClick: PropTypes.bool,
205
+ /**
206
+ * Should the `<Popover />` hide when the escape key is pressed
207
+ */
208
+ shouldCloseOnEscape: PropTypes.bool,
209
+ /**
210
+ * Should the content become focused when the trigger is blurred
211
+ */
212
+ shouldFocusContentOnTriggerBlur: PropTypes.bool,
213
+ /**
214
+ * Callback fired when content is shown. When controlled, this callback is
215
+ * fired when the Popover expects to be shown
216
+ */
217
+ onShowContent: PropTypes.func,
218
+ /**
219
+ * Callback fired when content is hidden. When controlled, this callback is
220
+ * fired when the Popover expects to be hidden
221
+ */
222
+ onHideContent: PropTypes.func,
223
+ /**
224
+ * Callback fired when content has been is initially positioned.
225
+ * If `shouldRenderOffscreen` is true, it will only fire once, the first
226
+ * time the content is shown
227
+ */
228
+ onPositioned: PropTypes.func,
229
+ /**
230
+ * Callback fired when the position changes
231
+ */
232
+ onPositionChanged: PropTypes.func,
233
+ /**
234
+ * Callback fired when component is clicked
235
+ */
236
+ onClick: PropTypes.func,
237
+ /**
238
+ * Callback fired when trigger is focused
239
+ */
240
+ onFocus: PropTypes.func,
241
+ /**
242
+ * Callback fired when component is blurred
243
+ */
244
+ onBlur: PropTypes.func,
245
+ /**
246
+ * Callback fired on keydown
247
+ */
248
+ onKeyDown: PropTypes.func,
249
+ /**
250
+ * Callback fired on keyup
251
+ */
252
+ onKeyUp: PropTypes.func,
253
+ /**
254
+ /**
255
+ * Callback fired when mouse is over trigger
256
+ */
257
+ onMouseOver: PropTypes.func,
258
+ /**
259
+ * Callback fired when mouse leaves trigger
260
+ */
261
+ onMouseOut: PropTypes.func,
262
+ /**
263
+ * The element that triggers the popover
264
+ */
265
+ renderTrigger: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
266
+ /**
267
+ * The content to be shown by the popover
268
+ */
269
+ children: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
270
+ }
271
+
272
+ const allowedProps: AllowedPropKeys = [
273
+ 'isShowingContent',
274
+ 'defaultIsShowingContent',
275
+ 'on',
276
+ 'withArrow',
277
+ 'color',
278
+ 'placement',
279
+ 'shadow',
280
+ 'stacking',
281
+ 'contentRef',
282
+ 'defaultFocusElement',
283
+ 'screenReaderLabel',
284
+ 'offsetX',
285
+ 'offsetY',
286
+ 'constrain',
287
+ 'positionTarget',
288
+ 'mountNode',
289
+ 'insertAt',
290
+ 'liveRegion',
291
+ 'id',
292
+ 'shouldAlignArrow',
293
+ 'shouldTrackPosition',
294
+ 'shouldRenderOffscreen',
295
+ 'shouldContainFocus',
296
+ 'shouldReturnFocus',
297
+ 'shouldCloseOnDocumentClick',
298
+ 'shouldCloseOnEscape',
299
+ 'shouldFocusContentOnTriggerBlur',
300
+ 'onShowContent',
301
+ 'onHideContent',
302
+ 'onPositioned',
303
+ 'onPositionChanged',
304
+ 'onClick',
305
+ 'onFocus',
306
+ 'onBlur',
307
+ 'onKeyDown',
308
+ 'onKeyUp',
309
+ 'onMouseOver',
310
+ 'onMouseOut',
311
+ 'renderTrigger',
312
+ 'children'
313
+ ]
314
+
315
+ export type { PopoverProps }
316
+ export { propTypes, allowedProps }