@dhis2-ui/help 9.10.3 → 9.11.1-beta.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.
@@ -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 Help component with children is rendered', () => {
6
5
  cy.visitStory('Help', 'With children');
7
6
  cy.get('[data-test="dhis2-uicore-help"]').should('be.visible');
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.WithChildren = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _help = require("./help.js");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ var _default = exports.default = {
11
+ title: 'Help'
12
+ };
13
+ const WithChildren = () => /*#__PURE__*/_react.default.createElement(_help.Help, null, "I am a child");
14
+ exports.WithChildren = WithChildren;
package/build/cjs/help.js CHANGED
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Help = void 0;
7
-
8
7
  var _style = _interopRequireDefault(require("styled-jsx/style"));
9
-
10
8
  var _uiConstants = require("@dhis2/ui-constants");
11
-
12
9
  var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
15
-
16
11
  var _react = _interopRequireDefault(require("react"));
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20
13
  const Help = _ref => {
21
14
  let {
22
15
  children,
@@ -36,9 +29,8 @@ const Help = _ref => {
36
29
  }, children, /*#__PURE__*/_react.default.createElement(_style.default, {
37
30
  id: "1832050605",
38
31
  dynamic: [_uiConstants.spacers.dp4, _uiConstants.theme.default, _uiConstants.colors.blue700, _uiConstants.theme.error, _uiConstants.colors.yellow800]
39
- }, ["p.__jsx-style-dynamic-selector{margin-top:".concat(_uiConstants.spacers.dp4, ";margin-right:0;margin-bottom:0;margin-left:0;font-size:12px;line-height:14px;color:").concat(_uiConstants.theme.default, ";}"), ".valid.__jsx-style-dynamic-selector{color:".concat(_uiConstants.colors.blue700, ";}"), ".error.__jsx-style-dynamic-selector{color:".concat(_uiConstants.theme.error, ";}"), ".warning.__jsx-style-dynamic-selector{color:".concat(_uiConstants.colors.yellow800, ";}")]));
32
+ }, [`p.__jsx-style-dynamic-selector{margin-top:${_uiConstants.spacers.dp4};margin-right:0;margin-bottom:0;margin-left:0;font-size:12px;line-height:14px;color:${_uiConstants.theme.default};}`, `.valid.__jsx-style-dynamic-selector{color:${_uiConstants.colors.blue700};}`, `.error.__jsx-style-dynamic-selector{color:${_uiConstants.theme.error};}`, `.warning.__jsx-style-dynamic-selector{color:${_uiConstants.colors.yellow800};}`]));
40
33
  };
41
-
42
34
  exports.Help = Help;
43
35
  Help.defaultProps = {
44
36
  dataTest: 'dhis2-uicore-help'
@@ -4,17 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.TextOverflow = exports.StatusWarning = exports.StatusValid = exports.StatusError = exports.Default = void 0;
7
-
8
7
  var _uiConstants = require("@dhis2/ui-constants");
9
-
10
8
  var _react = _interopRequireDefault(require("react"));
11
-
12
9
  var _help = require("./help.js");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ const description = `
12
+ Small text for giving guiding information or feedback, especially for data entry instructions or form validation feedback.
13
13
 
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- const description = "\nSmall text for giving guiding information or feedback, especially for data entry instructions or form validation feedback.\n\n```js\nimport { Help } from '@dhis2/ui'\n```\n";
17
- var _default = {
14
+ \`\`\`js
15
+ import { Help } from '@dhis2/ui'
16
+ \`\`\`
17
+ `;
18
+ var _default = exports.default = {
18
19
  title: 'Help',
19
20
  component: _help.Help,
20
21
  parameters: {
@@ -25,46 +26,40 @@ var _default = {
25
26
  }
26
27
  },
27
28
  argTypes: {
28
- valid: { ..._uiConstants.sharedPropTypes.statusArgType
29
+ valid: {
30
+ ..._uiConstants.sharedPropTypes.statusArgType
29
31
  },
30
- warning: { ..._uiConstants.sharedPropTypes.statusArgType
32
+ warning: {
33
+ ..._uiConstants.sharedPropTypes.statusArgType
31
34
  },
32
- error: { ..._uiConstants.sharedPropTypes.statusArgType
35
+ error: {
36
+ ..._uiConstants.sharedPropTypes.statusArgType
33
37
  }
34
38
  },
35
39
  args: {
36
40
  children: 'Allow me to be of assistance'
37
41
  }
38
42
  };
39
- exports.default = _default;
40
-
41
43
  const Template = args => /*#__PURE__*/_react.default.createElement(_help.Help, args);
42
-
43
- const Default = Template.bind({});
44
- exports.Default = Default;
45
- const StatusWarning = Template.bind({});
46
- exports.StatusWarning = StatusWarning;
44
+ const Default = exports.Default = Template.bind({});
45
+ const StatusWarning = exports.StatusWarning = Template.bind({});
47
46
  StatusWarning.args = {
48
47
  warning: true
49
48
  };
50
49
  StatusWarning.storyName = 'Status: Warning';
51
- const StatusValid = Template.bind({});
52
- exports.StatusValid = StatusValid;
50
+ const StatusValid = exports.StatusValid = Template.bind({});
53
51
  StatusValid.args = {
54
52
  valid: true
55
53
  };
56
54
  StatusValid.storyName = 'Status: Valid';
57
- const StatusError = Template.bind({});
58
- exports.StatusError = StatusError;
55
+ const StatusError = exports.StatusError = Template.bind({});
59
56
  StatusError.args = {
60
57
  error: true
61
58
  };
62
59
  StatusError.storyName = 'Status: Error';
63
-
64
60
  const TextOverflow = args => /*#__PURE__*/_react.default.createElement("div", {
65
61
  style: {
66
62
  width: 200
67
63
  }
68
64
  }, /*#__PURE__*/_react.default.createElement(_help.Help, args, "I take up more space than my container"));
69
-
70
65
  exports.TextOverflow = TextOverflow;
@@ -9,5 +9,4 @@ Object.defineProperty(exports, "Help", {
9
9
  return _help.Help;
10
10
  }
11
11
  });
12
-
13
12
  var _help = require("./help.js");
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { Help } from './help.js';
3
+ export default {
4
+ title: 'Help'
5
+ };
6
+ export const WithChildren = () => /*#__PURE__*/React.createElement(Help, null, "I am a child");
package/build/es/help.js CHANGED
@@ -3,7 +3,6 @@ import { spacers, theme, colors, sharedPropTypes } from '@dhis2/ui-constants';
3
3
  import cx from 'classnames';
4
4
  import PropTypes from 'prop-types';
5
5
  import React from 'react';
6
-
7
6
  const Help = _ref => {
8
7
  let {
9
8
  children,
@@ -23,9 +22,8 @@ const Help = _ref => {
23
22
  }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
24
23
  id: "1832050605",
25
24
  dynamic: [spacers.dp4, theme.default, colors.blue700, theme.error, colors.yellow800]
26
- }, ["p.__jsx-style-dynamic-selector{margin-top:".concat(spacers.dp4, ";margin-right:0;margin-bottom:0;margin-left:0;font-size:12px;line-height:14px;color:").concat(theme.default, ";}"), ".valid.__jsx-style-dynamic-selector{color:".concat(colors.blue700, ";}"), ".error.__jsx-style-dynamic-selector{color:".concat(theme.error, ";}"), ".warning.__jsx-style-dynamic-selector{color:".concat(colors.yellow800, ";}")]));
25
+ }, [`p.__jsx-style-dynamic-selector{margin-top:${spacers.dp4};margin-right:0;margin-bottom:0;margin-left:0;font-size:12px;line-height:14px;color:${theme.default};}`, `.valid.__jsx-style-dynamic-selector{color:${colors.blue700};}`, `.error.__jsx-style-dynamic-selector{color:${theme.error};}`, `.warning.__jsx-style-dynamic-selector{color:${colors.yellow800};}`]));
27
26
  };
28
-
29
27
  Help.defaultProps = {
30
28
  dataTest: 'dhis2-uicore-help'
31
29
  };
@@ -1,7 +1,13 @@
1
1
  import { sharedPropTypes } from '@dhis2/ui-constants';
2
2
  import React from 'react';
3
3
  import { Help } from './help.js';
4
- const description = "\nSmall text for giving guiding information or feedback, especially for data entry instructions or form validation feedback.\n\n```js\nimport { Help } from '@dhis2/ui'\n```\n";
4
+ const description = `
5
+ Small text for giving guiding information or feedback, especially for data entry instructions or form validation feedback.
6
+
7
+ \`\`\`js
8
+ import { Help } from '@dhis2/ui'
9
+ \`\`\`
10
+ `;
5
11
  export default {
6
12
  title: 'Help',
7
13
  component: Help,
@@ -13,20 +19,21 @@ export default {
13
19
  }
14
20
  },
15
21
  argTypes: {
16
- valid: { ...sharedPropTypes.statusArgType
22
+ valid: {
23
+ ...sharedPropTypes.statusArgType
17
24
  },
18
- warning: { ...sharedPropTypes.statusArgType
25
+ warning: {
26
+ ...sharedPropTypes.statusArgType
19
27
  },
20
- error: { ...sharedPropTypes.statusArgType
28
+ error: {
29
+ ...sharedPropTypes.statusArgType
21
30
  }
22
31
  },
23
32
  args: {
24
33
  children: 'Allow me to be of assistance'
25
34
  }
26
35
  };
27
-
28
36
  const Template = args => /*#__PURE__*/React.createElement(Help, args);
29
-
30
37
  export const Default = Template.bind({});
31
38
  export const StatusWarning = Template.bind({});
32
39
  StatusWarning.args = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/help",
3
- "version": "9.10.3",
3
+ "version": "9.11.1-beta.1",
4
4
  "description": "UI Help",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,18 +22,18 @@
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-constants": "9.10.3",
36
+ "@dhis2/ui-constants": "9.11.1-beta.1",
37
37
  "classnames": "^2.3.1",
38
38
  "prop-types": "^15.7.2"
39
39
  },
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- var _react = require("@storybook/react");
4
-
5
- var _react2 = _interopRequireDefault(require("react"));
6
-
7
- var _help = require("./help.js");
8
-
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
-
11
- (0, _react.storiesOf)('Help', module).add('With children', () => /*#__PURE__*/_react2.default.createElement(_help.Help, null, "I am a child"));
@@ -1,4 +0,0 @@
1
- import { storiesOf } from '@storybook/react';
2
- import React from 'react';
3
- import { Help } from './help.js';
4
- storiesOf('Help', module).add('With children', () => /*#__PURE__*/React.createElement(Help, null, "I am a child"));