@dhis2/ui-constants 7.1.0 → 7.2.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.
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.popperReferenceArgType = exports.popperReferencePropType = exports.popperPlacementArgType = exports.popperPlacementPropType = exports.insideAlignmentArgType = exports.insideAlignmentPropType = exports.sizeArgType = exports.sizePropType = exports.buttonVariantArgType = exports.buttonVariantPropType = exports.statusArgType = exports.statusPropType = void 0;
7
7
 
8
- var _propTypes = _interopRequireDefault(require("@dhis2/prop-types"));
8
+ var _propTypes = require("@dhis2/prop-types");
9
+
10
+ var _propTypes2 = _interopRequireDefault(require("prop-types"));
9
11
 
10
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
13
 
@@ -13,8 +15,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
13
15
  * Status propType
14
16
  * @return {PropType} Mutually exclusive status: valid/warning/error
15
17
  */
16
- const statusPropType = _propTypes.default.mutuallyExclusive(['valid', 'warning', 'error'], _propTypes.default.bool); // Exported for storybook
17
-
18
+ const statusPropType = (0, _propTypes.mutuallyExclusive)(['valid', 'warning', 'error'], _propTypes2.default.bool); // Exported for storybook
18
19
 
19
20
  exports.statusPropType = statusPropType;
20
21
  const statusArgType = {
@@ -35,9 +36,7 @@ const statusArgType = {
35
36
  */
36
37
 
37
38
  exports.statusArgType = statusArgType;
38
-
39
- const buttonVariantPropType = _propTypes.default.mutuallyExclusive(['primary', 'secondary', 'destructive'], _propTypes.default.bool);
40
-
39
+ const buttonVariantPropType = (0, _propTypes.mutuallyExclusive)(['primary', 'secondary', 'destructive'], _propTypes2.default.bool);
41
40
  exports.buttonVariantPropType = buttonVariantPropType;
42
41
  const buttonVariantArgType = {
43
42
  // No description because it should be set for the component description
@@ -58,9 +57,7 @@ const buttonVariantArgType = {
58
57
  */
59
58
 
60
59
  exports.buttonVariantArgType = buttonVariantArgType;
61
-
62
- const sizePropType = _propTypes.default.mutuallyExclusive(['small', 'large', 'extrasmall'], _propTypes.default.bool);
63
-
60
+ const sizePropType = (0, _propTypes.mutuallyExclusive)(['small', 'large', 'extrasmall'], _propTypes2.default.bool);
64
61
  exports.sizePropType = sizePropType;
65
62
  const sizeArgType = {
66
63
  // No description because it should be set in the component description
@@ -81,7 +78,7 @@ const sizeArgType = {
81
78
 
82
79
  exports.sizeArgType = sizeArgType;
83
80
 
84
- const insideAlignmentPropType = _propTypes.default.oneOf(['top', 'middle', 'bottom']);
81
+ const insideAlignmentPropType = _propTypes2.default.oneOf(['top', 'middle', 'bottom']);
85
82
 
86
83
  exports.insideAlignmentPropType = insideAlignmentPropType;
87
84
  const insideAlignmentArgType = {
@@ -103,7 +100,7 @@ const insideAlignmentArgType = {
103
100
 
104
101
  exports.insideAlignmentArgType = insideAlignmentArgType;
105
102
 
106
- const popperPlacementPropType = _propTypes.default.oneOf(['auto', 'auto-start', 'auto-end', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'right', 'right-start', 'right-end', 'left', 'left-start', 'left-end']);
103
+ const popperPlacementPropType = _propTypes2.default.oneOf(['auto', 'auto-start', 'auto-end', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'right', 'right-start', 'right-end', 'left', 'left-start', 'left-end']);
107
104
 
108
105
  exports.popperPlacementPropType = popperPlacementPropType;
109
106
  const popperPlacementArgType = {
@@ -127,13 +124,13 @@ const popperPlacementArgType = {
127
124
 
128
125
  exports.popperPlacementArgType = popperPlacementArgType;
129
126
 
130
- const popperReferencePropType = _propTypes.default.oneOfType([// DOM node
131
- _propTypes.default.instanceOf(Element), // React ref - React.useRef() or React.createRef()
132
- _propTypes.default.shape({
133
- current: _propTypes.default.instanceOf(Element)
127
+ const popperReferencePropType = _propTypes2.default.oneOfType([// DOM node
128
+ _propTypes2.default.instanceOf(Element), // React ref - React.useRef() or React.createRef()
129
+ _propTypes2.default.shape({
130
+ current: _propTypes2.default.instanceOf(Element)
134
131
  }), // Virtual element
135
- _propTypes.default.shape({
136
- getBoundingClientRect: _propTypes.default.func
132
+ _propTypes2.default.shape({
133
+ getBoundingClientRect: _propTypes2.default.func
137
134
  })]);
138
135
 
139
136
  exports.popperReferencePropType = popperReferencePropType;
@@ -1,10 +1,11 @@
1
- import propTypes from '@dhis2/prop-types';
1
+ import { mutuallyExclusive } from '@dhis2/prop-types';
2
+ import PropTypes from 'prop-types';
2
3
  /**
3
4
  * Status propType
4
5
  * @return {PropType} Mutually exclusive status: valid/warning/error
5
6
  */
6
7
 
7
- export const statusPropType = propTypes.mutuallyExclusive(['valid', 'warning', 'error'], propTypes.bool); // Exported for storybook
8
+ export const statusPropType = mutuallyExclusive(['valid', 'warning', 'error'], PropTypes.bool); // Exported for storybook
8
9
 
9
10
  export const statusArgType = {
10
11
  table: {
@@ -23,7 +24,7 @@ export const statusArgType = {
23
24
  * primary/secondary/destructive
24
25
  */
25
26
 
26
- export const buttonVariantPropType = propTypes.mutuallyExclusive(['primary', 'secondary', 'destructive'], propTypes.bool);
27
+ export const buttonVariantPropType = mutuallyExclusive(['primary', 'secondary', 'destructive'], PropTypes.bool);
27
28
  export const buttonVariantArgType = {
28
29
  // No description because it should be set for the component description
29
30
  table: {
@@ -42,7 +43,7 @@ export const buttonVariantArgType = {
42
43
  * small/large
43
44
  */
44
45
 
45
- export const sizePropType = propTypes.mutuallyExclusive(['small', 'large', 'extrasmall'], propTypes.bool);
46
+ export const sizePropType = mutuallyExclusive(['small', 'large', 'extrasmall'], PropTypes.bool);
46
47
  export const sizeArgType = {
47
48
  // No description because it should be set in the component description
48
49
  table: {
@@ -60,7 +61,7 @@ export const sizeArgType = {
60
61
  * @return {PropType} PropType that validates the inside alignment.
61
62
  */
62
63
 
63
- export const insideAlignmentPropType = propTypes.oneOf(['top', 'middle', 'bottom']);
64
+ export const insideAlignmentPropType = PropTypes.oneOf(['top', 'middle', 'bottom']);
64
65
  export const insideAlignmentArgType = {
65
66
  description: 'Inside alignment of the component',
66
67
  table: {
@@ -78,7 +79,7 @@ export const insideAlignmentArgType = {
78
79
  * @return {PropType} PropType that validates placements.
79
80
  */
80
81
 
81
- export const popperPlacementPropType = propTypes.oneOf(['auto', 'auto-start', 'auto-end', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'right', 'right-start', 'right-end', 'left', 'left-start', 'left-end']);
82
+ export const popperPlacementPropType = PropTypes.oneOf(['auto', 'auto-start', 'auto-end', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'right', 'right-start', 'right-end', 'left', 'left-start', 'left-end']);
82
83
  export const popperPlacementArgType = {
83
84
  description: 'Placement properties relative to reference element',
84
85
  table: {
@@ -98,13 +99,13 @@ export const popperPlacementArgType = {
98
99
  * instance of an Element.
99
100
  */
100
101
 
101
- export const popperReferencePropType = propTypes.oneOfType([// DOM node
102
- propTypes.instanceOf(Element), // React ref - React.useRef() or React.createRef()
103
- propTypes.shape({
104
- current: propTypes.instanceOf(Element)
102
+ export const popperReferencePropType = PropTypes.oneOfType([// DOM node
103
+ PropTypes.instanceOf(Element), // React ref - React.useRef() or React.createRef()
104
+ PropTypes.shape({
105
+ current: PropTypes.instanceOf(Element)
105
106
  }), // Virtual element
106
- propTypes.shape({
107
- getBoundingClientRect: propTypes.func
107
+ PropTypes.shape({
108
+ getBoundingClientRect: PropTypes.func
108
109
  })]);
109
110
  export const popperReferenceArgType = {
110
111
  description: 'A reference to the element to position against: either a DOM node, React ref, \
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/ui-constants",
3
- "version": "7.1.0",
3
+ "version": "7.2.2",
4
4
  "description": "Constants used in the UI libs",
5
5
  "main": "./build/cjs/index.js",
6
6
  "module": "./build/es/index.js",
@@ -26,7 +26,6 @@
26
26
  "build": "d2-app-scripts build"
27
27
  },
28
28
  "dependencies": {
29
- "@dhis2/prop-types": "^1.6.4",
30
29
  "prop-types": "^15.7.2"
31
30
  },
32
31
  "files": [