@dhis2-ui/loader 10.0.0-alpha.6 → 10.0.0-alpha.8

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.
@@ -6,7 +6,7 @@ var _circularLoader = require("../circular-loader.js");
6
6
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
7
7
  describe('Circular Loader', () => {
8
8
  it('renders the circular loader with aria label', () => {
9
- const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_circularLoader.CircularLoader, {
9
+ const wrapper = (0, _enzyme.mount)(/*#__PURE__*/_react.default.createElement(_circularLoader.CircularLoader, {
10
10
  dataTest: 'circular-loader-test',
11
11
  "aria-label": "Circular Loader"
12
12
  }));
@@ -17,7 +17,7 @@ describe('Circular Loader', () => {
17
17
  expect(actual.prop('aria-label')).toBe('Circular Loader');
18
18
  });
19
19
  it('renders the circular loader without aria label', () => {
20
- const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_circularLoader.CircularLoader, {
20
+ const wrapper = (0, _enzyme.mount)(/*#__PURE__*/_react.default.createElement(_circularLoader.CircularLoader, {
21
21
  dataTest: 'circular-loader-test'
22
22
  }));
23
23
  const actual = wrapper.find({
@@ -17,7 +17,7 @@ const CircularLoader = _ref => {
17
17
  extrasmall,
18
18
  invert,
19
19
  className,
20
- dataTest,
20
+ dataTest = 'dhis2-uicore-circularloader',
21
21
  'aria-label': ariaLabel
22
22
  } = _ref;
23
23
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -36,9 +36,6 @@ const CircularLoader = _ref => {
36
36
  }, [`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};}`]));
37
37
  };
38
38
  exports.CircularLoader = CircularLoader;
39
- CircularLoader.defaultProps = {
40
- dataTest: 'dhis2-uicore-circularloader'
41
- };
42
39
  CircularLoader.propTypes = {
43
40
  'aria-label': _propTypes.default.string,
44
41
  className: _propTypes.default.string,
@@ -6,7 +6,7 @@ var _linearLoader = require("../linear-loader.js");
6
6
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
7
7
  describe('Linear Loader', () => {
8
8
  it('renders the linear loader with provided aria attributes', () => {
9
- const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_linearLoader.LinearLoader, {
9
+ const wrapper = (0, _enzyme.mount)(/*#__PURE__*/_react.default.createElement(_linearLoader.LinearLoader, {
10
10
  dataTest: 'linear-loader-test',
11
11
  "aria-label": "Linear Loader",
12
12
  amount: 15
@@ -19,7 +19,7 @@ describe('Linear Loader', () => {
19
19
  expect(actual.prop('aria-valuenow')).toBe(15);
20
20
  });
21
21
  it('renders the linear loader without aria label', () => {
22
- const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_linearLoader.LinearLoader, {
22
+ const wrapper = (0, _enzyme.mount)(/*#__PURE__*/_react.default.createElement(_linearLoader.LinearLoader, {
23
23
  dataTest: 'linear-loader-test',
24
24
  amount: 45
25
25
  }));
@@ -36,11 +36,11 @@ Progress.propTypes = {
36
36
  const LinearLoader = _ref2 => {
37
37
  let {
38
38
  amount,
39
- width,
40
- margin,
39
+ width = '300px',
40
+ margin = _uiConstants.spacers.dp12,
41
41
  invert,
42
42
  className,
43
- dataTest,
43
+ dataTest = 'dhis2-uicore-linearloader',
44
44
  'aria-label': ariaLabel
45
45
  } = _ref2;
46
46
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -62,11 +62,6 @@ const LinearLoader = _ref2 => {
62
62
  }, [`div.__jsx-style-dynamic-selector{width:${width};margin:${margin};}`]));
63
63
  };
64
64
  exports.LinearLoader = LinearLoader;
65
- LinearLoader.defaultProps = {
66
- margin: _uiConstants.spacers.dp12,
67
- width: '300px',
68
- dataTest: 'dhis2-uicore-linearloader'
69
- };
70
65
  LinearLoader.propTypes = {
71
66
  /** The progression in percent without the '%' sign */
72
67
  amount: _propTypes.default.number.isRequired,
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { CircularLoader } from '../circular-loader.js';
4
4
  describe('Circular Loader', () => {
5
5
  it('renders the circular loader with aria label', () => {
6
- const wrapper = mount( /*#__PURE__*/React.createElement(CircularLoader, {
6
+ const wrapper = mount(/*#__PURE__*/React.createElement(CircularLoader, {
7
7
  dataTest: 'circular-loader-test',
8
8
  "aria-label": "Circular Loader"
9
9
  }));
@@ -14,7 +14,7 @@ describe('Circular Loader', () => {
14
14
  expect(actual.prop('aria-label')).toBe('Circular Loader');
15
15
  });
16
16
  it('renders the circular loader without aria label', () => {
17
- const wrapper = mount( /*#__PURE__*/React.createElement(CircularLoader, {
17
+ const wrapper = mount(/*#__PURE__*/React.createElement(CircularLoader, {
18
18
  dataTest: 'circular-loader-test'
19
19
  }));
20
20
  const actual = wrapper.find({
@@ -10,7 +10,7 @@ const CircularLoader = _ref => {
10
10
  extrasmall,
11
11
  invert,
12
12
  className,
13
- dataTest,
13
+ dataTest = 'dhis2-uicore-circularloader',
14
14
  'aria-label': ariaLabel
15
15
  } = _ref;
16
16
  return /*#__PURE__*/React.createElement("div", {
@@ -28,9 +28,6 @@ const CircularLoader = _ref => {
28
28
  dynamic: [colors.blue600, colors.white]
29
29
  }, [`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};}`]));
30
30
  };
31
- CircularLoader.defaultProps = {
32
- dataTest: 'dhis2-uicore-circularloader'
33
- };
34
31
  CircularLoader.propTypes = {
35
32
  'aria-label': PropTypes.string,
36
33
  className: PropTypes.string,
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { LinearLoader } from '../linear-loader.js';
4
4
  describe('Linear Loader', () => {
5
5
  it('renders the linear loader with provided aria attributes', () => {
6
- const wrapper = mount( /*#__PURE__*/React.createElement(LinearLoader, {
6
+ const wrapper = mount(/*#__PURE__*/React.createElement(LinearLoader, {
7
7
  dataTest: 'linear-loader-test',
8
8
  "aria-label": "Linear Loader",
9
9
  amount: 15
@@ -16,7 +16,7 @@ describe('Linear Loader', () => {
16
16
  expect(actual.prop('aria-valuenow')).toBe(15);
17
17
  });
18
18
  it('renders the linear loader without aria label', () => {
19
- const wrapper = mount( /*#__PURE__*/React.createElement(LinearLoader, {
19
+ const wrapper = mount(/*#__PURE__*/React.createElement(LinearLoader, {
20
20
  dataTest: 'linear-loader-test',
21
21
  amount: 45
22
22
  }));
@@ -29,11 +29,11 @@ Progress.propTypes = {
29
29
  const LinearLoader = _ref2 => {
30
30
  let {
31
31
  amount,
32
- width,
33
- margin,
32
+ width = '300px',
33
+ margin = spacers.dp12,
34
34
  invert,
35
35
  className,
36
- dataTest,
36
+ dataTest = 'dhis2-uicore-linearloader',
37
37
  'aria-label': ariaLabel
38
38
  } = _ref2;
39
39
  return /*#__PURE__*/React.createElement("div", {
@@ -54,11 +54,6 @@ const LinearLoader = _ref2 => {
54
54
  dynamic: [width, margin]
55
55
  }, [`div.__jsx-style-dynamic-selector{width:${width};margin:${margin};}`]));
56
56
  };
57
- LinearLoader.defaultProps = {
58
- margin: spacers.dp12,
59
- width: '300px',
60
- dataTest: 'dhis2-uicore-linearloader'
61
- };
62
57
  LinearLoader.propTypes = {
63
58
  /** The progression in percent without the '%' sign */
64
59
  amount: PropTypes.number.isRequired,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/loader",
3
- "version": "10.0.0-alpha.6",
3
+ "version": "10.0.0-alpha.8",
4
4
  "description": "UI Loaders",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,13 +27,13 @@
27
27
  "test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
28
28
  },
29
29
  "peerDependencies": {
30
- "react": "^16.13",
31
- "react-dom": "^16.13",
30
+ "react": "^16.13 || ^18",
31
+ "react-dom": "^16.13 || ^18",
32
32
  "styled-jsx": "^4"
33
33
  },
34
34
  "dependencies": {
35
35
  "@dhis2/prop-types": "^3.1.2",
36
- "@dhis2/ui-constants": "10.0.0-alpha.6",
36
+ "@dhis2/ui-constants": "10.0.0-alpha.8",
37
37
  "classnames": "^2.3.1",
38
38
  "prop-types": "^15.7.2"
39
39
  },
@@ -42,8 +42,8 @@
42
42
  "types"
43
43
  ],
44
44
  "devDependencies": {
45
- "react": "16.13",
46
- "react-dom": "16.13",
45
+ "react": "^18.3.1",
46
+ "react-dom": "^18.3.1",
47
47
  "styled-jsx": "^4.0.1"
48
48
  },
49
49
  "types": "types"