@dhis2-ui/popover 8.14.1 → 8.14.2-alpha.1

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.
Files changed (2) hide show
  1. package/package.json +8 -6
  2. package/types/index.d.ts +30 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/popover",
3
- "version": "8.14.1",
3
+ "version": "8.14.2-alpha.1",
4
4
  "description": "UI Popover",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,18 +32,20 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@dhis2/prop-types": "^3.1.2",
35
- "@dhis2-ui/layer": "8.14.1",
36
- "@dhis2-ui/popper": "8.14.1",
37
- "@dhis2/ui-constants": "8.14.1",
35
+ "@dhis2-ui/layer": "8.14.2-alpha.1",
36
+ "@dhis2-ui/popper": "8.14.2-alpha.1",
37
+ "@dhis2/ui-constants": "8.14.2-alpha.1",
38
38
  "classnames": "^2.3.1",
39
39
  "prop-types": "^15.7.2"
40
40
  },
41
41
  "files": [
42
- "build"
42
+ "build",
43
+ "types"
43
44
  ],
44
45
  "devDependencies": {
45
46
  "react": "16.13",
46
47
  "react-dom": "16.13",
47
48
  "styled-jsx": "^4.0.1"
48
- }
49
+ },
50
+ "types": "types"
49
51
  }
@@ -0,0 +1,30 @@
1
+ import * as React from 'react'
2
+ import { VirtualElement, Options as PopperOptions } from '@popperjs/core'
3
+
4
+ type PopperReference = VirtualElement | Element
5
+ type ReferenceElement = PopperReference | React.RefObject<PopperReference>
6
+
7
+ export interface PopoverProps {
8
+ children: React.ReactNode
9
+ /**
10
+ * Show or hide the arrow
11
+ */
12
+ arrow?: boolean
13
+ className?: string
14
+ dataTest?: string
15
+ /**
16
+ * Box-shadow to create appearance of elevation. Use `elevations` constants from the UI library.
17
+ */
18
+ elevation?: string
19
+ maxWidth?: number
20
+ observePopperResize?: boolean
21
+ observeReferenceResize?: boolean
22
+ placement?: PopperOptions['placement']
23
+ /**
24
+ * A React ref that refers to the element the Popover should position against
25
+ */
26
+ reference?: ReferenceElement
27
+ onClickOutside?: (arg0: {}, event: React.SyntheticEvent) => void
28
+ }
29
+
30
+ export const Popover: React.FC<PopoverProps>