@dhis2-ui/button 9.10.3 → 9.11.1-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. package/build/cjs/button/__tests__/Button.test.js +1 -8
  2. package/build/cjs/button/button.e2e.stories.js +34 -0
  3. package/build/cjs/button/button.js +8 -47
  4. package/build/cjs/button/{button.stories.js → button.prod.stories.js} +36 -59
  5. package/build/cjs/button/button.styles.js +2 -5
  6. package/build/cjs/button/features/can_be_blurred/index.js +1 -2
  7. package/build/cjs/button/features/can_be_clicked/index.js +1 -2
  8. package/build/cjs/button/features/can_be_focused/index.js +1 -2
  9. package/build/cjs/button/index.js +0 -1
  10. package/build/cjs/button-strip/button-strip.e2e.stories.js +15 -0
  11. package/build/cjs/button-strip/button-strip.js +4 -17
  12. package/build/cjs/button-strip/{button-strip.stories.js → button-strip.prod.stories.js} +13 -21
  13. package/build/cjs/button-strip/features/accepts_children/index.js +0 -1
  14. package/build/cjs/button-strip/index.js +0 -1
  15. package/build/cjs/dropdown-button/__tests__/dropdown-button.test.js +1 -23
  16. package/build/cjs/dropdown-button/dropdown-button.e2e.stories.js +60 -0
  17. package/build/cjs/dropdown-button/dropdown-button.js +11 -48
  18. package/build/cjs/dropdown-button/{dropdown-button.stories.js → dropdown-button.prod.stories.js} +36 -60
  19. package/build/cjs/dropdown-button/features/accepts_children/index.js +0 -1
  20. package/build/cjs/dropdown-button/features/accepts_component/index.js +0 -1
  21. package/build/cjs/dropdown-button/features/accepts_icon/index.js +0 -1
  22. package/build/cjs/dropdown-button/features/accepts_initial_focus/index.js +1 -2
  23. package/build/cjs/dropdown-button/features/button_is_clickable/index.js +1 -2
  24. package/build/cjs/dropdown-button/features/can_be_disabled/index.js +1 -2
  25. package/build/cjs/dropdown-button/features/common/index.js +0 -1
  26. package/build/cjs/dropdown-button/features/opens_a_dropdown/index.js +0 -1
  27. package/build/cjs/dropdown-button/index.js +0 -1
  28. package/build/cjs/index.js +0 -4
  29. package/build/cjs/locales/index.js +3 -9
  30. package/build/cjs/split-button/features/accepts_children/index.js +0 -1
  31. package/build/cjs/split-button/features/accepts_icon/index.js +0 -1
  32. package/build/cjs/split-button/features/accepts_initial_focus/index.js +1 -2
  33. package/build/cjs/split-button/features/arrow_opens_menu/index.js +0 -1
  34. package/build/cjs/split-button/features/button_is_clickable/index.js +1 -2
  35. package/build/cjs/split-button/features/can_be_disabled/index.js +0 -1
  36. package/build/cjs/split-button/features/common/index.js +0 -1
  37. package/build/cjs/split-button/index.js +0 -1
  38. package/build/cjs/split-button/split-button.e2e.stories.js +53 -0
  39. package/build/cjs/split-button/split-button.js +13 -48
  40. package/build/cjs/split-button/{split-button.stories.js → split-button.prod.stories.js} +30 -42
  41. package/build/cjs/split-button/split-button.test.js +5 -22
  42. package/build/es/button/{button.stories.e2e.js → button.e2e.stories.js} +9 -5
  43. package/build/es/button/button.js +5 -33
  44. package/build/es/button/{button.stories.js → button.prod.stories.js} +23 -16
  45. package/build/es/button/button.styles.js +1 -1
  46. package/build/es/button/features/can_be_blurred/index.js +1 -1
  47. package/build/es/button/features/can_be_clicked/index.js +1 -1
  48. package/build/es/button/features/can_be_focused/index.js +1 -1
  49. package/build/es/button-strip/button-strip.e2e.stories.js +7 -0
  50. package/build/es/button-strip/button-strip.js +1 -5
  51. package/build/es/button-strip/{button-strip.stories.js → button-strip.prod.stories.js} +10 -4
  52. package/build/es/dropdown-button/{dropdown-button.stories.e2e.js → dropdown-button.e2e.stories.js} +17 -9
  53. package/build/es/dropdown-button/dropdown-button.js +8 -35
  54. package/build/es/dropdown-button/{dropdown-button.stories.js → dropdown-button.prod.stories.js} +21 -20
  55. package/build/es/dropdown-button/features/accepts_initial_focus/index.js +1 -1
  56. package/build/es/dropdown-button/features/button_is_clickable/index.js +1 -1
  57. package/build/es/dropdown-button/features/can_be_disabled/index.js +1 -1
  58. package/build/es/split-button/features/accepts_initial_focus/index.js +1 -1
  59. package/build/es/split-button/features/button_is_clickable/index.js +1 -1
  60. package/build/es/split-button/{split-button.stories.e2e.js → split-button.e2e.stories.js} +15 -8
  61. package/build/es/split-button/split-button.js +10 -32
  62. package/build/es/split-button/{split-button.stories.js → split-button.prod.stories.js} +19 -13
  63. package/build/es/split-button/split-button.test.js +4 -2
  64. package/package.json +9 -9
  65. package/build/cjs/button/button.stories.e2e.js +0 -27
  66. package/build/cjs/button-strip/button-strip.stories.e2e.js +0 -13
  67. package/build/cjs/dropdown-button/dropdown-button.stories.e2e.js +0 -45
  68. package/build/cjs/split-button/split-button.stories.e2e.js +0 -40
  69. package/build/es/button-strip/button-strip.stories.e2e.js +0 -5
@@ -42,8 +42,9 @@ describe('SplitButton', () => {
42
42
  expect(getByTestId('dhis2-uicore-splitbutton-menu')).toBeInTheDocument();
43
43
  fireEvent.keyDown(document, {
44
44
  key: 'Enter'
45
- }); // Use waitFor to wait for the DOM to update
45
+ });
46
46
 
47
+ // Use waitFor to wait for the DOM to update
47
48
  await waitFor(() => {
48
49
  expect(getByTestId('dhis2-uicore-splitbutton-menu')).toBeInTheDocument();
49
50
  });
@@ -60,8 +61,9 @@ describe('SplitButton', () => {
60
61
  expect(getByTestId('dhis2-uicore-splitbutton-menu')).toBeInTheDocument();
61
62
  fireEvent.keyDown(document, {
62
63
  key: 'Escape'
63
- }); // Use waitFor to wait for the DOM to update
64
+ });
64
65
 
66
+ // Use waitFor to wait for the DOM to update
65
67
  await waitFor(() => {
66
68
  expect(queryByTestId('dhis2-uicore-splitbutton-menu')).not.toBeInTheDocument();
67
69
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/button",
3
- "version": "9.10.3",
3
+ "version": "9.11.1-beta.1",
4
4
  "description": "UI Button",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,22 +22,22 @@
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/layer": "9.10.3",
37
- "@dhis2-ui/loader": "9.10.3",
38
- "@dhis2-ui/popper": "9.10.3",
39
- "@dhis2/ui-constants": "9.10.3",
40
- "@dhis2/ui-icons": "9.10.3",
36
+ "@dhis2-ui/layer": "9.11.1-beta.1",
37
+ "@dhis2-ui/loader": "9.11.1-beta.1",
38
+ "@dhis2-ui/popper": "9.11.1-beta.1",
39
+ "@dhis2/ui-constants": "9.11.1-beta.1",
40
+ "@dhis2/ui-icons": "9.11.1-beta.1",
41
41
  "classnames": "^2.3.1",
42
42
  "prop-types": "^15.7.2"
43
43
  },
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- var _react = require("@storybook/react");
4
-
5
- var _react2 = _interopRequireDefault(require("react"));
6
-
7
- var _button = require("./button.js");
8
-
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
-
11
- window.onClick = window.Cypress && window.Cypress.cy.stub();
12
- window.onBlur = window.Cypress && window.Cypress.cy.stub();
13
- window.onFocus = window.Cypress && window.Cypress.cy.stub();
14
- (0, _react.storiesOf)('Button', module).add('With onClick', () => /*#__PURE__*/_react2.default.createElement(_button.Button, {
15
- name: "Button",
16
- value: "default",
17
- onClick: window.onClick
18
- }, "Label me!")).add('With initialFocus and onBlur', () => /*#__PURE__*/_react2.default.createElement(_button.Button, {
19
- name: "Button",
20
- value: "default",
21
- initialFocus: true,
22
- onBlur: window.onBlur
23
- }, "Label me!")).add('With onFocus', () => /*#__PURE__*/_react2.default.createElement(_button.Button, {
24
- name: "Button",
25
- value: "default",
26
- onFocus: window.onFocus
27
- }, "Label me!"));
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- var _react = require("@storybook/react");
4
-
5
- var _react2 = _interopRequireDefault(require("react"));
6
-
7
- var _index = require("../index.js");
8
-
9
- var _index2 = require("./index.js");
10
-
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
13
- (0, _react.storiesOf)('ButtonStrip', module).add('With children', () => /*#__PURE__*/_react2.default.createElement(_index2.ButtonStrip, null, /*#__PURE__*/_react2.default.createElement(_index.Button, null, "I am a child"), /*#__PURE__*/_react2.default.createElement(_index.Button, null, "I am a child"), /*#__PURE__*/_react2.default.createElement(_index.Button, null, "I am a child")));
@@ -1,45 +0,0 @@
1
- "use strict";
2
-
3
- var _react = require("@storybook/react");
4
-
5
- var _react2 = _interopRequireDefault(require("react"));
6
-
7
- var _index = require("./index.js");
8
-
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
-
11
- window.onClick = window.Cypress && window.Cypress.cy.stub();
12
- (0, _react.storiesOf)('DropdownButton', module).add('Default', () => /*#__PURE__*/_react2.default.createElement(_index.DropdownButton, {
13
- name: "Button",
14
- value: "default",
15
- component: /*#__PURE__*/_react2.default.createElement("div", null, "Content")
16
- }, "Button")).add('With onClick', () => /*#__PURE__*/_react2.default.createElement(_index.DropdownButton, {
17
- name: "Button",
18
- value: "default",
19
- onClick: window.onClick,
20
- component: /*#__PURE__*/_react2.default.createElement("div", null, "Content")
21
- }, "Button")).add('With children', () => /*#__PURE__*/_react2.default.createElement(_index.DropdownButton, {
22
- name: "Button",
23
- value: "default",
24
- component: /*#__PURE__*/_react2.default.createElement("div", null, "Component")
25
- }, "I am a child")).add('With component', () => /*#__PURE__*/_react2.default.createElement(_index.DropdownButton, {
26
- name: "Button",
27
- value: "default",
28
- component: /*#__PURE__*/_react2.default.createElement("div", null, "I am a component")
29
- })).add('With icon', () => /*#__PURE__*/_react2.default.createElement(_index.DropdownButton, {
30
- name: "Button",
31
- value: "default",
32
- component: /*#__PURE__*/_react2.default.createElement("div", null, "I am a component"),
33
- icon: 'Icon'
34
- })).add('With initialFocus', () => /*#__PURE__*/_react2.default.createElement(_index.DropdownButton, {
35
- name: "Button",
36
- value: "default",
37
- component: /*#__PURE__*/_react2.default.createElement("div", null, "Content"),
38
- initialFocus: true
39
- })).add('Disabled with onClick', () => /*#__PURE__*/_react2.default.createElement(_index.DropdownButton, {
40
- name: "Button",
41
- value: "default",
42
- component: /*#__PURE__*/_react2.default.createElement("div", null, "Content"),
43
- onClick: window.onClick,
44
- disabled: true
45
- }));
@@ -1,40 +0,0 @@
1
- "use strict";
2
-
3
- var _react = require("@storybook/react");
4
-
5
- var _react2 = _interopRequireDefault(require("react"));
6
-
7
- var _splitButton = require("./split-button.js");
8
-
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
-
11
- window.onClick = window.Cypress && window.Cypress.cy.stub();
12
- (0, _react.storiesOf)('SplitButton', module).add('Default', () => /*#__PURE__*/_react2.default.createElement(_splitButton.SplitButton, {
13
- name: "Button",
14
- value: "default",
15
- component: /*#__PURE__*/_react2.default.createElement("div", null, "Component")
16
- }, "Label me!")).add('With onClick', () => /*#__PURE__*/_react2.default.createElement(_splitButton.SplitButton, {
17
- name: "Button",
18
- value: "default",
19
- component: /*#__PURE__*/_react2.default.createElement("div", null, "Component"),
20
- onClick: window.onClick
21
- }, "Label me!")).add('With children', () => /*#__PURE__*/_react2.default.createElement(_splitButton.SplitButton, {
22
- name: "Button",
23
- value: "default",
24
- component: /*#__PURE__*/_react2.default.createElement("div", null, "Component")
25
- }, "I am a child")).add('With icon', () => /*#__PURE__*/_react2.default.createElement(_splitButton.SplitButton, {
26
- name: "Button",
27
- value: "default",
28
- component: /*#__PURE__*/_react2.default.createElement("div", null, "Component"),
29
- icon: /*#__PURE__*/_react2.default.createElement("div", null, "Icon")
30
- }, "Children")).add('With initialFocus', () => /*#__PURE__*/_react2.default.createElement(_splitButton.SplitButton, {
31
- name: "Button",
32
- value: "default",
33
- component: /*#__PURE__*/_react2.default.createElement("div", null, "Component"),
34
- initialFocus: true
35
- }, "Children")).add('With disabled', () => /*#__PURE__*/_react2.default.createElement(_splitButton.SplitButton, {
36
- name: "Button",
37
- value: "default",
38
- component: /*#__PURE__*/_react2.default.createElement("div", null, "Component"),
39
- disabled: true
40
- }, "Children"));
@@ -1,5 +0,0 @@
1
- import { storiesOf } from '@storybook/react';
2
- import React from 'react';
3
- import { Button } from '../index.js';
4
- import { ButtonStrip } from './index.js';
5
- storiesOf('ButtonStrip', module).add('With children', () => /*#__PURE__*/React.createElement(ButtonStrip, null, /*#__PURE__*/React.createElement(Button, null, "I am a child"), /*#__PURE__*/React.createElement(Button, null, "I am a child"), /*#__PURE__*/React.createElement(Button, null, "I am a child")));