@dhis2/ui-constants 8.16.0-alpha.2 → 8.16.0
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.
- package/build/cjs/shared-prop-types.js +24 -2
 - package/build/es/shared-prop-types.js +20 -0
 - package/package.json +3 -6
 - package/types/index.d.ts +0 -78
 
| 
         @@ -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. 
     | 
| 
      
 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 
     | 
| 
      
 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 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
                ],
         
     | 
| 
       36 
     | 
    
         
            -
                "types": "types"
         
     | 
| 
      
 32 
     | 
    
         
            +
                    "build"
         
     | 
| 
      
 33 
     | 
    
         
            +
                ]
         
     | 
| 
       37 
34 
     | 
    
         
             
            }
         
     | 
    
        package/types/index.d.ts
    DELETED
    
    | 
         @@ -1,78 +0,0 @@ 
     | 
|
| 
       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 
     | 
    
         
            -
            }
         
     |