@atlaskit/button 17.0.0 → 17.1.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 +43 -19
- package/dist/cjs/containers/button-group.js +7 -2
- package/dist/cjs/new-button/variants/shared/use-button-base.js +1 -1
- package/dist/cjs/old-button/shared/button-base.js +1 -1
- package/dist/es2019/containers/button-group.js +7 -2
- package/dist/es2019/new-button/variants/shared/use-button-base.js +1 -1
- package/dist/es2019/old-button/shared/button-base.js +1 -1
- package/dist/esm/containers/button-group.js +7 -2
- package/dist/esm/new-button/variants/shared/use-button-base.js +1 -1
- package/dist/esm/old-button/shared/button-base.js +1 -1
- package/dist/types/containers/button-group.d.ts +11 -1
- package/dist/types-ts4.5/containers/button-group.d.ts +11 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,38 +1,62 @@
|
|
|
1
1
|
# @atlaskit/button
|
|
2
2
|
|
|
3
|
+
## 17.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#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.
|
|
8
|
+
|
|
3
9
|
## 17.0.0
|
|
4
10
|
|
|
5
11
|
### Major Changes
|
|
6
12
|
|
|
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
|
|
13
|
+
- [#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
14
|
|
|
9
|
-
|
|
15
|
+
#### Breaking changes
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
Removed all `UNSAFE_` exports and `/unsafe` entrypoint.
|
|
12
18
|
|
|
13
|
-
|
|
19
|
+
```js
|
|
20
|
+
import { UNSAFE_BUTTON } from '@atlaskit/button' ❌
|
|
21
|
+
import Button from '@atlaskit/button/new' ✅
|
|
14
22
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
```
|
|
23
|
+
import { UNSAFE_BUTTON } from '@atlaskit/button/unsafe' ❌
|
|
24
|
+
import Button from '@atlaskit/button/new' ✅
|
|
25
|
+
```
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
See new features for new exports and entrypoint ⤵
|
|
21
28
|
|
|
22
|
-
|
|
29
|
+
#### New features
|
|
23
30
|
|
|
24
|
-
|
|
25
|
-
import { IconButton } from '@atlaskit/button/new';
|
|
26
|
-
import { LinkIconButton } from '@atlaskit/button/new';
|
|
27
|
-
```
|
|
31
|
+
New Button goes open beta!
|
|
28
32
|
|
|
29
|
-
|
|
33
|
+
Check out the exports under `@atlaskit/button/new` and the [docs](/components/button/button-new/examples) for our new approach.
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
##### Button
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
[Read the docs here.](/components/button/button-new/examples)
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
import Button from '@atlaskit/button/new';
|
|
41
|
+
import { LinkButton } from '@atlaskit/button/new';
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
##### Icon button
|
|
45
|
+
|
|
46
|
+
[Read the docs here.](/components/button/icon-button/examples)
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
import { IconButton } from '@atlaskit/button/new';
|
|
50
|
+
import { LinkIconButton } from '@atlaskit/button/new';
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
##### Split button
|
|
54
|
+
|
|
55
|
+
[Read the docs here.](/components/button/split-button/examples)
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
import { SplitButton } from '@atlaskit/button/new';
|
|
59
|
+
```
|
|
36
60
|
|
|
37
61
|
## 16.18.1
|
|
38
62
|
|
|
@@ -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.
|
|
120
|
+
packageVersion: "17.1.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.
|
|
121
|
+
packageVersion: "17.1.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;
|
|
@@ -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.
|
|
106
|
+
packageVersion: "17.1.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.
|
|
112
|
+
packageVersion: "17.1.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.
|
|
112
|
+
packageVersion: "17.1.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;
|
|
@@ -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;
|
package/package.json
CHANGED