@atlaskit/button 16.17.7 → 16.17.8
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 +6 -0
- package/dist/cjs/new-button/containers/split-button/split-button.js +6 -1
- package/dist/cjs/new-button/variants/shared/use-button-base.js +1 -1
- package/dist/cjs/old-button/custom-theme-button/custom-theme-button.js +4 -2
- package/dist/cjs/old-button/loading-button.js +4 -2
- package/dist/cjs/old-button/shared/button-base.js +1 -1
- package/dist/cjs/old-button/shared/loading-spinner.js +1 -0
- package/dist/es2019/new-button/containers/split-button/split-button.js +6 -1
- package/dist/es2019/new-button/variants/shared/use-button-base.js +1 -1
- package/dist/es2019/old-button/custom-theme-button/custom-theme-button.js +4 -2
- package/dist/es2019/old-button/loading-button.js +4 -2
- package/dist/es2019/old-button/shared/button-base.js +1 -1
- package/dist/es2019/old-button/shared/loading-spinner.js +1 -0
- package/dist/esm/new-button/containers/split-button/split-button.js +6 -1
- package/dist/esm/new-button/variants/shared/use-button-base.js +1 -1
- package/dist/esm/old-button/custom-theme-button/custom-theme-button.js +4 -2
- package/dist/esm/old-button/loading-button.js +4 -2
- package/dist/esm/old-button/shared/button-base.js +1 -1
- package/dist/esm/old-button/shared/loading-spinner.js +1 -0
- package/dist/types/new-button/containers/split-button/split-button.d.ts +6 -13
- package/dist/types/new-button/containers/split-button/types.d.ts +23 -3
- package/dist/types-ts4.5/new-button/containers/split-button/split-button.d.ts +6 -13
- package/dist/types-ts4.5/new-button/containers/split-button/types.d.ts +23 -3
- package/extract-react-types/new-button/containers/split-button/split-button-props.tsx +5 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/button
|
|
2
2
|
|
|
3
|
+
## 16.17.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#56967](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/56967) [`d491c321ae12`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d491c321ae12) - Remove use of aria-busy
|
|
8
|
+
|
|
3
9
|
## 16.17.7
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -78,12 +78,17 @@ var SplitButtonContainer = exports.SplitButtonContainer = function SplitButtonCo
|
|
|
78
78
|
css: splitButtonStyles
|
|
79
79
|
}, children);
|
|
80
80
|
};
|
|
81
|
+
|
|
81
82
|
/**
|
|
82
83
|
* __Split Button__
|
|
83
84
|
*
|
|
84
85
|
* @private __UNSAFE__ SplitButton is not yet safe for production use.
|
|
85
86
|
*
|
|
86
|
-
*
|
|
87
|
+
* A split button lets people perform an action or choose from a small group of similar actions.
|
|
88
|
+
*
|
|
89
|
+
* - [Examples](https://atlassian.design/components/button/split-button/examples)
|
|
90
|
+
* - [Code](https://atlassian.design/components/button/split-button/code)
|
|
91
|
+
* - [Usage](https://atlassian.design/components/button/split-button/usage)
|
|
87
92
|
*/
|
|
88
93
|
var SplitButton = exports.SplitButton = function SplitButton(_ref3) {
|
|
89
94
|
var children = _ref3.children,
|
|
@@ -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.17.
|
|
118
|
+
packageVersion: "16.17.8",
|
|
119
119
|
analyticsData: analyticsContext,
|
|
120
120
|
actionSubject: buttonType
|
|
121
121
|
});
|
|
@@ -184,8 +184,10 @@ var CustomThemeButton = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.de
|
|
|
184
184
|
var buttonStyles = _ref4.buttonStyles;
|
|
185
185
|
return /*#__PURE__*/_react.default.createElement(_buttonBase.default, (0, _extends2.default)({}, restProps, {
|
|
186
186
|
ref: ref,
|
|
187
|
-
overlay: isLoading ? /*#__PURE__*/_react.default.createElement(_loadingSpinner.default, restProps) : null
|
|
188
|
-
|
|
187
|
+
overlay: isLoading ? /*#__PURE__*/_react.default.createElement(_loadingSpinner.default, restProps) : null
|
|
188
|
+
// No need to render aria-disabled when it is false
|
|
189
|
+
,
|
|
190
|
+
"aria-disabled": isLoading || undefined,
|
|
189
191
|
onMouseEnter: onMouseEnter,
|
|
190
192
|
onMouseLeave: onMouseLeave,
|
|
191
193
|
onMouseDown: onMouseDown,
|
|
@@ -29,8 +29,10 @@ var LoadingButton = /*#__PURE__*/_react.default.forwardRef(function LoadingButto
|
|
|
29
29
|
// Button already has React.memo, so just leaning on that
|
|
30
30
|
return /*#__PURE__*/_react.default.createElement(_button.default, (0, _extends2.default)({}, rest, {
|
|
31
31
|
ref: ref,
|
|
32
|
-
appearance: appearance
|
|
33
|
-
|
|
32
|
+
appearance: appearance
|
|
33
|
+
// No need to render aria-disabled when it is false
|
|
34
|
+
,
|
|
35
|
+
"aria-disabled": isLoading || undefined,
|
|
34
36
|
isDisabled: isDisabled,
|
|
35
37
|
isSelected: isSelected,
|
|
36
38
|
overlay: isLoading ? /*#__PURE__*/_react.default.createElement(_loadingSpinner.default, {
|
|
@@ -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.17.
|
|
121
|
+
packageVersion: "16.17.8",
|
|
122
122
|
analyticsData: analyticsContext
|
|
123
123
|
});
|
|
124
124
|
|
|
@@ -31,6 +31,7 @@ function LoadingSpinner(_ref2) {
|
|
|
31
31
|
var size = spacing === 'default' ? 'medium' : 'small';
|
|
32
32
|
return /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
33
33
|
size: size,
|
|
34
|
+
label: ", Loading",
|
|
34
35
|
appearance: getSpinnerAppearance({
|
|
35
36
|
appearance: appearance,
|
|
36
37
|
isDisabled: isDisabled,
|
|
@@ -73,12 +73,17 @@ export const SplitButtonContainer = ({
|
|
|
73
73
|
css: splitButtonStyles
|
|
74
74
|
}, children);
|
|
75
75
|
};
|
|
76
|
+
|
|
76
77
|
/**
|
|
77
78
|
* __Split Button__
|
|
78
79
|
*
|
|
79
80
|
* @private __UNSAFE__ SplitButton is not yet safe for production use.
|
|
80
81
|
*
|
|
81
|
-
*
|
|
82
|
+
* A split button lets people perform an action or choose from a small group of similar actions.
|
|
83
|
+
*
|
|
84
|
+
* - [Examples](https://atlassian.design/components/button/split-button/examples)
|
|
85
|
+
* - [Code](https://atlassian.design/components/button/split-button/code)
|
|
86
|
+
* - [Usage](https://atlassian.design/components/button/split-button/usage)
|
|
82
87
|
*/
|
|
83
88
|
export const SplitButton = ({
|
|
84
89
|
children,
|
|
@@ -150,8 +150,10 @@ const CustomThemeButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef
|
|
|
150
150
|
buttonStyles
|
|
151
151
|
}) => /*#__PURE__*/React.createElement(ButtonBase, _extends({}, restProps, {
|
|
152
152
|
ref: ref,
|
|
153
|
-
overlay: isLoading ? /*#__PURE__*/React.createElement(LoadingSpinner, restProps) : null
|
|
154
|
-
|
|
153
|
+
overlay: isLoading ? /*#__PURE__*/React.createElement(LoadingSpinner, restProps) : null
|
|
154
|
+
// No need to render aria-disabled when it is false
|
|
155
|
+
,
|
|
156
|
+
"aria-disabled": isLoading || undefined,
|
|
155
157
|
onMouseEnter: onMouseEnter,
|
|
156
158
|
onMouseLeave: onMouseLeave,
|
|
157
159
|
onMouseDown: onMouseDown,
|
|
@@ -20,8 +20,10 @@ const LoadingButton = /*#__PURE__*/React.forwardRef(function LoadingButton({
|
|
|
20
20
|
// Button already has React.memo, so just leaning on that
|
|
21
21
|
return /*#__PURE__*/React.createElement(Button, _extends({}, rest, {
|
|
22
22
|
ref: ref,
|
|
23
|
-
appearance: appearance
|
|
24
|
-
|
|
23
|
+
appearance: appearance
|
|
24
|
+
// No need to render aria-disabled when it is false
|
|
25
|
+
,
|
|
26
|
+
"aria-disabled": isLoading || undefined,
|
|
25
27
|
isDisabled: isDisabled,
|
|
26
28
|
isSelected: isSelected,
|
|
27
29
|
overlay: isLoading ? /*#__PURE__*/React.createElement(LoadingSpinner, {
|
|
@@ -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.17.
|
|
106
|
+
packageVersion: "16.17.8",
|
|
107
107
|
analyticsData: analyticsContext
|
|
108
108
|
});
|
|
109
109
|
|
|
@@ -72,12 +72,17 @@ export var SplitButtonContainer = function SplitButtonContainer(_ref2) {
|
|
|
72
72
|
css: splitButtonStyles
|
|
73
73
|
}, children);
|
|
74
74
|
};
|
|
75
|
+
|
|
75
76
|
/**
|
|
76
77
|
* __Split Button__
|
|
77
78
|
*
|
|
78
79
|
* @private __UNSAFE__ SplitButton is not yet safe for production use.
|
|
79
80
|
*
|
|
80
|
-
*
|
|
81
|
+
* A split button lets people perform an action or choose from a small group of similar actions.
|
|
82
|
+
*
|
|
83
|
+
* - [Examples](https://atlassian.design/components/button/split-button/examples)
|
|
84
|
+
* - [Code](https://atlassian.design/components/button/split-button/code)
|
|
85
|
+
* - [Usage](https://atlassian.design/components/button/split-button/usage)
|
|
81
86
|
*/
|
|
82
87
|
export var SplitButton = function SplitButton(_ref3) {
|
|
83
88
|
var children = _ref3.children,
|
|
@@ -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.17.
|
|
110
|
+
packageVersion: "16.17.8",
|
|
111
111
|
analyticsData: analyticsContext,
|
|
112
112
|
actionSubject: buttonType
|
|
113
113
|
});
|
|
@@ -174,8 +174,10 @@ var CustomThemeButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(f
|
|
|
174
174
|
var buttonStyles = _ref4.buttonStyles;
|
|
175
175
|
return /*#__PURE__*/React.createElement(ButtonBase, _extends({}, restProps, {
|
|
176
176
|
ref: ref,
|
|
177
|
-
overlay: isLoading ? /*#__PURE__*/React.createElement(LoadingSpinner, restProps) : null
|
|
178
|
-
|
|
177
|
+
overlay: isLoading ? /*#__PURE__*/React.createElement(LoadingSpinner, restProps) : null
|
|
178
|
+
// No need to render aria-disabled when it is false
|
|
179
|
+
,
|
|
180
|
+
"aria-disabled": isLoading || undefined,
|
|
179
181
|
onMouseEnter: onMouseEnter,
|
|
180
182
|
onMouseLeave: onMouseLeave,
|
|
181
183
|
onMouseDown: onMouseDown,
|
|
@@ -22,8 +22,10 @@ var LoadingButton = /*#__PURE__*/React.forwardRef(function LoadingButton(_ref, r
|
|
|
22
22
|
// Button already has React.memo, so just leaning on that
|
|
23
23
|
return /*#__PURE__*/React.createElement(Button, _extends({}, rest, {
|
|
24
24
|
ref: ref,
|
|
25
|
-
appearance: appearance
|
|
26
|
-
|
|
25
|
+
appearance: appearance
|
|
26
|
+
// No need to render aria-disabled when it is false
|
|
27
|
+
,
|
|
28
|
+
"aria-disabled": isLoading || undefined,
|
|
27
29
|
isDisabled: isDisabled,
|
|
28
30
|
isSelected: isSelected,
|
|
29
31
|
overlay: isLoading ? /*#__PURE__*/React.createElement(LoadingSpinner, {
|
|
@@ -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.17.
|
|
112
|
+
packageVersion: "16.17.8",
|
|
113
113
|
analyticsData: analyticsContext
|
|
114
114
|
});
|
|
115
115
|
|
|
@@ -24,6 +24,7 @@ export default function LoadingSpinner(_ref2) {
|
|
|
24
24
|
var size = spacing === 'default' ? 'medium' : 'small';
|
|
25
25
|
return /*#__PURE__*/React.createElement(Spinner, {
|
|
26
26
|
size: size,
|
|
27
|
+
label: ", Loading",
|
|
27
28
|
appearance: getSpinnerAppearance({
|
|
28
29
|
appearance: appearance,
|
|
29
30
|
isDisabled: isDisabled,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import type { SplitButtonAppearance, SplitButtonContextAppearance, SplitButtonSpacing } from './types';
|
|
4
|
+
import type { SplitButtonAppearance, SplitButtonContextAppearance, SplitButtonProps, SplitButtonSpacing } from './types';
|
|
5
5
|
type DividerProps = {
|
|
6
6
|
appearance: SplitButtonContextAppearance;
|
|
7
7
|
spacing: SplitButtonSpacing;
|
|
@@ -17,23 +17,16 @@ export declare const Divider: ({ appearance, spacing, isDisabled, }: DividerProp
|
|
|
17
17
|
export declare const SplitButtonContainer: ({ children }: {
|
|
18
18
|
children: ReactNode;
|
|
19
19
|
}) => jsx.JSX.Element;
|
|
20
|
-
type SplitButtonProps = {
|
|
21
|
-
/**
|
|
22
|
-
* Only two children are allowed.
|
|
23
|
-
* First child is the primary action, second child is the secondary action.
|
|
24
|
-
* The assumption is that for both children trees there is a button reading the context.
|
|
25
|
-
*/
|
|
26
|
-
children: ReactNode;
|
|
27
|
-
appearance?: SplitButtonAppearance;
|
|
28
|
-
spacing?: SplitButtonSpacing;
|
|
29
|
-
isDisabled?: boolean;
|
|
30
|
-
};
|
|
31
20
|
/**
|
|
32
21
|
* __Split Button__
|
|
33
22
|
*
|
|
34
23
|
* @private __UNSAFE__ SplitButton is not yet safe for production use.
|
|
35
24
|
*
|
|
36
|
-
*
|
|
25
|
+
* A split button lets people perform an action or choose from a small group of similar actions.
|
|
26
|
+
*
|
|
27
|
+
* - [Examples](https://atlassian.design/components/button/split-button/examples)
|
|
28
|
+
* - [Code](https://atlassian.design/components/button/split-button/code)
|
|
29
|
+
* - [Usage](https://atlassian.design/components/button/split-button/usage)
|
|
37
30
|
*/
|
|
38
31
|
export declare const SplitButton: ({ children, appearance, spacing, isDisabled, }: SplitButtonProps) => jsx.JSX.Element;
|
|
39
32
|
type SplitButtonWithSlotsProps = {
|
|
@@ -1,4 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
export type SplitButtonAppearance =
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type SplitButtonAppearance = 'default' | 'primary';
|
|
3
3
|
export type SplitButtonContextAppearance = SplitButtonAppearance | 'navigation';
|
|
4
|
-
export type SplitButtonSpacing =
|
|
4
|
+
export type SplitButtonSpacing = 'default' | 'compact';
|
|
5
|
+
export type SplitButtonProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Only two children are allowed.
|
|
8
|
+
* First child is the primary action, second child is the secondary action.
|
|
9
|
+
* The assumption is that for both children trees there is a button reading the context.
|
|
10
|
+
*/
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The style variation for child buttons. Will override any appearance set on a child button.
|
|
14
|
+
*/
|
|
15
|
+
appearance?: SplitButtonAppearance;
|
|
16
|
+
/**
|
|
17
|
+
* Controls the amount of padding in the child buttons.
|
|
18
|
+
*/
|
|
19
|
+
spacing?: SplitButtonSpacing;
|
|
20
|
+
/**
|
|
21
|
+
* Whether all child buttons should be disabled.
|
|
22
|
+
*/
|
|
23
|
+
isDisabled?: boolean;
|
|
24
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import type { SplitButtonAppearance, SplitButtonContextAppearance, SplitButtonSpacing } from './types';
|
|
4
|
+
import type { SplitButtonAppearance, SplitButtonContextAppearance, SplitButtonProps, SplitButtonSpacing } from './types';
|
|
5
5
|
type DividerProps = {
|
|
6
6
|
appearance: SplitButtonContextAppearance;
|
|
7
7
|
spacing: SplitButtonSpacing;
|
|
@@ -17,23 +17,16 @@ export declare const Divider: ({ appearance, spacing, isDisabled, }: DividerProp
|
|
|
17
17
|
export declare const SplitButtonContainer: ({ children }: {
|
|
18
18
|
children: ReactNode;
|
|
19
19
|
}) => jsx.JSX.Element;
|
|
20
|
-
type SplitButtonProps = {
|
|
21
|
-
/**
|
|
22
|
-
* Only two children are allowed.
|
|
23
|
-
* First child is the primary action, second child is the secondary action.
|
|
24
|
-
* The assumption is that for both children trees there is a button reading the context.
|
|
25
|
-
*/
|
|
26
|
-
children: ReactNode;
|
|
27
|
-
appearance?: SplitButtonAppearance;
|
|
28
|
-
spacing?: SplitButtonSpacing;
|
|
29
|
-
isDisabled?: boolean;
|
|
30
|
-
};
|
|
31
20
|
/**
|
|
32
21
|
* __Split Button__
|
|
33
22
|
*
|
|
34
23
|
* @private __UNSAFE__ SplitButton is not yet safe for production use.
|
|
35
24
|
*
|
|
36
|
-
*
|
|
25
|
+
* A split button lets people perform an action or choose from a small group of similar actions.
|
|
26
|
+
*
|
|
27
|
+
* - [Examples](https://atlassian.design/components/button/split-button/examples)
|
|
28
|
+
* - [Code](https://atlassian.design/components/button/split-button/code)
|
|
29
|
+
* - [Usage](https://atlassian.design/components/button/split-button/usage)
|
|
37
30
|
*/
|
|
38
31
|
export declare const SplitButton: ({ children, appearance, spacing, isDisabled, }: SplitButtonProps) => jsx.JSX.Element;
|
|
39
32
|
type SplitButtonWithSlotsProps = {
|
|
@@ -1,4 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
export type SplitButtonAppearance =
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type SplitButtonAppearance = 'default' | 'primary';
|
|
3
3
|
export type SplitButtonContextAppearance = SplitButtonAppearance | 'navigation';
|
|
4
|
-
export type SplitButtonSpacing =
|
|
4
|
+
export type SplitButtonSpacing = 'default' | 'compact';
|
|
5
|
+
export type SplitButtonProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Only two children are allowed.
|
|
8
|
+
* First child is the primary action, second child is the secondary action.
|
|
9
|
+
* The assumption is that for both children trees there is a button reading the context.
|
|
10
|
+
*/
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The style variation for child buttons. Will override any appearance set on a child button.
|
|
14
|
+
*/
|
|
15
|
+
appearance?: SplitButtonAppearance;
|
|
16
|
+
/**
|
|
17
|
+
* Controls the amount of padding in the child buttons.
|
|
18
|
+
*/
|
|
19
|
+
spacing?: SplitButtonSpacing;
|
|
20
|
+
/**
|
|
21
|
+
* Whether all child buttons should be disabled.
|
|
22
|
+
*/
|
|
23
|
+
isDisabled?: boolean;
|
|
24
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/button",
|
|
3
|
-
"version": "16.17.
|
|
3
|
+
"version": "16.17.8",
|
|
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/"
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"title": "Split button",
|
|
58
58
|
"id": "split-button",
|
|
59
59
|
"status": {
|
|
60
|
-
"type": "
|
|
60
|
+
"type": "closed-beta"
|
|
61
61
|
},
|
|
62
62
|
"sortKey": 4
|
|
63
63
|
}
|
|
@@ -85,7 +85,7 @@
|
|
|
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.
|
|
88
|
+
"@atlaskit/primitives": "^1.13.0",
|
|
89
89
|
"@atlaskit/spinner": "^16.0.0",
|
|
90
90
|
"@atlaskit/theme": "^12.6.0",
|
|
91
91
|
"@atlaskit/tokens": "^1.29.0",
|