@dhis2/ui-constants 8.15.1 → 8.16.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 +2 -24
- package/build/es/shared-prop-types.js +0 -20
- package/package.json +6 -3
- package/types/index.d.ts +63 -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 =
|
6
|
+
exports.statusPropType = exports.statusArgType = exports.sizePropType = exports.sizeArgType = exports.popperReferencePropType = exports.popperReferenceArgType = exports.popperPlacementPropType = exports.popperPlacementArgType = exports.insideAlignmentPropType = exports.insideAlignmentArgType = void 0;
|
7
7
|
|
8
8
|
var _propTypes = require("@dhis2/prop-types");
|
9
9
|
|
@@ -29,35 +29,13 @@ const statusArgType = {
|
|
29
29
|
type: 'boolean'
|
30
30
|
}
|
31
31
|
};
|
32
|
-
/**
|
33
|
-
* @deprecated Not unused, will be removed in a future version.
|
34
|
-
* Button variant propType
|
35
|
-
* @return {PropType} Mutually exclusive variants:
|
36
|
-
* primary/secondary/destructive
|
37
|
-
*/
|
38
|
-
|
39
|
-
exports.statusArgType = statusArgType;
|
40
|
-
const buttonVariantPropType = (0, _propTypes.mutuallyExclusive)(['primary', 'secondary', 'destructive'], _propTypes2.default.bool);
|
41
|
-
exports.buttonVariantPropType = buttonVariantPropType;
|
42
|
-
const buttonVariantArgType = {
|
43
|
-
// No description because it should be set for the component description
|
44
|
-
table: {
|
45
|
-
type: {
|
46
|
-
summary: 'bool',
|
47
|
-
detail: "'primary', 'secondary', and 'destructive' are mutually exclusive props"
|
48
|
-
}
|
49
|
-
},
|
50
|
-
control: {
|
51
|
-
type: 'boolean'
|
52
|
-
}
|
53
|
-
};
|
54
32
|
/**
|
55
33
|
* Size variant propType
|
56
34
|
* @return {PropType} Mutually exclusive variants:
|
57
35
|
* small/large
|
58
36
|
*/
|
59
37
|
|
60
|
-
exports.
|
38
|
+
exports.statusArgType = statusArgType;
|
61
39
|
const sizePropType = (0, _propTypes.mutuallyExclusive)(['small', 'large', 'extrasmall', 'fluid'], _propTypes2.default.bool);
|
62
40
|
exports.sizePropType = sizePropType;
|
63
41
|
const sizeArgType = {
|
@@ -18,26 +18,6 @@ export const statusArgType = {
|
|
18
18
|
type: 'boolean'
|
19
19
|
}
|
20
20
|
};
|
21
|
-
/**
|
22
|
-
* @deprecated Not unused, will be removed in a future version.
|
23
|
-
* Button variant propType
|
24
|
-
* @return {PropType} Mutually exclusive variants:
|
25
|
-
* primary/secondary/destructive
|
26
|
-
*/
|
27
|
-
|
28
|
-
export const buttonVariantPropType = mutuallyExclusive(['primary', 'secondary', 'destructive'], PropTypes.bool);
|
29
|
-
export const buttonVariantArgType = {
|
30
|
-
// No description because it should be set for the component description
|
31
|
-
table: {
|
32
|
-
type: {
|
33
|
-
summary: 'bool',
|
34
|
-
detail: "'primary', 'secondary', and 'destructive' are mutually exclusive props"
|
35
|
-
}
|
36
|
-
},
|
37
|
-
control: {
|
38
|
-
type: 'boolean'
|
39
|
-
}
|
40
|
-
};
|
41
21
|
/**
|
42
22
|
* Size variant propType
|
43
23
|
* @return {PropType} Mutually exclusive variants:
|
package/package.json
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dhis2/ui-constants",
|
3
|
-
"version": "8.
|
3
|
+
"version": "8.16.0-alpha.1",
|
4
4
|
"description": "Constants used in the UI libs",
|
5
5
|
"main": "./build/cjs/index.js",
|
6
6
|
"module": "./build/es/index.js",
|
7
7
|
"exports": {
|
8
|
+
"types": "./types/index.d.ts",
|
8
9
|
"import": "./build/es/index.js",
|
9
10
|
"require": "./build/cjs/index.js"
|
10
11
|
},
|
@@ -29,6 +30,8 @@
|
|
29
30
|
"prop-types": "^15.7.2"
|
30
31
|
},
|
31
32
|
"files": [
|
32
|
-
"build"
|
33
|
-
|
33
|
+
"build",
|
34
|
+
"types"
|
35
|
+
],
|
36
|
+
"types": "types"
|
34
37
|
}
|
package/types/index.d.ts
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
export type ColorBase = 'blue' | 'teal' | 'red' | 'yellow' | 'green' | 'grey'
|
2
|
+
export type ColorVariant =
|
3
|
+
| '900'
|
4
|
+
| '800'
|
5
|
+
| '700'
|
6
|
+
| '600'
|
7
|
+
| '500'
|
8
|
+
| '400'
|
9
|
+
| '300'
|
10
|
+
| '200'
|
11
|
+
| '100'
|
12
|
+
| '050'
|
13
|
+
export type ColorProp = `${ColorBase}${ColorVariant}` | 'white'
|
14
|
+
|
15
|
+
export const colors: Record<ColorProp, string>
|
16
|
+
|
17
|
+
export type ElevantionVariant = 'e100' | 'e200' | 'e300' | 'e400'
|
18
|
+
export const elevations: Record<ElevantionVariant, string>
|
19
|
+
|
20
|
+
export type SpacerVariant =
|
21
|
+
| 'dp4'
|
22
|
+
| 'dp8'
|
23
|
+
| 'dp12'
|
24
|
+
| 'dp16'
|
25
|
+
| 'dp24'
|
26
|
+
| 'dp32'
|
27
|
+
| 'dp48'
|
28
|
+
| 'dp64'
|
29
|
+
| 'dp96'
|
30
|
+
| 'dp128'
|
31
|
+
| 'dp192'
|
32
|
+
| 'dp256'
|
33
|
+
| 'dp384'
|
34
|
+
| 'dp512'
|
35
|
+
| 'dp640'
|
36
|
+
export const spacersNum: Record<SpacerVariant, number>
|
37
|
+
export const spacers: Record<SpacerVariant, string>
|
38
|
+
|
39
|
+
export type LayerVariant = 'applicationTop' | 'blocking' | 'alert'
|
40
|
+
export const layer: Record<LayerVariant, number>
|
41
|
+
|
42
|
+
export type ThemeBase = 'primary' | 'secondary'
|
43
|
+
export type ThemeVariant =
|
44
|
+
| '900'
|
45
|
+
| '800'
|
46
|
+
| '700'
|
47
|
+
| '600'
|
48
|
+
| '500'
|
49
|
+
| '400'
|
50
|
+
| '300'
|
51
|
+
| '200'
|
52
|
+
| '100'
|
53
|
+
| '050'
|
54
|
+
export type ThemeProp =
|
55
|
+
| `${ThemeBase}${ThemeVariant}`
|
56
|
+
| 'default'
|
57
|
+
| 'error'
|
58
|
+
| 'valid'
|
59
|
+
| 'warning'
|
60
|
+
| 'disabled'
|
61
|
+
| 'focus'
|
62
|
+
| 'fonts'
|
63
|
+
export const theme: Record<ThemeProp, string>
|