@dhis2-ui/label 9.11.0 → 9.11.1-beta.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.
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
-
5
4
  (0, _cypressCucumberPreprocessor.Given)('a Label with children is rendered', () => {
6
5
  cy.visitStory('Label', 'With children');
7
6
  cy.get('[data-test="dhis2-uicore-label"]').should('be.visible');
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
-
5
4
  (0, _cypressCucumberPreprocessor.Given)('a Label with required is rendered', () => {
6
5
  cy.visitStory('Label', 'With required');
7
6
  });
@@ -9,5 +9,4 @@ Object.defineProperty(exports, "Label", {
9
9
  return _label.Label;
10
10
  }
11
11
  });
12
-
13
12
  var _label = require("./label.js");
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.WithRequired = exports.WithChildren = void 0;
7
+ var _label = require("@dhis2-ui/label");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ var _default = exports.default = {
11
+ title: 'Label'
12
+ };
13
+ const WithChildren = () => /*#__PURE__*/_react.default.createElement(_label.Label, null, "I am a child");
14
+ exports.WithChildren = WithChildren;
15
+ const WithRequired = () => /*#__PURE__*/_react.default.createElement(_label.Label, {
16
+ required: true
17
+ }, "Content");
18
+ exports.WithRequired = WithRequired;
@@ -4,24 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Label = void 0;
7
-
8
7
  var _style = _interopRequireDefault(require("styled-jsx/style"));
9
-
10
- var _required = require("@dhis2-ui/required");
11
-
12
8
  var _uiConstants = require("@dhis2/ui-constants");
13
-
9
+ var _required = require("@dhis2-ui/required");
14
10
  var _classnames = _interopRequireDefault(require("classnames"));
15
-
16
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
17
-
18
12
  var _react = _interopRequireDefault(require("react"));
19
-
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
- const styles = ["label.jsx-2904627559{display:block;box-sizing:border-box;font-size:14px;line-height:19px;color:".concat(_uiConstants.colors.grey900, ";padding:0;}"), ".disabled.jsx-2904627559{cursor:not-allowed;}"];
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ const styles = [`label.jsx-2904627559{display:block;box-sizing:border-box;font-size:14px;line-height:19px;color:${_uiConstants.colors.grey900};padding:0;}`, ".disabled.jsx-2904627559{cursor:not-allowed;}"];
23
15
  styles.__hash = "2904627559";
24
-
25
16
  const constructClassName = _ref => {
26
17
  let {
27
18
  disabled,
@@ -31,7 +22,6 @@ const constructClassName = _ref => {
31
22
  disabled: disabled
32
23
  });
33
24
  };
34
-
35
25
  const Label = _ref2 => {
36
26
  let {
37
27
  htmlFor,
@@ -44,19 +34,18 @@ const Label = _ref2 => {
44
34
  return /*#__PURE__*/_react.default.createElement("label", {
45
35
  htmlFor: htmlFor,
46
36
  "data-test": dataTest,
47
- className: "jsx-".concat(styles.__hash) + " " + (constructClassName({
37
+ className: `jsx-${styles.__hash}` + " " + (constructClassName({
48
38
  className,
49
39
  disabled
50
40
  }) || "")
51
41
  }, /*#__PURE__*/_react.default.createElement("span", {
52
- className: "jsx-".concat(styles.__hash)
42
+ className: `jsx-${styles.__hash}`
53
43
  }, children), required && /*#__PURE__*/_react.default.createElement(_required.Required, {
54
- dataTest: "".concat(dataTest, "-required")
44
+ dataTest: `${dataTest}-required`
55
45
  }), /*#__PURE__*/_react.default.createElement(_style.default, {
56
46
  id: styles.__hash
57
47
  }, styles));
58
48
  };
59
-
60
49
  exports.Label = Label;
61
50
  Label.defaultProps = {
62
51
  dataTest: 'dhis2-uicore-label'
@@ -0,0 +1,9 @@
1
+ import { Label } from '@dhis2-ui/label';
2
+ import React from 'react';
3
+ export default {
4
+ title: 'Label'
5
+ };
6
+ export const WithChildren = () => /*#__PURE__*/React.createElement(Label, null, "I am a child");
7
+ export const WithRequired = () => /*#__PURE__*/React.createElement(Label, {
8
+ required: true
9
+ }, "Content");
package/build/es/label.js CHANGED
@@ -1,12 +1,11 @@
1
1
  import _JSXStyle from "styled-jsx/style";
2
- import { Required } from '@dhis2-ui/required';
3
2
  import { colors } from '@dhis2/ui-constants';
3
+ import { Required } from '@dhis2-ui/required';
4
4
  import cx from 'classnames';
5
5
  import PropTypes from 'prop-types';
6
6
  import React from 'react';
7
- const styles = ["label.jsx-2904627559{display:block;box-sizing:border-box;font-size:14px;line-height:19px;color:".concat(colors.grey900, ";padding:0;}"), ".disabled.jsx-2904627559{cursor:not-allowed;}"];
7
+ const styles = [`label.jsx-2904627559{display:block;box-sizing:border-box;font-size:14px;line-height:19px;color:${colors.grey900};padding:0;}`, ".disabled.jsx-2904627559{cursor:not-allowed;}"];
8
8
  styles.__hash = "2904627559";
9
-
10
9
  const constructClassName = _ref => {
11
10
  let {
12
11
  disabled,
@@ -16,7 +15,6 @@ const constructClassName = _ref => {
16
15
  disabled: disabled
17
16
  });
18
17
  };
19
-
20
18
  export const Label = _ref2 => {
21
19
  let {
22
20
  htmlFor,
@@ -29,14 +27,14 @@ export const Label = _ref2 => {
29
27
  return /*#__PURE__*/React.createElement("label", {
30
28
  htmlFor: htmlFor,
31
29
  "data-test": dataTest,
32
- className: "jsx-".concat(styles.__hash) + " " + (constructClassName({
30
+ className: `jsx-${styles.__hash}` + " " + (constructClassName({
33
31
  className,
34
32
  disabled
35
33
  }) || "")
36
34
  }, /*#__PURE__*/React.createElement("span", {
37
- className: "jsx-".concat(styles.__hash)
35
+ className: `jsx-${styles.__hash}`
38
36
  }, children), required && /*#__PURE__*/React.createElement(Required, {
39
- dataTest: "".concat(dataTest, "-required")
37
+ dataTest: `${dataTest}-required`
40
38
  }), /*#__PURE__*/React.createElement(_JSXStyle, {
41
39
  id: styles.__hash
42
40
  }, styles));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/label",
3
- "version": "9.11.0",
3
+ "version": "9.11.1-beta.2",
4
4
  "description": "UI Label",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,19 +22,19 @@
22
22
  "access": "public"
23
23
  },
24
24
  "scripts": {
25
- "start": "start-storybook -c ../../storybook/config --port 5000",
25
+ "start": "storybook dev -c ../../storybook/config --port 5000",
26
26
  "build": "d2-app-scripts build",
27
27
  "test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
28
28
  },
29
29
  "peerDependencies": {
30
- "react": "^16.8",
31
- "react-dom": "^16.8",
30
+ "react": "^16.13",
31
+ "react-dom": "^16.13",
32
32
  "styled-jsx": "^4"
33
33
  },
34
34
  "dependencies": {
35
35
  "@dhis2/prop-types": "^3.1.2",
36
- "@dhis2-ui/required": "9.11.0",
37
- "@dhis2/ui-constants": "9.11.0",
36
+ "@dhis2-ui/required": "9.11.1-beta.2",
37
+ "@dhis2/ui-constants": "9.11.1-beta.2",
38
38
  "classnames": "^2.3.1",
39
39
  "prop-types": "^15.7.2"
40
40
  },
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- var _label = require("@dhis2-ui/label");
4
-
5
- var _react = require("@storybook/react");
6
-
7
- var _react2 = _interopRequireDefault(require("react"));
8
-
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
-
11
- (0, _react.storiesOf)('Label', module).add('With children', () => /*#__PURE__*/_react2.default.createElement(_label.Label, null, "I am a child")).add('With required', () => /*#__PURE__*/_react2.default.createElement(_label.Label, {
12
- required: true
13
- }, "Content"));
@@ -1,6 +0,0 @@
1
- import { Label } from '@dhis2-ui/label';
2
- import { storiesOf } from '@storybook/react';
3
- import React from 'react';
4
- storiesOf('Label', module).add('With children', () => /*#__PURE__*/React.createElement(Label, null, "I am a child")).add('With required', () => /*#__PURE__*/React.createElement(Label, {
5
- required: true
6
- }, "Content"));