@dhis2-ui/loader 8.1.10 → 8.2.1

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.
@@ -17,26 +17,29 @@ var _react = _interopRequireDefault(require("react"));
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
20
- const CircularLoader = ({
21
- small,
22
- large,
23
- extrasmall,
24
- invert,
25
- className,
26
- dataTest
27
- }) => /*#__PURE__*/_react.default.createElement("div", {
28
- role: "progressbar",
29
- "data-test": dataTest,
30
- className: _style.default.dynamic([["3803726117", [_uiConstants.colors.blue600, _uiConstants.colors.white]]]) + " " + ((0, _classnames.default)(className, {
20
+ const CircularLoader = _ref => {
21
+ let {
31
22
  small,
32
23
  large,
33
24
  extrasmall,
34
- invert
35
- }) || "")
36
- }, /*#__PURE__*/_react.default.createElement(_style.default, {
37
- id: "3803726117",
38
- dynamic: [_uiConstants.colors.blue600, _uiConstants.colors.white]
39
- }, [`div.__jsx-style-dynamic-selector{width:48px;height:48px;border:6px solid rgba(110,122,138,0.15);border-bottom-color:${_uiConstants.colors.blue600};border-radius:50%;-webkit-animation:rotation-__jsx-style-dynamic-selector 1s linear infinite;animation:rotation-__jsx-style-dynamic-selector 1s linear infinite;}`, "@-webkit-keyframes rotation-__jsx-style-dynamic-selector{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}", "@keyframes rotation-__jsx-style-dynamic-selector{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}", ".small.__jsx-style-dynamic-selector{width:24px;height:24px;border-width:4px;}", ".large.__jsx-style-dynamic-selector{width:72px;height:72px;border-width:8px;}", ".extrasmall.__jsx-style-dynamic-selector{width:16px;height:16px;border-width:2px;}", `.invert.__jsx-style-dynamic-selector{border-color:rgba(33,41,52,0.5);border-bottom-color:${_uiConstants.colors.white};}`]));
25
+ invert,
26
+ className,
27
+ dataTest
28
+ } = _ref;
29
+ return /*#__PURE__*/_react.default.createElement("div", {
30
+ role: "progressbar",
31
+ "data-test": dataTest,
32
+ className: _style.default.dynamic([["3803726117", [_uiConstants.colors.blue600, _uiConstants.colors.white]]]) + " " + ((0, _classnames.default)(className, {
33
+ small,
34
+ large,
35
+ extrasmall,
36
+ invert
37
+ }) || "")
38
+ }, /*#__PURE__*/_react.default.createElement(_style.default, {
39
+ id: "3803726117",
40
+ dynamic: [_uiConstants.colors.blue600, _uiConstants.colors.white]
41
+ }, ["div.__jsx-style-dynamic-selector{width:48px;height:48px;border:6px solid rgba(110,122,138,0.15);border-bottom-color:".concat(_uiConstants.colors.blue600, ";border-radius:50%;-webkit-animation:rotation-__jsx-style-dynamic-selector 1s linear infinite;animation:rotation-__jsx-style-dynamic-selector 1s linear infinite;}"), "@-webkit-keyframes rotation-__jsx-style-dynamic-selector{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}", "@keyframes rotation-__jsx-style-dynamic-selector{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}", ".small.__jsx-style-dynamic-selector{width:24px;height:24px;border-width:4px;}", ".large.__jsx-style-dynamic-selector{width:72px;height:72px;border-width:8px;}", ".extrasmall.__jsx-style-dynamic-selector{width:16px;height:16px;border-width:2px;}", ".invert.__jsx-style-dynamic-selector{border-color:rgba(33,41,52,0.5);border-bottom-color:".concat(_uiConstants.colors.white, ";}")]));
42
+ };
40
43
 
41
44
  exports.CircularLoader = CircularLoader;
42
45
  CircularLoader.defaultProps = {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ExtraSmall = exports.Large = exports.Small = exports.Default = exports.default = void 0;
6
+ exports.default = exports.Small = exports.Large = exports.ExtraSmall = exports.Default = void 0;
7
7
 
8
8
  var _uiConstants = require("@dhis2/ui-constants");
9
9
 
@@ -13,18 +13,10 @@ var _index = require("./index.js");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
- const subtitle = `Used to inform the user that an element or page is in a loading state`;
17
- const description = `
18
- Use loading indicators whenever a component or application takes longer than 700ms to load. After this time a loader should be displayed so that the user can understand what is happening: loading is in progress. Consider that without a loading indicator a user would be unsure of their current status, so they are important UI elements.
19
-
20
- A circular loader is used when the loading time is uncertain and cannot be displayed as a percentage. A circular loader can spin many times, and each spin does not represent any amount of completion.
21
-
22
- \`\`\`js
23
- import { CircularLoader } from '@dhis2/ui'
24
- \`\`\`
25
- `;
16
+ const subtitle = "Used to inform the user that an element or page is in a loading state";
17
+ const description = "\nUse loading indicators whenever a component or application takes longer than 700ms to load. After this time a loader should be displayed so that the user can understand what is happening: loading is in progress. Consider that without a loading indicator a user would be unsure of their current status, so they are important UI elements.\n\nA circular loader is used when the loading time is uncertain and cannot be displayed as a percentage. A circular loader can spin many times, and each spin does not represent any amount of completion.\n\n```js\nimport { CircularLoader } from '@dhis2/ui'\n```\n";
26
18
  var _default = {
27
- title: 'Feedback/Loading Indicators/Circular Loader',
19
+ title: 'Circular Loader',
28
20
  component: _index.CircularLoader,
29
21
  parameters: {
30
22
  componentSubtitle: subtitle,
@@ -3,16 +3,16 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "LinearLoader", {
6
+ Object.defineProperty(exports, "CircularLoader", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _index.LinearLoader;
9
+ return _index2.CircularLoader;
10
10
  }
11
11
  });
12
- Object.defineProperty(exports, "CircularLoader", {
12
+ Object.defineProperty(exports, "LinearLoader", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _index2.CircularLoader;
15
+ return _index.LinearLoader;
16
16
  }
17
17
  });
18
18
 
@@ -17,11 +17,12 @@ var _react = _interopRequireDefault(require("react"));
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
20
- const Progress = ({
21
- amount,
22
- invert,
23
- className
24
- }) => {
20
+ const Progress = _ref => {
21
+ let {
22
+ amount,
23
+ invert,
24
+ className
25
+ } = _ref;
25
26
  return /*#__PURE__*/_react.default.createElement("div", {
26
27
  className: _style.default.dynamic([["686723300", [amount]], ["3392977398", [_uiConstants.theme.primary600, _uiConstants.colors.white]]]) + " " + ((0, _classnames.default)(className, {
27
28
  invert
@@ -29,10 +30,10 @@ const Progress = ({
29
30
  }, /*#__PURE__*/_react.default.createElement(_style.default, {
30
31
  id: "686723300",
31
32
  dynamic: [amount]
32
- }, [`div.__jsx-style-dynamic-selector{width:${amount}%;}`]), /*#__PURE__*/_react.default.createElement(_style.default, {
33
+ }, ["div.__jsx-style-dynamic-selector{width:".concat(amount, "%;}")]), /*#__PURE__*/_react.default.createElement(_style.default, {
33
34
  id: "3392977398",
34
35
  dynamic: [_uiConstants.theme.primary600, _uiConstants.colors.white]
35
- }, [`div.__jsx-style-dynamic-selector{background-color:${_uiConstants.theme.primary600};-webkit-transition:width 0.3s linear;transition:width 0.3s linear;height:4px;}`, `.invert.__jsx-style-dynamic-selector{background-color:${_uiConstants.colors.white};}`]));
36
+ }, ["div.__jsx-style-dynamic-selector{background-color:".concat(_uiConstants.theme.primary600, ";-webkit-transition:width 0.3s linear;transition:width 0.3s linear;height:4px;}"), ".invert.__jsx-style-dynamic-selector{background-color:".concat(_uiConstants.colors.white, ";}")]));
36
37
  };
37
38
 
38
39
  Progress.propTypes = {
@@ -41,14 +42,15 @@ Progress.propTypes = {
41
42
  invert: _propTypes.default.bool
42
43
  };
43
44
 
44
- const LinearLoader = ({
45
- amount,
46
- width,
47
- margin,
48
- invert,
49
- className,
50
- dataTest
51
- }) => {
45
+ const LinearLoader = _ref2 => {
46
+ let {
47
+ amount,
48
+ width,
49
+ margin,
50
+ invert,
51
+ className,
52
+ dataTest
53
+ } = _ref2;
52
54
  return /*#__PURE__*/_react.default.createElement("div", {
53
55
  role: "progressbar",
54
56
  "data-test": dataTest,
@@ -63,7 +65,7 @@ const LinearLoader = ({
63
65
  }, ["div.jsx-3127531794{display:block;overflow:hidden;overflow-x:hidden;overflow-y:hidden;background-color:rgba(110,122,138,0.15);}", ".invert.jsx-3127531794{background-color:rgba(33,41,52,0.5);}"]), /*#__PURE__*/_react.default.createElement(_style.default, {
64
66
  id: "3224415970",
65
67
  dynamic: [width, margin]
66
- }, [`div.__jsx-style-dynamic-selector{width:${width};margin:${margin};}`]));
68
+ }, ["div.__jsx-style-dynamic-selector{width:".concat(width, ";margin:").concat(margin, ";}")]));
67
69
  };
68
70
 
69
71
  exports.LinearLoader = LinearLoader;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.OverlayComponent = exports.OverlayPage = exports.Determinate = exports.default = void 0;
6
+ exports.default = exports.OverlayPage = exports.OverlayComponent = exports.Determinate = void 0;
7
7
 
8
8
  var _center = require("@dhis2-ui/center");
9
9
 
@@ -19,18 +19,10 @@ var _index = require("./index.js");
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
22
- const subtitle = `Used to inform the user that an element or page is in a loading state`;
23
- const description = `
24
- Use loading indicators whenever a component or application takes longer than 700ms to load. After this time a loader should be displayed so that the user can understand what is happening: loading is in progress. Consider that without a loading indicator a user would be unsure of their current status, so they are important UI elements.
25
-
26
- A linear loader is used when the loading time is can be measured and displayed as a percentage.
27
-
28
- \`\`\`js
29
- import { LinearLoader } from '@dhis2/ui'
30
- \`\`\`
31
- `;
22
+ const subtitle = "Used to inform the user that an element or page is in a loading state";
23
+ const description = "\nUse loading indicators whenever a component or application takes longer than 700ms to load. After this time a loader should be displayed so that the user can understand what is happening: loading is in progress. Consider that without a loading indicator a user would be unsure of their current status, so they are important UI elements.\n\nA linear loader is used when the loading time is can be measured and displayed as a percentage.\n\n```js\nimport { LinearLoader } from '@dhis2/ui'\n```\n";
32
24
  var _default = {
33
- title: 'Feedback/Loading Indicators/Linear Loader',
25
+ title: 'Linear Loader',
34
26
  component: _index.LinearLoader,
35
27
  parameters: {
36
28
  componentSubtitle: subtitle,
@@ -4,26 +4,29 @@ import cx from 'classnames';
4
4
  import PropTypes from 'prop-types';
5
5
  import React from 'react';
6
6
 
7
- const CircularLoader = ({
8
- small,
9
- large,
10
- extrasmall,
11
- invert,
12
- className,
13
- dataTest
14
- }) => /*#__PURE__*/React.createElement("div", {
15
- role: "progressbar",
16
- "data-test": dataTest,
17
- className: _JSXStyle.dynamic([["3803726117", [colors.blue600, colors.white]]]) + " " + (cx(className, {
7
+ const CircularLoader = _ref => {
8
+ let {
18
9
  small,
19
10
  large,
20
11
  extrasmall,
21
- invert
22
- }) || "")
23
- }, /*#__PURE__*/React.createElement(_JSXStyle, {
24
- id: "3803726117",
25
- dynamic: [colors.blue600, colors.white]
26
- }, [`div.__jsx-style-dynamic-selector{width:48px;height:48px;border:6px solid rgba(110,122,138,0.15);border-bottom-color:${colors.blue600};border-radius:50%;-webkit-animation:rotation-__jsx-style-dynamic-selector 1s linear infinite;animation:rotation-__jsx-style-dynamic-selector 1s linear infinite;}`, "@-webkit-keyframes rotation-__jsx-style-dynamic-selector{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}", "@keyframes rotation-__jsx-style-dynamic-selector{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}", ".small.__jsx-style-dynamic-selector{width:24px;height:24px;border-width:4px;}", ".large.__jsx-style-dynamic-selector{width:72px;height:72px;border-width:8px;}", ".extrasmall.__jsx-style-dynamic-selector{width:16px;height:16px;border-width:2px;}", `.invert.__jsx-style-dynamic-selector{border-color:rgba(33,41,52,0.5);border-bottom-color:${colors.white};}`]));
12
+ invert,
13
+ className,
14
+ dataTest
15
+ } = _ref;
16
+ return /*#__PURE__*/React.createElement("div", {
17
+ role: "progressbar",
18
+ "data-test": dataTest,
19
+ className: _JSXStyle.dynamic([["3803726117", [colors.blue600, colors.white]]]) + " " + (cx(className, {
20
+ small,
21
+ large,
22
+ extrasmall,
23
+ invert
24
+ }) || "")
25
+ }, /*#__PURE__*/React.createElement(_JSXStyle, {
26
+ id: "3803726117",
27
+ dynamic: [colors.blue600, colors.white]
28
+ }, ["div.__jsx-style-dynamic-selector{width:48px;height:48px;border:6px solid rgba(110,122,138,0.15);border-bottom-color:".concat(colors.blue600, ";border-radius:50%;-webkit-animation:rotation-__jsx-style-dynamic-selector 1s linear infinite;animation:rotation-__jsx-style-dynamic-selector 1s linear infinite;}"), "@-webkit-keyframes rotation-__jsx-style-dynamic-selector{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}", "@keyframes rotation-__jsx-style-dynamic-selector{0%{-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}", ".small.__jsx-style-dynamic-selector{width:24px;height:24px;border-width:4px;}", ".large.__jsx-style-dynamic-selector{width:72px;height:72px;border-width:8px;}", ".extrasmall.__jsx-style-dynamic-selector{width:16px;height:16px;border-width:2px;}", ".invert.__jsx-style-dynamic-selector{border-color:rgba(33,41,52,0.5);border-bottom-color:".concat(colors.white, ";}")]));
29
+ };
27
30
 
28
31
  CircularLoader.defaultProps = {
29
32
  dataTest: 'dhis2-uicore-circularloader'
@@ -1,18 +1,10 @@
1
1
  import { sharedPropTypes } from '@dhis2/ui-constants';
2
2
  import React from 'react';
3
3
  import { CircularLoader } from './index.js';
4
- const subtitle = `Used to inform the user that an element or page is in a loading state`;
5
- const description = `
6
- Use loading indicators whenever a component or application takes longer than 700ms to load. After this time a loader should be displayed so that the user can understand what is happening: loading is in progress. Consider that without a loading indicator a user would be unsure of their current status, so they are important UI elements.
7
-
8
- A circular loader is used when the loading time is uncertain and cannot be displayed as a percentage. A circular loader can spin many times, and each spin does not represent any amount of completion.
9
-
10
- \`\`\`js
11
- import { CircularLoader } from '@dhis2/ui'
12
- \`\`\`
13
- `;
4
+ const subtitle = "Used to inform the user that an element or page is in a loading state";
5
+ const description = "\nUse loading indicators whenever a component or application takes longer than 700ms to load. After this time a loader should be displayed so that the user can understand what is happening: loading is in progress. Consider that without a loading indicator a user would be unsure of their current status, so they are important UI elements.\n\nA circular loader is used when the loading time is uncertain and cannot be displayed as a percentage. A circular loader can spin many times, and each spin does not represent any amount of completion.\n\n```js\nimport { CircularLoader } from '@dhis2/ui'\n```\n";
14
6
  export default {
15
- title: 'Feedback/Loading Indicators/Circular Loader',
7
+ title: 'Circular Loader',
16
8
  component: CircularLoader,
17
9
  parameters: {
18
10
  componentSubtitle: subtitle,
@@ -4,11 +4,12 @@ import cx from 'classnames';
4
4
  import PropTypes from 'prop-types';
5
5
  import React from 'react';
6
6
 
7
- const Progress = ({
8
- amount,
9
- invert,
10
- className
11
- }) => {
7
+ const Progress = _ref => {
8
+ let {
9
+ amount,
10
+ invert,
11
+ className
12
+ } = _ref;
12
13
  return /*#__PURE__*/React.createElement("div", {
13
14
  className: _JSXStyle.dynamic([["686723300", [amount]], ["3392977398", [theme.primary600, colors.white]]]) + " " + (cx(className, {
14
15
  invert
@@ -16,10 +17,10 @@ const Progress = ({
16
17
  }, /*#__PURE__*/React.createElement(_JSXStyle, {
17
18
  id: "686723300",
18
19
  dynamic: [amount]
19
- }, [`div.__jsx-style-dynamic-selector{width:${amount}%;}`]), /*#__PURE__*/React.createElement(_JSXStyle, {
20
+ }, ["div.__jsx-style-dynamic-selector{width:".concat(amount, "%;}")]), /*#__PURE__*/React.createElement(_JSXStyle, {
20
21
  id: "3392977398",
21
22
  dynamic: [theme.primary600, colors.white]
22
- }, [`div.__jsx-style-dynamic-selector{background-color:${theme.primary600};-webkit-transition:width 0.3s linear;transition:width 0.3s linear;height:4px;}`, `.invert.__jsx-style-dynamic-selector{background-color:${colors.white};}`]));
23
+ }, ["div.__jsx-style-dynamic-selector{background-color:".concat(theme.primary600, ";-webkit-transition:width 0.3s linear;transition:width 0.3s linear;height:4px;}"), ".invert.__jsx-style-dynamic-selector{background-color:".concat(colors.white, ";}")]));
23
24
  };
24
25
 
25
26
  Progress.propTypes = {
@@ -28,14 +29,15 @@ Progress.propTypes = {
28
29
  invert: PropTypes.bool
29
30
  };
30
31
 
31
- const LinearLoader = ({
32
- amount,
33
- width,
34
- margin,
35
- invert,
36
- className,
37
- dataTest
38
- }) => {
32
+ const LinearLoader = _ref2 => {
33
+ let {
34
+ amount,
35
+ width,
36
+ margin,
37
+ invert,
38
+ className,
39
+ dataTest
40
+ } = _ref2;
39
41
  return /*#__PURE__*/React.createElement("div", {
40
42
  role: "progressbar",
41
43
  "data-test": dataTest,
@@ -50,7 +52,7 @@ const LinearLoader = ({
50
52
  }, ["div.jsx-3127531794{display:block;overflow:hidden;overflow-x:hidden;overflow-y:hidden;background-color:rgba(110,122,138,0.15);}", ".invert.jsx-3127531794{background-color:rgba(33,41,52,0.5);}"]), /*#__PURE__*/React.createElement(_JSXStyle, {
51
53
  id: "3224415970",
52
54
  dynamic: [width, margin]
53
- }, [`div.__jsx-style-dynamic-selector{width:${width};margin:${margin};}`]));
55
+ }, ["div.__jsx-style-dynamic-selector{width:".concat(width, ";margin:").concat(margin, ";}")]));
54
56
  };
55
57
 
56
58
  LinearLoader.defaultProps = {
@@ -4,18 +4,10 @@ import { Layer } from '@dhis2-ui/layer';
4
4
  import { layers } from '@dhis2/ui-constants';
5
5
  import React from 'react';
6
6
  import { LinearLoader } from './index.js';
7
- const subtitle = `Used to inform the user that an element or page is in a loading state`;
8
- const description = `
9
- Use loading indicators whenever a component or application takes longer than 700ms to load. After this time a loader should be displayed so that the user can understand what is happening: loading is in progress. Consider that without a loading indicator a user would be unsure of their current status, so they are important UI elements.
10
-
11
- A linear loader is used when the loading time is can be measured and displayed as a percentage.
12
-
13
- \`\`\`js
14
- import { LinearLoader } from '@dhis2/ui'
15
- \`\`\`
16
- `;
7
+ const subtitle = "Used to inform the user that an element or page is in a loading state";
8
+ const description = "\nUse loading indicators whenever a component or application takes longer than 700ms to load. After this time a loader should be displayed so that the user can understand what is happening: loading is in progress. Consider that without a loading indicator a user would be unsure of their current status, so they are important UI elements.\n\nA linear loader is used when the loading time is can be measured and displayed as a percentage.\n\n```js\nimport { LinearLoader } from '@dhis2/ui'\n```\n";
17
9
  export default {
18
- title: 'Feedback/Loading Indicators/Linear Loader',
10
+ title: 'Linear Loader',
19
11
  component: LinearLoader,
20
12
  parameters: {
21
13
  componentSubtitle: subtitle,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/loader",
3
- "version": "8.1.10",
3
+ "version": "8.2.1",
4
4
  "description": "UI Loaders",
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.10",
35
+ "@dhis2/ui-constants": "8.2.1",
36
36
  "classnames": "^2.3.1",
37
37
  "prop-types": "^15.7.2"
38
38
  },