@dhis2-ui/cover 8.1.11 → 8.2.2

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.
@@ -24,22 +24,25 @@ const createClickHandler = onClick => event => {
24
24
  }
25
25
  };
26
26
 
27
- const Cover = ({
28
- children,
29
- className,
30
- dataTest,
31
- onClick,
32
- translucent
33
- }) => /*#__PURE__*/_react.default.createElement("div", {
34
- onClick: createClickHandler(onClick),
35
- "data-test": dataTest,
36
- className: _style.default.dynamic([["3798453419", [_uiConstants.layers.applicationTop]]]) + " " + ((0, _classnames.default)(className, {
27
+ const Cover = _ref => {
28
+ let {
29
+ children,
30
+ className,
31
+ dataTest,
32
+ onClick,
37
33
  translucent
38
- }) || "")
39
- }, children, /*#__PURE__*/_react.default.createElement(_style.default, {
40
- id: "3798453419",
41
- dynamic: [_uiConstants.layers.applicationTop]
42
- }, [`div.__jsx-style-dynamic-selector{position:absolute;top:0;right:0;bottom:0;left:0;z-index:${_uiConstants.layers.applicationTop};}`, "div.translucent.__jsx-style-dynamic-selector{background:rgba(33,43,54,0.4);}"]));
34
+ } = _ref;
35
+ return /*#__PURE__*/_react.default.createElement("div", {
36
+ onClick: createClickHandler(onClick),
37
+ "data-test": dataTest,
38
+ className: _style.default.dynamic([["3798453419", [_uiConstants.layers.applicationTop]]]) + " " + ((0, _classnames.default)(className, {
39
+ translucent
40
+ }) || "")
41
+ }, children, /*#__PURE__*/_react.default.createElement(_style.default, {
42
+ id: "3798453419",
43
+ dynamic: [_uiConstants.layers.applicationTop]
44
+ }, ["div.__jsx-style-dynamic-selector{position:absolute;top:0;right:0;bottom:0;left:0;z-index:".concat(_uiConstants.layers.applicationTop, ";}"), "div.translucent.__jsx-style-dynamic-selector{background:rgba(33,43,54,0.4);}"]));
45
+ };
43
46
 
44
47
  exports.Cover = Cover;
45
48
  Cover.defaultProps = {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.WithClickHandler = exports.Blocking = exports.WithChildren = exports.default = void 0;
6
+ exports.default = exports.WithClickHandler = exports.WithChildren = exports.Blocking = void 0;
7
7
 
8
8
  var _style = _interopRequireDefault(require("styled-jsx/style"));
9
9
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.WithCenteredContentCircularLoader = exports.WithClickHandler = exports.Translucent = exports.Default = exports.default = void 0;
6
+ exports.default = exports.WithClickHandler = exports.WithCenteredContentCircularLoader = exports.Translucent = exports.Default = void 0;
7
7
 
8
8
  var _center = require("@dhis2-ui/center");
9
9
 
@@ -15,15 +15,9 @@ var _cover = require("./cover.js");
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
18
- const description = `
19
- Covers sibling components. Useful for covering a component while it is loading.
20
-
21
- \`\`\`js
22
- import { Cover } from '@dhis2/ui'
23
- \`\`\`
24
- `;
18
+ const description = "\nCovers sibling components. Useful for covering a component while it is loading.\n\n```js\nimport { Cover } from '@dhis2/ui'\n```\n";
25
19
  var _default = {
26
- title: 'Helpers/Component Cover',
20
+ title: 'Component Cover',
27
21
  component: _cover.Cover,
28
22
  parameters: {
29
23
  docs: {
@@ -15,7 +15,8 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
15
15
  cy.get('[data-test="dhis2-uicore-componentcover"]').click();
16
16
  });
17
17
  (0, _steps.When)('the user clicks on the button coordinates', () => {
18
- cy.getPositionsBySelectors('button').then(([rect]) => {
18
+ cy.getPositionsBySelectors('button').then(_ref => {
19
+ let [rect] = _ref;
19
20
  // Get button center coordinates
20
21
  const buttonCenterX = rect.left + rect.width / 2;
21
22
  const buttonCenterY = rect.top + rect.height / 2; // click body on the button center
package/build/es/cover.js CHANGED
@@ -11,22 +11,25 @@ const createClickHandler = onClick => event => {
11
11
  }
12
12
  };
13
13
 
14
- const Cover = ({
15
- children,
16
- className,
17
- dataTest,
18
- onClick,
19
- translucent
20
- }) => /*#__PURE__*/React.createElement("div", {
21
- onClick: createClickHandler(onClick),
22
- "data-test": dataTest,
23
- className: _JSXStyle.dynamic([["3798453419", [layers.applicationTop]]]) + " " + (cx(className, {
14
+ const Cover = _ref => {
15
+ let {
16
+ children,
17
+ className,
18
+ dataTest,
19
+ onClick,
24
20
  translucent
25
- }) || "")
26
- }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
27
- id: "3798453419",
28
- dynamic: [layers.applicationTop]
29
- }, [`div.__jsx-style-dynamic-selector{position:absolute;top:0;right:0;bottom:0;left:0;z-index:${layers.applicationTop};}`, "div.translucent.__jsx-style-dynamic-selector{background:rgba(33,43,54,0.4);}"]));
21
+ } = _ref;
22
+ return /*#__PURE__*/React.createElement("div", {
23
+ onClick: createClickHandler(onClick),
24
+ "data-test": dataTest,
25
+ className: _JSXStyle.dynamic([["3798453419", [layers.applicationTop]]]) + " " + (cx(className, {
26
+ translucent
27
+ }) || "")
28
+ }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
29
+ id: "3798453419",
30
+ dynamic: [layers.applicationTop]
31
+ }, ["div.__jsx-style-dynamic-selector{position:absolute;top:0;right:0;bottom:0;left:0;z-index:".concat(layers.applicationTop, ";}"), "div.translucent.__jsx-style-dynamic-selector{background:rgba(33,43,54,0.4);}"]));
32
+ };
30
33
 
31
34
  Cover.defaultProps = {
32
35
  dataTest: 'dhis2-uicore-componentcover'
@@ -2,15 +2,9 @@ import { Center } from '@dhis2-ui/center';
2
2
  import { CircularLoader } from '@dhis2-ui/loader';
3
3
  import React from 'react';
4
4
  import { Cover } from './cover.js';
5
- const description = `
6
- Covers sibling components. Useful for covering a component while it is loading.
7
-
8
- \`\`\`js
9
- import { Cover } from '@dhis2/ui'
10
- \`\`\`
11
- `;
5
+ const description = "\nCovers sibling components. Useful for covering a component while it is loading.\n\n```js\nimport { Cover } from '@dhis2/ui'\n```\n";
12
6
  export default {
13
- title: 'Helpers/Component Cover',
7
+ title: 'Component Cover',
14
8
  component: Cover,
15
9
  parameters: {
16
10
  docs: {
@@ -12,7 +12,8 @@ When('the user clicks on the Cover', () => {
12
12
  cy.get('[data-test="dhis2-uicore-componentcover"]').click();
13
13
  });
14
14
  When('the user clicks on the button coordinates', () => {
15
- cy.getPositionsBySelectors('button').then(([rect]) => {
15
+ cy.getPositionsBySelectors('button').then(_ref => {
16
+ let [rect] = _ref;
16
17
  // Get button center coordinates
17
18
  const buttonCenterX = rect.left + rect.width / 2;
18
19
  const buttonCenterY = rect.top + rect.height / 2; // click body on the button center
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/cover",
3
- "version": "8.1.11",
3
+ "version": "8.2.2",
4
4
  "description": "UI Cover",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@dhis2/prop-types": "^3.0.0-beta.1",
35
- "@dhis2/ui-constants": "8.1.11",
35
+ "@dhis2/ui-constants": "8.2.2",
36
36
  "classnames": "^2.3.1",
37
37
  "prop-types": "^15.7.2"
38
38
  },