@dhis2-ui/menu 8.14.8 → 8.15.0-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 +12 -10
  2. package/types/index.d.ts +103 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/menu",
3
- "version": "8.14.8",
3
+ "version": "8.15.0-alpha.1",
4
4
  "description": "UI Menu",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,22 +32,24 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@dhis2/prop-types": "^3.1.2",
35
- "@dhis2-ui/card": "8.14.8",
36
- "@dhis2-ui/divider": "8.14.8",
37
- "@dhis2-ui/layer": "8.14.8",
38
- "@dhis2-ui/popper": "8.14.8",
39
- "@dhis2-ui/portal": "8.14.8",
40
- "@dhis2/ui-constants": "8.14.8",
41
- "@dhis2/ui-icons": "8.14.8",
35
+ "@dhis2-ui/card": "8.15.0-alpha.1",
36
+ "@dhis2-ui/divider": "8.15.0-alpha.1",
37
+ "@dhis2-ui/layer": "8.15.0-alpha.1",
38
+ "@dhis2-ui/popper": "8.15.0-alpha.1",
39
+ "@dhis2-ui/portal": "8.15.0-alpha.1",
40
+ "@dhis2/ui-constants": "8.15.0-alpha.1",
41
+ "@dhis2/ui-icons": "8.15.0-alpha.1",
42
42
  "classnames": "^2.3.1",
43
43
  "prop-types": "^15.7.2"
44
44
  },
45
45
  "files": [
46
- "build"
46
+ "build",
47
+ "types"
47
48
  ],
48
49
  "devDependencies": {
49
50
  "react": "16.13",
50
51
  "react-dom": "16.13",
51
52
  "styled-jsx": "^4.0.1"
52
- }
53
+ },
54
+ "types": "types"
53
55
  }
@@ -0,0 +1,103 @@
1
+ import * as React from 'react'
2
+
3
+ export interface FlyoutMenuProps {
4
+ /**
5
+ * Typically, but not limited to, `MenuItem` components
6
+ */
7
+ children?: React.ReactNode
8
+ className?: string
9
+ dataTest?: string
10
+ /**
11
+ * Menu uses smaller dimensions
12
+ */
13
+ dense?: boolean
14
+ maxHeight?: string
15
+ maxWidth?: string
16
+ }
17
+
18
+ export const FlyoutMenu: React.FC<FlyoutMenuProps>
19
+
20
+ export interface MenuProps {
21
+ /**
22
+ * Typically `MenuItem`, `MenuDivider`, and `MenuSectionHeader`
23
+ */
24
+ children?: React.ReactNode
25
+ className?: string
26
+ dataTest?: string
27
+ /**
28
+ * Applies `dense` property to all child components unless already specified
29
+ */
30
+ dense?: boolean
31
+ }
32
+
33
+ export const Menu: React.FC<MenuProps>
34
+
35
+ export interface MenuDividerProps {
36
+ className?: string
37
+ dataTest?: string
38
+ dense?: boolean
39
+ }
40
+
41
+ export const MenuDivider: React.FC<MenuDividerProps>
42
+
43
+ export interface MenuItemProps {
44
+ active?: boolean
45
+ chevron?: boolean
46
+ /**
47
+ * Nested menu items can become submenus.
48
+ * See `showSubMenu` and `toggleSubMenu` props, and 'Children' demo
49
+ */
50
+ children?: React.ReactNode
51
+ className?: string
52
+ dataTest?: string
53
+ dense?: boolean
54
+ destructive?: boolean
55
+ disabled?: boolean
56
+ /**
57
+ * For using menu item as a link
58
+ */
59
+ href?: string
60
+ /**
61
+ * An icon for the left side of the menu item
62
+ */
63
+ icon?: React.ReactNode
64
+ /**
65
+ * Text in the menu item
66
+ */
67
+ label?: React.ReactNode
68
+ /**
69
+ * When true, nested menu items are shown in a Popper
70
+ */
71
+ showSubMenu?: boolean
72
+ /**
73
+ * For using menu item as a link
74
+ */
75
+ target?: string
76
+ /**
77
+ * On click, this function is called (without args)
78
+ */
79
+ toggleSubMenu?: () => void
80
+ /**
81
+ * Value associated with item. Passed as an argument to onClick handler.
82
+ */
83
+ value?: string
84
+ /**
85
+ * Click handler called with signature `({ value: string }, event)`
86
+ */
87
+ onClick?: (
88
+ payload: { value: string | undefined },
89
+ event: React.MouseEvent<HTMLAnchorElement>
90
+ ) => void
91
+ }
92
+
93
+ export const MenuItem: React.FC<MenuItemProps>
94
+
95
+ export interface MenuSectionHeaderProps {
96
+ className?: string
97
+ dataTest?: string
98
+ dense?: boolean
99
+ hideDivider?: boolean
100
+ label?: React.ReactNode
101
+ }
102
+
103
+ export const MenuSectionHeader: React.FC<MenuSectionHeaderProps>