@atlaskit/button 17.0.0 → 17.2.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,38 +1,68 @@
1
1
  # @atlaskit/button
2
2
 
3
+ ## 17.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#64419](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64419) [`6e9ab538f37b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6e9ab538f37b) - Export ButtonGroupProps type
8
+
9
+ ## 17.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#60205](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/60205) [`d8f830e29011`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d8f830e29011) - [ux] Assistive technologies now define ButtonGroup as a group. Additionally `label` and `titleId` props introduced to label the current group.
14
+
3
15
  ## 17.0.0
4
16
 
5
17
  ### Major Changes
6
18
 
7
- - [#60024](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/60024) [`c6418d429d47`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c6418d429d47) - New Button goes Open Beta!
19
+ - [#60024](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/60024) [`c6418d429d47`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c6418d429d47) - New Button goes open beta!
8
20
 
9
- Check out the exports under `@atlaskit/button/new` and the [docs](/components/button/button-new/examples) for our new approach.
21
+ #### Breaking changes
10
22
 
11
- ## Button
23
+ Removed all `UNSAFE_` exports and `/unsafe` entrypoint.
12
24
 
13
- [Read the docs here.](/components/button/button-new/examples)
25
+ ```js
26
+ import { UNSAFE_BUTTON } from '@atlaskit/button' ❌
27
+ import Button from '@atlaskit/button/new' ✅
14
28
 
15
- ```js
16
- import Button from '@atlaskit/button/new';
17
- import { LinkButton } from '@atlaskit/button/new';
18
- ```
29
+ import { UNSAFE_BUTTON } from '@atlaskit/button/unsafe' ❌
30
+ import Button from '@atlaskit/button/new'
31
+ ```
19
32
 
20
- ## Icon button
33
+ See new features for new exports and entrypoint ⤵
21
34
 
22
- [Read the docs here.](/components/button/icon-button/examples)
35
+ #### New features
23
36
 
24
- ```js
25
- import { IconButton } from '@atlaskit/button/new';
26
- import { LinkIconButton } from '@atlaskit/button/new';
27
- ```
37
+ New Button goes open beta!
28
38
 
29
- ## Split button
39
+ Check out the exports under `@atlaskit/button/new` and the [docs](/components/button/button-new/examples) for our new approach.
30
40
 
31
- [Read the docs here.](/components/button/split-button/examples)
41
+ ##### Button
32
42
 
33
- ```js
34
- import { SplitButton } from '@atlaskit/button/new';
35
- ```
43
+ [Read the docs here.](/components/button/button-new/examples)
44
+
45
+ ```js
46
+ import Button from '@atlaskit/button/new';
47
+ import { LinkButton } from '@atlaskit/button/new';
48
+ ```
49
+
50
+ ##### Icon button
51
+
52
+ [Read the docs here.](/components/button/icon-button/examples)
53
+
54
+ ```js
55
+ import { IconButton } from '@atlaskit/button/new';
56
+ import { LinkIconButton } from '@atlaskit/button/new';
57
+ ```
58
+
59
+ ##### Split button
60
+
61
+ [Read the docs here.](/components/button/split-button/examples)
62
+
63
+ ```js
64
+ import { SplitButton } from '@atlaskit/button/new';
65
+ ```
36
66
 
37
67
  ## 16.18.1
38
68
 
@@ -22,10 +22,15 @@ var buttonGroupStyles = (0, _react2.css)({
22
22
  function ButtonGroup(_ref) {
23
23
  var appearance = _ref.appearance,
24
24
  children = _ref.children,
25
- testId = _ref.testId;
25
+ testId = _ref.testId,
26
+ label = _ref.label,
27
+ titleId = _ref.titleId;
26
28
  return (0, _react2.jsx)("div", {
27
29
  css: buttonGroupStyles,
28
- "data-testid": testId
30
+ "data-testid": testId,
31
+ role: "group",
32
+ "aria-label": label,
33
+ "aria-labelledby": titleId
29
34
  }, _react.default.Children.map(_react.default.Children.toArray(children), function (child, idx) {
30
35
  if (!child) {
31
36
  return null;
@@ -117,7 +117,7 @@ var useButtonBase = function useButtonBase(_ref) {
117
117
  action: 'clicked',
118
118
  componentName: 'button',
119
119
  packageName: "@atlaskit/button",
120
- packageVersion: "17.0.0",
120
+ packageVersion: "17.2.0",
121
121
  analyticsData: analyticsContext,
122
122
  actionSubject: buttonType
123
123
  });
@@ -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: "17.0.0",
121
+ packageVersion: "17.2.0",
122
122
  analyticsData: analyticsContext
123
123
  });
124
124
 
@@ -12,11 +12,16 @@ const buttonGroupStyles = css({
12
12
  export default function ButtonGroup({
13
13
  appearance,
14
14
  children,
15
- testId
15
+ testId,
16
+ label,
17
+ titleId
16
18
  }) {
17
19
  return jsx("div", {
18
20
  css: buttonGroupStyles,
19
- "data-testid": testId
21
+ "data-testid": testId,
22
+ role: "group",
23
+ "aria-label": label,
24
+ "aria-labelledby": titleId
20
25
  }, React.Children.map(React.Children.toArray(children), (child, idx) => {
21
26
  if (!child) {
22
27
  return null;
@@ -98,7 +98,7 @@ const useButtonBase = ({
98
98
  action: 'clicked',
99
99
  componentName: 'button',
100
100
  packageName: "@atlaskit/button",
101
- packageVersion: "17.0.0",
101
+ packageVersion: "17.2.0",
102
102
  analyticsData: analyticsContext,
103
103
  actionSubject: buttonType
104
104
  });
@@ -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: "17.0.0",
106
+ packageVersion: "17.2.0",
107
107
  analyticsData: analyticsContext
108
108
  });
109
109
 
@@ -12,10 +12,15 @@ var buttonGroupStyles = css({
12
12
  export default function ButtonGroup(_ref) {
13
13
  var appearance = _ref.appearance,
14
14
  children = _ref.children,
15
- testId = _ref.testId;
15
+ testId = _ref.testId,
16
+ label = _ref.label,
17
+ titleId = _ref.titleId;
16
18
  return jsx("div", {
17
19
  css: buttonGroupStyles,
18
- "data-testid": testId
20
+ "data-testid": testId,
21
+ role: "group",
22
+ "aria-label": label,
23
+ "aria-labelledby": titleId
19
24
  }, React.Children.map(React.Children.toArray(children), function (child, idx) {
20
25
  if (!child) {
21
26
  return null;
@@ -109,7 +109,7 @@ var useButtonBase = function useButtonBase(_ref) {
109
109
  action: 'clicked',
110
110
  componentName: 'button',
111
111
  packageName: "@atlaskit/button",
112
- packageVersion: "17.0.0",
112
+ packageVersion: "17.2.0",
113
113
  analyticsData: analyticsContext,
114
114
  actionSubject: buttonType
115
115
  });
@@ -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: "17.0.0",
112
+ packageVersion: "17.2.0",
113
113
  analyticsData: analyticsContext
114
114
  });
115
115
 
@@ -15,5 +15,15 @@ export type ButtonGroupProps = {
15
15
  * A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
16
16
  */
17
17
  testId?: string;
18
+ /**
19
+ * Refers to an aria-label attribute. Sets an accessible name for ButtonGroup wrapper to announce it to users of assistive technology.
20
+ * Usage of either this, or the `titleId` attribute is strongly recommended.
21
+ */
22
+ label?: string;
23
+ /**
24
+ * Id referenced by the ButtonGroup wrapper's aria-labelledby attribute. This id should be assigned to the group-button title element.
25
+ * Usage of either this, or the `label` attribute is strongly recommended.
26
+ */
27
+ titleId?: string;
18
28
  };
19
- export default function ButtonGroup({ appearance, children, testId, }: ButtonGroupProps): jsx.JSX.Element;
29
+ export default function ButtonGroup({ appearance, children, testId, label, titleId, }: ButtonGroupProps): jsx.JSX.Element;
@@ -1 +1,2 @@
1
1
  export { default } from '../containers/button-group';
2
+ export type { ButtonGroupProps } from '../containers/button-group';
@@ -6,3 +6,4 @@ export type { LoadingButtonProps, LoadingButtonOwnProps, } from './entry-points/
6
6
  export { default as CustomThemeButton, Theme, } from './entry-points/custom-theme-button';
7
7
  export type { ThemeTokens, ThemeProps, InteractionState, CustomThemeButtonProps, CustomThemeButtonOwnProps, } from './entry-points/custom-theme-button';
8
8
  export { default as ButtonGroup } from './entry-points/button-group';
9
+ export type { ButtonGroupProps } from './entry-points/button-group';
@@ -15,5 +15,15 @@ export type ButtonGroupProps = {
15
15
  * A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
16
16
  */
17
17
  testId?: string;
18
+ /**
19
+ * Refers to an aria-label attribute. Sets an accessible name for ButtonGroup wrapper to announce it to users of assistive technology.
20
+ * Usage of either this, or the `titleId` attribute is strongly recommended.
21
+ */
22
+ label?: string;
23
+ /**
24
+ * Id referenced by the ButtonGroup wrapper's aria-labelledby attribute. This id should be assigned to the group-button title element.
25
+ * Usage of either this, or the `label` attribute is strongly recommended.
26
+ */
27
+ titleId?: string;
18
28
  };
19
- export default function ButtonGroup({ appearance, children, testId, }: ButtonGroupProps): jsx.JSX.Element;
29
+ export default function ButtonGroup({ appearance, children, testId, label, titleId, }: ButtonGroupProps): jsx.JSX.Element;
@@ -1 +1,2 @@
1
1
  export { default } from '../containers/button-group';
2
+ export type { ButtonGroupProps } from '../containers/button-group';
@@ -6,3 +6,4 @@ export type { LoadingButtonProps, LoadingButtonOwnProps, } from './entry-points/
6
6
  export { default as CustomThemeButton, Theme, } from './entry-points/custom-theme-button';
7
7
  export type { ThemeTokens, ThemeProps, InteractionState, CustomThemeButtonProps, CustomThemeButtonOwnProps, } from './entry-points/custom-theme-button';
8
8
  export { default as ButtonGroup } from './entry-points/button-group';
9
+ export type { ButtonGroupProps } from './entry-points/button-group';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/button",
3
- "version": "17.0.0",
3
+ "version": "17.2.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/"
@@ -85,10 +85,10 @@
85
85
  "@atlaskit/icon": "^22.0.0",
86
86
  "@atlaskit/interaction-context": "^2.1.0",
87
87
  "@atlaskit/platform-feature-flags": "^0.2.0",
88
- "@atlaskit/primitives": "^1.15.0",
88
+ "@atlaskit/primitives": "^1.16.0",
89
89
  "@atlaskit/spinner": "^16.0.0",
90
90
  "@atlaskit/theme": "^12.6.0",
91
- "@atlaskit/tokens": "^1.30.0",
91
+ "@atlaskit/tokens": "^1.33.0",
92
92
  "@atlaskit/visually-hidden": "^1.2.4",
93
93
  "@babel/runtime": "^7.0.0",
94
94
  "@emotion/react": "^11.7.1"
@@ -103,7 +103,6 @@
103
103
  "@atlaskit/app-provider": "^0.4.0",
104
104
  "@atlaskit/ssr": "*",
105
105
  "@atlaskit/visual-regression": "*",
106
- "@atlaskit/webdriver-runner": "*",
107
106
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
108
107
  "@testing-library/react": "^12.1.5",
109
108
  "@testing-library/user-event": "^14.4.3",