@atlaskit/button 16.15.0 → 16.16.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/button
2
2
 
3
+ ## 16.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#42973](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42973) [`0fe0a5121a7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0fe0a5121a7) - Add missing `testId` prop to `<ButtonGroup>` to enable testing
8
+
3
9
  ## 16.15.0
4
10
 
5
11
  ### Minor Changes
@@ -21,9 +21,11 @@ var buttonGroupStyles = (0, _react2.css)({
21
21
  });
22
22
  function ButtonGroup(_ref) {
23
23
  var appearance = _ref.appearance,
24
- children = _ref.children;
24
+ children = _ref.children,
25
+ testId = _ref.testId;
25
26
  return (0, _react2.jsx)("div", {
26
- css: buttonGroupStyles
27
+ css: buttonGroupStyles,
28
+ "data-testid": testId
27
29
  }, _react.default.Children.map(_react.default.Children.toArray(children), function (child, idx) {
28
30
  if (!child) {
29
31
  return null;
@@ -115,7 +115,7 @@ var useButtonBase = function useButtonBase(_ref) {
115
115
  action: 'clicked',
116
116
  componentName: 'button',
117
117
  packageName: "@atlaskit/button",
118
- packageVersion: "16.15.0",
118
+ packageVersion: "16.16.0",
119
119
  analyticsData: analyticsContext,
120
120
  actionSubject: buttonType
121
121
  });
@@ -118,7 +118,7 @@ var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(function
118
118
  action: 'clicked',
119
119
  componentName: 'button',
120
120
  packageName: "@atlaskit/button",
121
- packageVersion: "16.15.0",
121
+ packageVersion: "16.16.0",
122
122
  analyticsData: analyticsContext
123
123
  });
124
124
 
@@ -11,10 +11,12 @@ const buttonGroupStyles = css({
11
11
  });
12
12
  export default function ButtonGroup({
13
13
  appearance,
14
- children
14
+ children,
15
+ testId
15
16
  }) {
16
17
  return jsx("div", {
17
- css: buttonGroupStyles
18
+ css: buttonGroupStyles,
19
+ "data-testid": testId
18
20
  }, React.Children.map(React.Children.toArray(children), (child, idx) => {
19
21
  if (!child) {
20
22
  return null;
@@ -97,7 +97,7 @@ const useButtonBase = ({
97
97
  action: 'clicked',
98
98
  componentName: 'button',
99
99
  packageName: "@atlaskit/button",
100
- packageVersion: "16.15.0",
100
+ packageVersion: "16.16.0",
101
101
  analyticsData: analyticsContext,
102
102
  actionSubject: buttonType
103
103
  });
@@ -103,7 +103,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
103
103
  action: 'clicked',
104
104
  componentName: 'button',
105
105
  packageName: "@atlaskit/button",
106
- packageVersion: "16.15.0",
106
+ packageVersion: "16.16.0",
107
107
  analyticsData: analyticsContext
108
108
  });
109
109
 
@@ -11,9 +11,11 @@ var buttonGroupStyles = css({
11
11
  });
12
12
  export default function ButtonGroup(_ref) {
13
13
  var appearance = _ref.appearance,
14
- children = _ref.children;
14
+ children = _ref.children,
15
+ testId = _ref.testId;
15
16
  return jsx("div", {
16
- css: buttonGroupStyles
17
+ css: buttonGroupStyles,
18
+ "data-testid": testId
17
19
  }, React.Children.map(React.Children.toArray(children), function (child, idx) {
18
20
  if (!child) {
19
21
  return null;
@@ -107,7 +107,7 @@ var useButtonBase = function useButtonBase(_ref) {
107
107
  action: 'clicked',
108
108
  componentName: 'button',
109
109
  packageName: "@atlaskit/button",
110
- packageVersion: "16.15.0",
110
+ packageVersion: "16.16.0",
111
111
  analyticsData: analyticsContext,
112
112
  actionSubject: buttonType
113
113
  });
@@ -109,7 +109,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
109
109
  action: 'clicked',
110
110
  componentName: 'button',
111
111
  packageName: "@atlaskit/button",
112
- packageVersion: "16.15.0",
112
+ packageVersion: "16.16.0",
113
113
  analyticsData: analyticsContext
114
114
  });
115
115
 
@@ -4,9 +4,16 @@ import { jsx } from '@emotion/react';
4
4
  import { Appearance } from '../old-button/types';
5
5
  export type ButtonGroupProps = {
6
6
  /**
7
- * The appearance to apply to all buttons.
7
+ * The appearance to apply to all buttons
8
8
  */
9
9
  appearance?: Appearance;
10
+ /**
11
+ * The buttons to render inside the Button Group
12
+ */
10
13
  children?: React.ReactNode;
14
+ /**
15
+ * A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
16
+ */
17
+ testId?: string;
11
18
  };
12
- export default function ButtonGroup({ appearance, children, }: ButtonGroupProps): jsx.JSX.Element;
19
+ export default function ButtonGroup({ appearance, children, testId, }: ButtonGroupProps): jsx.JSX.Element;
@@ -45,7 +45,7 @@ export type CommonButtonProps<TagName extends HTMLElement> = {
45
45
  */
46
46
  children: React.ReactNode;
47
47
  /**
48
- * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
48
+ * A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
49
49
  */
50
50
  testId?: string;
51
51
  /**
@@ -4,9 +4,16 @@ import { jsx } from '@emotion/react';
4
4
  import { Appearance } from '../old-button/types';
5
5
  export type ButtonGroupProps = {
6
6
  /**
7
- * The appearance to apply to all buttons.
7
+ * The appearance to apply to all buttons
8
8
  */
9
9
  appearance?: Appearance;
10
+ /**
11
+ * The buttons to render inside the Button Group
12
+ */
10
13
  children?: React.ReactNode;
14
+ /**
15
+ * A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
16
+ */
17
+ testId?: string;
11
18
  };
12
- export default function ButtonGroup({ appearance, children, }: ButtonGroupProps): jsx.JSX.Element;
19
+ export default function ButtonGroup({ appearance, children, testId, }: ButtonGroupProps): jsx.JSX.Element;
@@ -45,7 +45,7 @@ export type CommonButtonProps<TagName extends HTMLElement> = {
45
45
  */
46
46
  children: React.ReactNode;
47
47
  /**
48
- * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
48
+ * A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
49
49
  */
50
50
  testId?: string;
51
51
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/button",
3
- "version": "16.15.0",
3
+ "version": "16.16.0",
4
4
  "description": "A button triggers an event or action. They let users know what will happen next.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"