@dhis2/ui-constants 8.16.0-alpha.1 → 9.0.0-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/build/cjs/shared-prop-types.js +14 -2
- package/build/es/shared-prop-types.js +11 -0
- package/package.json +1 -1
- package/types/index.d.ts +15 -0
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.statusPropType = exports.statusArgType = exports.sizePropType = exports.sizeArgType = exports.popperReferencePropType = exports.popperReferenceArgType = exports.popperPlacementPropType = exports.popperPlacementArgType = exports.insideAlignmentPropType = exports.insideAlignmentArgType = void 0;
|
6
|
+
exports.statusPropType = exports.statusArgType = exports.sizePropType = exports.sizeArgType = exports.popperReferencePropType = exports.popperReferenceArgType = exports.popperPlacementPropType = exports.popperPlacementArgType = exports.insideAlignmentPropType = exports.insideAlignmentArgType = exports.buttonVariantArgType = void 0;
|
7
7
|
|
8
8
|
var _propTypes = require("@dhis2/prop-types");
|
9
9
|
|
@@ -29,13 +29,25 @@ const statusArgType = {
|
|
29
29
|
type: 'boolean'
|
30
30
|
}
|
31
31
|
};
|
32
|
+
exports.statusArgType = statusArgType;
|
33
|
+
const buttonVariantArgType = // No description because it should be set for the component description
|
34
|
+
{
|
35
|
+
table: {
|
36
|
+
type: {
|
37
|
+
summary: 'bool'
|
38
|
+
}
|
39
|
+
},
|
40
|
+
control: {
|
41
|
+
type: 'boolean'
|
42
|
+
}
|
43
|
+
};
|
32
44
|
/**
|
33
45
|
* Size variant propType
|
34
46
|
* @return {PropType} Mutually exclusive variants:
|
35
47
|
* small/large
|
36
48
|
*/
|
37
49
|
|
38
|
-
exports.
|
50
|
+
exports.buttonVariantArgType = buttonVariantArgType;
|
39
51
|
const sizePropType = (0, _propTypes.mutuallyExclusive)(['small', 'large', 'extrasmall', 'fluid'], _propTypes2.default.bool);
|
40
52
|
exports.sizePropType = sizePropType;
|
41
53
|
const sizeArgType = {
|
@@ -18,6 +18,17 @@ export const statusArgType = {
|
|
18
18
|
type: 'boolean'
|
19
19
|
}
|
20
20
|
};
|
21
|
+
export const buttonVariantArgType = // No description because it should be set for the component description
|
22
|
+
{
|
23
|
+
table: {
|
24
|
+
type: {
|
25
|
+
summary: 'bool'
|
26
|
+
}
|
27
|
+
},
|
28
|
+
control: {
|
29
|
+
type: 'boolean'
|
30
|
+
}
|
31
|
+
};
|
21
32
|
/**
|
22
33
|
* Size variant propType
|
23
34
|
* @return {PropType} Mutually exclusive variants:
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
import { bool } from 'prop-types'
|
2
|
+
import {
|
3
|
+
insideAlignmentPropType,
|
4
|
+
popperPlacementPropType,
|
5
|
+
popperReferencePropType,
|
6
|
+
} from '../src/shared-prop-types'
|
7
|
+
|
1
8
|
export type ColorBase = 'blue' | 'teal' | 'red' | 'yellow' | 'green' | 'grey'
|
2
9
|
export type ColorVariant =
|
3
10
|
| '900'
|
@@ -61,3 +68,11 @@ export type ThemeProp =
|
|
61
68
|
| 'focus'
|
62
69
|
| 'fonts'
|
63
70
|
export const theme: Record<ThemeProp, string>
|
71
|
+
|
72
|
+
export interface sharedPropTypes {
|
73
|
+
statusPropType: typeof bool
|
74
|
+
sizePropType: typeof bool
|
75
|
+
insideAlignmentPropType: typeof insideAlignmentPropType
|
76
|
+
popperPlacementPropType: typeof popperPlacementPropType
|
77
|
+
popperReferencePropType: typeof popperReferencePropType
|
78
|
+
}
|