@dhis2-ui/modal 8.16.0 → 9.0.0-alpha.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.
Files changed (2) hide show
  1. package/package.json +12 -9
  2. package/types/index.d.ts +43 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/modal",
3
- "version": "8.16.0",
3
+ "version": "9.0.0-alpha.2",
4
4
  "description": "UI Modal",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,6 +13,7 @@
13
13
  "main": "./build/cjs/index.js",
14
14
  "module": "./build/es/index.js",
15
15
  "exports": {
16
+ "types": "./types/index.d.ts",
16
17
  "import": "./build/es/index.js",
17
18
  "require": "./build/cjs/index.js"
18
19
  },
@@ -32,21 +33,23 @@
32
33
  },
33
34
  "dependencies": {
34
35
  "@dhis2/prop-types": "^3.1.2",
35
- "@dhis2-ui/card": "8.16.0",
36
- "@dhis2-ui/center": "8.16.0",
37
- "@dhis2-ui/layer": "8.16.0",
38
- "@dhis2-ui/portal": "8.16.0",
39
- "@dhis2/ui-constants": "8.16.0",
40
- "@dhis2/ui-icons": "8.16.0",
36
+ "@dhis2-ui/card": "9.0.0-alpha.2",
37
+ "@dhis2-ui/center": "9.0.0-alpha.2",
38
+ "@dhis2-ui/layer": "9.0.0-alpha.2",
39
+ "@dhis2-ui/portal": "9.0.0-alpha.2",
40
+ "@dhis2/ui-constants": "9.0.0-alpha.2",
41
+ "@dhis2/ui-icons": "9.0.0-alpha.2",
41
42
  "classnames": "^2.3.1",
42
43
  "prop-types": "^15.7.2"
43
44
  },
44
45
  "files": [
45
- "build"
46
+ "build",
47
+ "types"
46
48
  ],
47
49
  "devDependencies": {
48
50
  "react": "16.13",
49
51
  "react-dom": "16.13",
50
52
  "styled-jsx": "^4.0.1"
51
- }
53
+ },
54
+ "types": "types"
52
55
  }
@@ -0,0 +1,43 @@
1
+ import * as React from 'react'
2
+ import { LayerBackdropClickHandler } from '@dhis2-ui/layer'
3
+
4
+ export type ModalOnCloseEventHandler = LayerBackdropClickHandler
5
+
6
+ export interface ModalProps {
7
+ children?: React.ReactNode
8
+ className?: string
9
+ dataTest?: string
10
+ fluid?: boolean
11
+ hide?: boolean
12
+ large?: boolean
13
+ position?: 'top' | 'middle' | 'bottom'
14
+ small?: boolean
15
+ /**
16
+ * Callback used when the Modal closes
17
+ */
18
+ onClose?: LayerBackdropClickHandler
19
+ }
20
+
21
+ export const Modal: React.FC<ModalProps>
22
+
23
+ export interface ModalActionsProps {
24
+ children?: React.ReactNode
25
+ dataTest?: string
26
+ }
27
+
28
+ export const ModalActions: React.FC<ModalActionsProps>
29
+
30
+ export interface ModalContentProps {
31
+ children?: React.ReactNode
32
+ className?: string
33
+ dataTest?: string
34
+ }
35
+
36
+ export const ModalContent: React.FC<ModalContentProps>
37
+
38
+ export interface ModalTitleProps {
39
+ children?: string
40
+ dataTest?: string
41
+ }
42
+
43
+ export const ModalTitle: React.FC<ModalTitleProps>