@atlaskit/button 16.17.7 → 16.17.9
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 +12 -0
- package/dist/cjs/new-button/containers/split-button/split-button.js +32 -6
- package/dist/cjs/new-button/variants/shared/use-button-base.js +1 -1
- package/dist/cjs/new-button/variants/shared/xcss.js +0 -8
- 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 +32 -6
- package/dist/es2019/new-button/variants/shared/use-button-base.js +1 -1
- package/dist/es2019/new-button/variants/shared/xcss.js +0 -8
- 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 +32 -6
- package/dist/esm/new-button/variants/shared/use-button-base.js +1 -1
- package/dist/esm/new-button/variants/shared/xcss.js +0 -8
- 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,17 @@
|
|
|
1
1
|
# @atlaskit/button
|
|
2
2
|
|
|
3
|
+
## 16.17.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#57808](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/57808) [`b99d50f91202`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b99d50f91202) - Internal changes to styling on SplitButton (closed beta) to fix issues with border radius when wrapper elements are used.
|
|
8
|
+
|
|
9
|
+
## 16.17.8
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#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
|
|
14
|
+
|
|
3
15
|
## 16.17.7
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -68,7 +68,20 @@ var splitButtonStyles = (0, _react.css)({
|
|
|
68
68
|
alignItems: 'center',
|
|
69
69
|
whiteSpace: 'nowrap'
|
|
70
70
|
});
|
|
71
|
-
|
|
71
|
+
var primaryButtonStyles = (0, _react.css)({
|
|
72
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
73
|
+
'button,a': {
|
|
74
|
+
borderEndEndRadius: 0,
|
|
75
|
+
borderStartEndRadius: 0
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
var secondaryButtonStyles = (0, _react.css)({
|
|
79
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
80
|
+
'button,a': {
|
|
81
|
+
borderEndStartRadius: 0,
|
|
82
|
+
borderStartStartRadius: 0
|
|
83
|
+
}
|
|
84
|
+
});
|
|
72
85
|
/**
|
|
73
86
|
* TODO: Add JSdoc
|
|
74
87
|
*/
|
|
@@ -78,12 +91,17 @@ var SplitButtonContainer = exports.SplitButtonContainer = function SplitButtonCo
|
|
|
78
91
|
css: splitButtonStyles
|
|
79
92
|
}, children);
|
|
80
93
|
};
|
|
94
|
+
|
|
81
95
|
/**
|
|
82
96
|
* __Split Button__
|
|
83
97
|
*
|
|
84
98
|
* @private __UNSAFE__ SplitButton is not yet safe for production use.
|
|
85
99
|
*
|
|
86
|
-
*
|
|
100
|
+
* A split button lets people perform an action or choose from a small group of similar actions.
|
|
101
|
+
*
|
|
102
|
+
* - [Examples](https://atlassian.design/components/button/split-button/examples)
|
|
103
|
+
* - [Code](https://atlassian.design/components/button/split-button/code)
|
|
104
|
+
* - [Usage](https://atlassian.design/components/button/split-button/usage)
|
|
87
105
|
*/
|
|
88
106
|
var SplitButton = exports.SplitButton = function SplitButton(_ref3) {
|
|
89
107
|
var children = _ref3.children,
|
|
@@ -102,11 +120,15 @@ var SplitButton = exports.SplitButton = function SplitButton(_ref3) {
|
|
|
102
120
|
spacing: spacing,
|
|
103
121
|
isDisabled: isDisabled
|
|
104
122
|
}
|
|
105
|
-
},
|
|
123
|
+
}, (0, _react.jsx)("div", {
|
|
124
|
+
css: primaryButtonStyles
|
|
125
|
+
}, PrimaryAction), (0, _react.jsx)(Divider, {
|
|
106
126
|
appearance: appearance,
|
|
107
127
|
spacing: spacing,
|
|
108
128
|
isDisabled: isDisabled
|
|
109
|
-
}),
|
|
129
|
+
}), (0, _react.jsx)("div", {
|
|
130
|
+
css: secondaryButtonStyles
|
|
131
|
+
}, SecondaryAction)));
|
|
110
132
|
};
|
|
111
133
|
/**
|
|
112
134
|
* TODO: Decide on API
|
|
@@ -126,9 +148,13 @@ var SplitButtonWithSlots = exports.SplitButtonWithSlots = function SplitButtonWi
|
|
|
126
148
|
spacing: spacing,
|
|
127
149
|
isDisabled: isDisabled
|
|
128
150
|
}
|
|
129
|
-
},
|
|
151
|
+
}, (0, _react.jsx)("div", {
|
|
152
|
+
css: primaryButtonStyles
|
|
153
|
+
}, primaryAction), (0, _react.jsx)(Divider, {
|
|
130
154
|
appearance: appearance,
|
|
131
155
|
spacing: spacing,
|
|
132
156
|
isDisabled: isDisabled
|
|
133
|
-
}),
|
|
157
|
+
}), (0, _react.jsx)("div", {
|
|
158
|
+
css: secondaryButtonStyles
|
|
159
|
+
}, secondaryAction)));
|
|
134
160
|
};
|
|
@@ -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.9",
|
|
119
119
|
analyticsData: analyticsContext,
|
|
120
120
|
actionSubject: buttonType
|
|
121
121
|
});
|
|
@@ -48,14 +48,6 @@ var verticalAlign = {
|
|
|
48
48
|
none: 'baseline'
|
|
49
49
|
};
|
|
50
50
|
var splitBorderStyles = {
|
|
51
|
-
':first-of-type': {
|
|
52
|
-
borderTopRightRadius: 0,
|
|
53
|
-
borderBottomRightRadius: 0
|
|
54
|
-
},
|
|
55
|
-
':last-of-type': {
|
|
56
|
-
borderTopLeftRadius: 0,
|
|
57
|
-
borderBottomLeftRadius: 0
|
|
58
|
-
},
|
|
59
51
|
':focus-visible': {
|
|
60
52
|
zIndex: 1
|
|
61
53
|
}
|
|
@@ -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.9",
|
|
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,
|
|
@@ -62,7 +62,20 @@ const splitButtonStyles = css({
|
|
|
62
62
|
alignItems: 'center',
|
|
63
63
|
whiteSpace: 'nowrap'
|
|
64
64
|
});
|
|
65
|
-
|
|
65
|
+
const primaryButtonStyles = css({
|
|
66
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
67
|
+
'button,a': {
|
|
68
|
+
borderEndEndRadius: 0,
|
|
69
|
+
borderStartEndRadius: 0
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
const secondaryButtonStyles = css({
|
|
73
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
74
|
+
'button,a': {
|
|
75
|
+
borderEndStartRadius: 0,
|
|
76
|
+
borderStartStartRadius: 0
|
|
77
|
+
}
|
|
78
|
+
});
|
|
66
79
|
/**
|
|
67
80
|
* TODO: Add JSdoc
|
|
68
81
|
*/
|
|
@@ -73,12 +86,17 @@ export const SplitButtonContainer = ({
|
|
|
73
86
|
css: splitButtonStyles
|
|
74
87
|
}, children);
|
|
75
88
|
};
|
|
89
|
+
|
|
76
90
|
/**
|
|
77
91
|
* __Split Button__
|
|
78
92
|
*
|
|
79
93
|
* @private __UNSAFE__ SplitButton is not yet safe for production use.
|
|
80
94
|
*
|
|
81
|
-
*
|
|
95
|
+
* A split button lets people perform an action or choose from a small group of similar actions.
|
|
96
|
+
*
|
|
97
|
+
* - [Examples](https://atlassian.design/components/button/split-button/examples)
|
|
98
|
+
* - [Code](https://atlassian.design/components/button/split-button/code)
|
|
99
|
+
* - [Usage](https://atlassian.design/components/button/split-button/usage)
|
|
82
100
|
*/
|
|
83
101
|
export const SplitButton = ({
|
|
84
102
|
children,
|
|
@@ -96,11 +114,15 @@ export const SplitButton = ({
|
|
|
96
114
|
spacing,
|
|
97
115
|
isDisabled
|
|
98
116
|
}
|
|
99
|
-
},
|
|
117
|
+
}, jsx("div", {
|
|
118
|
+
css: primaryButtonStyles
|
|
119
|
+
}, PrimaryAction), jsx(Divider, {
|
|
100
120
|
appearance: appearance,
|
|
101
121
|
spacing: spacing,
|
|
102
122
|
isDisabled: isDisabled
|
|
103
|
-
}),
|
|
123
|
+
}), jsx("div", {
|
|
124
|
+
css: secondaryButtonStyles
|
|
125
|
+
}, SecondaryAction)));
|
|
104
126
|
};
|
|
105
127
|
/**
|
|
106
128
|
* TODO: Decide on API
|
|
@@ -118,9 +140,13 @@ export const SplitButtonWithSlots = ({
|
|
|
118
140
|
spacing,
|
|
119
141
|
isDisabled
|
|
120
142
|
}
|
|
121
|
-
},
|
|
143
|
+
}, jsx("div", {
|
|
144
|
+
css: primaryButtonStyles
|
|
145
|
+
}, primaryAction), jsx(Divider, {
|
|
122
146
|
appearance: appearance,
|
|
123
147
|
spacing: spacing,
|
|
124
148
|
isDisabled: isDisabled
|
|
125
|
-
}),
|
|
149
|
+
}), jsx("div", {
|
|
150
|
+
css: secondaryButtonStyles
|
|
151
|
+
}, secondaryAction)));
|
|
126
152
|
};
|
|
@@ -37,14 +37,6 @@ const verticalAlign = {
|
|
|
37
37
|
none: 'baseline'
|
|
38
38
|
};
|
|
39
39
|
const splitBorderStyles = {
|
|
40
|
-
':first-of-type': {
|
|
41
|
-
borderTopRightRadius: 0,
|
|
42
|
-
borderBottomRightRadius: 0
|
|
43
|
-
},
|
|
44
|
-
':last-of-type': {
|
|
45
|
-
borderTopLeftRadius: 0,
|
|
46
|
-
borderBottomLeftRadius: 0
|
|
47
|
-
},
|
|
48
40
|
':focus-visible': {
|
|
49
41
|
zIndex: 1
|
|
50
42
|
}
|
|
@@ -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.9",
|
|
107
107
|
analyticsData: analyticsContext
|
|
108
108
|
});
|
|
109
109
|
|
|
@@ -62,7 +62,20 @@ var splitButtonStyles = css({
|
|
|
62
62
|
alignItems: 'center',
|
|
63
63
|
whiteSpace: 'nowrap'
|
|
64
64
|
});
|
|
65
|
-
|
|
65
|
+
var primaryButtonStyles = css({
|
|
66
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
67
|
+
'button,a': {
|
|
68
|
+
borderEndEndRadius: 0,
|
|
69
|
+
borderStartEndRadius: 0
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
var secondaryButtonStyles = css({
|
|
73
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
74
|
+
'button,a': {
|
|
75
|
+
borderEndStartRadius: 0,
|
|
76
|
+
borderStartStartRadius: 0
|
|
77
|
+
}
|
|
78
|
+
});
|
|
66
79
|
/**
|
|
67
80
|
* TODO: Add JSdoc
|
|
68
81
|
*/
|
|
@@ -72,12 +85,17 @@ export var SplitButtonContainer = function SplitButtonContainer(_ref2) {
|
|
|
72
85
|
css: splitButtonStyles
|
|
73
86
|
}, children);
|
|
74
87
|
};
|
|
88
|
+
|
|
75
89
|
/**
|
|
76
90
|
* __Split Button__
|
|
77
91
|
*
|
|
78
92
|
* @private __UNSAFE__ SplitButton is not yet safe for production use.
|
|
79
93
|
*
|
|
80
|
-
*
|
|
94
|
+
* A split button lets people perform an action or choose from a small group of similar actions.
|
|
95
|
+
*
|
|
96
|
+
* - [Examples](https://atlassian.design/components/button/split-button/examples)
|
|
97
|
+
* - [Code](https://atlassian.design/components/button/split-button/code)
|
|
98
|
+
* - [Usage](https://atlassian.design/components/button/split-button/usage)
|
|
81
99
|
*/
|
|
82
100
|
export var SplitButton = function SplitButton(_ref3) {
|
|
83
101
|
var children = _ref3.children,
|
|
@@ -96,11 +114,15 @@ export var SplitButton = function SplitButton(_ref3) {
|
|
|
96
114
|
spacing: spacing,
|
|
97
115
|
isDisabled: isDisabled
|
|
98
116
|
}
|
|
99
|
-
},
|
|
117
|
+
}, jsx("div", {
|
|
118
|
+
css: primaryButtonStyles
|
|
119
|
+
}, PrimaryAction), jsx(Divider, {
|
|
100
120
|
appearance: appearance,
|
|
101
121
|
spacing: spacing,
|
|
102
122
|
isDisabled: isDisabled
|
|
103
|
-
}),
|
|
123
|
+
}), jsx("div", {
|
|
124
|
+
css: secondaryButtonStyles
|
|
125
|
+
}, SecondaryAction)));
|
|
104
126
|
};
|
|
105
127
|
/**
|
|
106
128
|
* TODO: Decide on API
|
|
@@ -120,9 +142,13 @@ export var SplitButtonWithSlots = function SplitButtonWithSlots(_ref4) {
|
|
|
120
142
|
spacing: spacing,
|
|
121
143
|
isDisabled: isDisabled
|
|
122
144
|
}
|
|
123
|
-
},
|
|
145
|
+
}, jsx("div", {
|
|
146
|
+
css: primaryButtonStyles
|
|
147
|
+
}, primaryAction), jsx(Divider, {
|
|
124
148
|
appearance: appearance,
|
|
125
149
|
spacing: spacing,
|
|
126
150
|
isDisabled: isDisabled
|
|
127
|
-
}),
|
|
151
|
+
}), jsx("div", {
|
|
152
|
+
css: secondaryButtonStyles
|
|
153
|
+
}, secondaryAction)));
|
|
128
154
|
};
|
|
@@ -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.9",
|
|
111
111
|
analyticsData: analyticsContext,
|
|
112
112
|
actionSubject: buttonType
|
|
113
113
|
});
|
|
@@ -40,14 +40,6 @@ var verticalAlign = {
|
|
|
40
40
|
none: 'baseline'
|
|
41
41
|
};
|
|
42
42
|
var splitBorderStyles = {
|
|
43
|
-
':first-of-type': {
|
|
44
|
-
borderTopRightRadius: 0,
|
|
45
|
-
borderBottomRightRadius: 0
|
|
46
|
-
},
|
|
47
|
-
':last-of-type': {
|
|
48
|
-
borderTopLeftRadius: 0,
|
|
49
|
-
borderBottomLeftRadius: 0
|
|
50
|
-
},
|
|
51
43
|
':focus-visible': {
|
|
52
44
|
zIndex: 1
|
|
53
45
|
}
|
|
@@ -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.9",
|
|
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.9",
|
|
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",
|