@dhis2/ui-constants 8.16.0-alpha.1 → 8.16.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.buttonVariantPropType = exports.buttonVariantArgType = void 0;
7
7
 
8
8
  var _propTypes = require("@dhis2/prop-types");
9
9
 
@@ -29,13 +29,35 @@ 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
+ };
32
54
  /**
33
55
  * Size variant propType
34
56
  * @return {PropType} Mutually exclusive variants:
35
57
  * small/large
36
58
  */
37
59
 
38
- exports.statusArgType = statusArgType;
60
+ exports.buttonVariantArgType = buttonVariantArgType;
39
61
  const sizePropType = (0, _propTypes.mutuallyExclusive)(['small', 'large', 'extrasmall', 'fluid'], _propTypes2.default.bool);
40
62
  exports.sizePropType = sizePropType;
41
63
  const sizeArgType = {
@@ -18,6 +18,26 @@ 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
+ };
21
41
  /**
22
42
  * Size variant propType
23
43
  * @return {PropType} Mutually exclusive variants:
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@dhis2/ui-constants",
3
- "version": "8.16.0-alpha.1",
3
+ "version": "8.16.0",
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",
9
8
  "import": "./build/es/index.js",
10
9
  "require": "./build/cjs/index.js"
11
10
  },
@@ -30,8 +29,6 @@
30
29
  "prop-types": "^15.7.2"
31
30
  },
32
31
  "files": [
33
- "build",
34
- "types"
35
- ],
36
- "types": "types"
32
+ "build"
33
+ ]
37
34
  }
package/types/index.d.ts DELETED
@@ -1,63 +0,0 @@
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>