@dhis2/ui-constants 8.16.0 → 9.0.0-alpha.2

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 = exports.buttonVariantPropType = exports.buttonVariantArgType = 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,22 +29,12 @@ 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
32
  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
33
+ const buttonVariantArgType = // No description because it should be set for the component description
34
+ {
44
35
  table: {
45
36
  type: {
46
- summary: 'bool',
47
- detail: "'primary', 'secondary', and 'destructive' are mutually exclusive props"
37
+ summary: 'bool'
48
38
  }
49
39
  },
50
40
  control: {
@@ -18,20 +18,11 @@ 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
21
+ export const buttonVariantArgType = // No description because it should be set for the component description
22
+ {
31
23
  table: {
32
24
  type: {
33
- summary: 'bool',
34
- detail: "'primary', 'secondary', and 'destructive' are mutually exclusive props"
25
+ summary: 'bool'
35
26
  }
36
27
  },
37
28
  control: {
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@dhis2/ui-constants",
3
- "version": "8.16.0",
3
+ "version": "9.0.0-alpha.2",
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
  }
@@ -0,0 +1,78 @@
1
+ import { bool } from 'prop-types'
2
+ import {
3
+ insideAlignmentPropType,
4
+ popperPlacementPropType,
5
+ popperReferencePropType,
6
+ } from '../src/shared-prop-types'
7
+
8
+ export type ColorBase = 'blue' | 'teal' | 'red' | 'yellow' | 'green' | 'grey'
9
+ export type ColorVariant =
10
+ | '900'
11
+ | '800'
12
+ | '700'
13
+ | '600'
14
+ | '500'
15
+ | '400'
16
+ | '300'
17
+ | '200'
18
+ | '100'
19
+ | '050'
20
+ export type ColorProp = `${ColorBase}${ColorVariant}` | 'white'
21
+
22
+ export const colors: Record<ColorProp, string>
23
+
24
+ export type ElevantionVariant = 'e100' | 'e200' | 'e300' | 'e400'
25
+ export const elevations: Record<ElevantionVariant, string>
26
+
27
+ export type SpacerVariant =
28
+ | 'dp4'
29
+ | 'dp8'
30
+ | 'dp12'
31
+ | 'dp16'
32
+ | 'dp24'
33
+ | 'dp32'
34
+ | 'dp48'
35
+ | 'dp64'
36
+ | 'dp96'
37
+ | 'dp128'
38
+ | 'dp192'
39
+ | 'dp256'
40
+ | 'dp384'
41
+ | 'dp512'
42
+ | 'dp640'
43
+ export const spacersNum: Record<SpacerVariant, number>
44
+ export const spacers: Record<SpacerVariant, string>
45
+
46
+ export type LayerVariant = 'applicationTop' | 'blocking' | 'alert'
47
+ export const layer: Record<LayerVariant, number>
48
+
49
+ export type ThemeBase = 'primary' | 'secondary'
50
+ export type ThemeVariant =
51
+ | '900'
52
+ | '800'
53
+ | '700'
54
+ | '600'
55
+ | '500'
56
+ | '400'
57
+ | '300'
58
+ | '200'
59
+ | '100'
60
+ | '050'
61
+ export type ThemeProp =
62
+ | `${ThemeBase}${ThemeVariant}`
63
+ | 'default'
64
+ | 'error'
65
+ | 'valid'
66
+ | 'warning'
67
+ | 'disabled'
68
+ | 'focus'
69
+ | 'fonts'
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
+ }