@atlaskit/button 17.2.0 → 17.3.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 +12 -0
- package/dist/cjs/new-button/variants/shared/use-button-base.js +1 -1
- package/dist/cjs/old-button/shared/button-base.js +6 -11
- package/dist/cjs/old-button/shared/get-is-only-single-icon.js +1 -2
- package/dist/es2019/new-button/variants/shared/use-button-base.js +1 -1
- package/dist/es2019/old-button/shared/button-base.js +6 -11
- package/dist/es2019/old-button/shared/get-is-only-single-icon.js +1 -2
- package/dist/esm/new-button/variants/shared/use-button-base.js +1 -1
- package/dist/esm/old-button/shared/button-base.js +6 -11
- package/dist/esm/old-button/shared/get-is-only-single-icon.js +1 -2
- package/package.json +3 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/button
|
|
2
2
|
|
|
3
|
+
## 17.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#70040](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70040) [`d18ec4d7ce20`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d18ec4d7ce20) - [ux] Tidy up of the `platform.design-system-team.icon-button-spacing-fix_o1zc5` Platform Feature Flag which applies a small adjustment to icon spacing for buttons using `iconBefore` and `iconAfter` props. Small visual adjustment is to be expected — keep this in mind when reviewing any VR tests breaking. The spacing around the icons will be reduced.
|
|
8
|
+
|
|
9
|
+
## 17.2.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 17.2.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -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.3.0",
|
|
121
121
|
analyticsData: analyticsContext,
|
|
122
122
|
actionSubject: buttonType
|
|
123
123
|
});
|
|
@@ -15,7 +15,6 @@ var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
|
15
15
|
var _useAutoFocus = _interopRequireDefault(require("@atlaskit/ds-lib/use-auto-focus"));
|
|
16
16
|
var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
|
|
17
17
|
var _interactionContext = _interopRequireDefault(require("@atlaskit/interaction-context"));
|
|
18
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
18
|
var _colors = require("@atlaskit/theme/colors");
|
|
20
19
|
var _blockEvents = _interopRequireDefault(require("./block-events"));
|
|
21
20
|
var _css = require("./css");
|
|
@@ -36,13 +35,13 @@ var noPointerEventsOnChildrenCss = {
|
|
|
36
35
|
}
|
|
37
36
|
};
|
|
38
37
|
var iconBeforeSpacingFixStyle = (0, _react2.css)({
|
|
39
|
-
|
|
38
|
+
marginInlineStart: "var(--ds-space-negative-025, -2px)"
|
|
40
39
|
});
|
|
41
40
|
var iconAfterSpacingFixStyle = (0, _react2.css)({
|
|
42
|
-
|
|
41
|
+
marginInlineEnd: "var(--ds-space-negative-025, -2px)"
|
|
43
42
|
});
|
|
44
43
|
var getSpacingFix = function getSpacingFix(children, spacingStyles) {
|
|
45
|
-
if (!
|
|
44
|
+
if (!children || (0, _getIfVisuallyHiddenChildren.getIfVisuallyHiddenChildren)(children)) {
|
|
46
45
|
return null;
|
|
47
46
|
}
|
|
48
47
|
return spacingStyles;
|
|
@@ -118,7 +117,7 @@ var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
118
117
|
action: 'clicked',
|
|
119
118
|
componentName: 'button',
|
|
120
119
|
packageName: "@atlaskit/button",
|
|
121
|
-
packageVersion: "17.
|
|
120
|
+
packageVersion: "17.3.0",
|
|
122
121
|
analyticsData: analyticsContext
|
|
123
122
|
});
|
|
124
123
|
|
|
@@ -146,7 +145,7 @@ var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
146
145
|
/**
|
|
147
146
|
* HACK: Spinner needs to have different colours in the "new" tokens design compared to the old design.
|
|
148
147
|
* For now, while we support both, these styles reach into Spinner when a theme is set, applies the right color.
|
|
149
|
-
* Ticket to remove: https://product-fabric.atlassian.net/browse/DSP-2067
|
|
148
|
+
* Ticket to remove: https://product-fabric.atlassian.net/browse/DSP-2067.
|
|
150
149
|
*/
|
|
151
150
|
var spinnerHackCss = {};
|
|
152
151
|
if (isSelected || isDisabled || appearance === 'warning') {
|
|
@@ -182,11 +181,7 @@ var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
182
181
|
css: [fadeStyles, (0, _css.getIconStyle)({
|
|
183
182
|
spacing: spacing
|
|
184
183
|
}), getSpacingFix(children, iconBeforeSpacingFixStyle)]
|
|
185
|
-
}, iconBefore) : null,
|
|
186
|
-
css: [fadeStyles, (0, _css.getContentStyle)({
|
|
187
|
-
spacing: spacing
|
|
188
|
-
})]
|
|
189
|
-
}, children) : null, (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.icon-button-spacing-fix_o1zc5') && getChildren(children, [fadeStyles, (0, _css.getContentStyle)({
|
|
184
|
+
}, iconBefore) : null, getChildren(children, [fadeStyles, (0, _css.getContentStyle)({
|
|
190
185
|
spacing: spacing
|
|
191
186
|
})]), iconAfter ? (0, _react2.jsx)("span", {
|
|
192
187
|
css: [fadeStyles, (0, _css.getIconStyle)({
|
|
@@ -4,13 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = getIsOnlySingleIcon;
|
|
7
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
7
|
var _getIfVisuallyHiddenChildren = require("./get-if-visually-hidden-children");
|
|
9
8
|
function getIsOnlySingleIcon(_ref) {
|
|
10
9
|
var children = _ref.children,
|
|
11
10
|
iconBefore = _ref.iconBefore,
|
|
12
11
|
iconAfter = _ref.iconAfter;
|
|
13
|
-
if ((0,
|
|
12
|
+
if ((0, _getIfVisuallyHiddenChildren.getIfVisuallyHiddenChildren)(children)) {
|
|
14
13
|
return true;
|
|
15
14
|
}
|
|
16
15
|
if (children) {
|
|
@@ -9,7 +9,6 @@ import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
|
|
|
9
9
|
import FocusRing from '@atlaskit/focus-ring';
|
|
10
10
|
// eslint-disable-next-line no-duplicate-imports
|
|
11
11
|
import InteractionContext from '@atlaskit/interaction-context';
|
|
12
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import { N500 } from '@atlaskit/theme/colors';
|
|
14
13
|
import blockEvents from './block-events';
|
|
15
14
|
import { getContentStyle, getFadingCss, getIconStyle, overlayCss } from './css';
|
|
@@ -25,13 +24,13 @@ const noPointerEventsOnChildrenCss = {
|
|
|
25
24
|
}
|
|
26
25
|
};
|
|
27
26
|
const iconBeforeSpacingFixStyle = css({
|
|
28
|
-
|
|
27
|
+
marginInlineStart: "var(--ds-space-negative-025, -2px)"
|
|
29
28
|
});
|
|
30
29
|
const iconAfterSpacingFixStyle = css({
|
|
31
|
-
|
|
30
|
+
marginInlineEnd: "var(--ds-space-negative-025, -2px)"
|
|
32
31
|
});
|
|
33
32
|
const getSpacingFix = (children, spacingStyles) => {
|
|
34
|
-
if (!
|
|
33
|
+
if (!children || getIfVisuallyHiddenChildren(children)) {
|
|
35
34
|
return null;
|
|
36
35
|
}
|
|
37
36
|
return spacingStyles;
|
|
@@ -103,7 +102,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
103
102
|
action: 'clicked',
|
|
104
103
|
componentName: 'button',
|
|
105
104
|
packageName: "@atlaskit/button",
|
|
106
|
-
packageVersion: "17.
|
|
105
|
+
packageVersion: "17.3.0",
|
|
107
106
|
analyticsData: analyticsContext
|
|
108
107
|
});
|
|
109
108
|
|
|
@@ -131,7 +130,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
131
130
|
/**
|
|
132
131
|
* HACK: Spinner needs to have different colours in the "new" tokens design compared to the old design.
|
|
133
132
|
* For now, while we support both, these styles reach into Spinner when a theme is set, applies the right color.
|
|
134
|
-
* Ticket to remove: https://product-fabric.atlassian.net/browse/DSP-2067
|
|
133
|
+
* Ticket to remove: https://product-fabric.atlassian.net/browse/DSP-2067.
|
|
135
134
|
*/
|
|
136
135
|
var spinnerHackCss = {};
|
|
137
136
|
if (isSelected || isDisabled || appearance === 'warning') {
|
|
@@ -167,11 +166,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
167
166
|
css: [fadeStyles, getIconStyle({
|
|
168
167
|
spacing
|
|
169
168
|
}), getSpacingFix(children, iconBeforeSpacingFixStyle)]
|
|
170
|
-
}, iconBefore) : null,
|
|
171
|
-
css: [fadeStyles, getContentStyle({
|
|
172
|
-
spacing
|
|
173
|
-
})]
|
|
174
|
-
}, children) : null, getBooleanFF('platform.design-system-team.icon-button-spacing-fix_o1zc5') && getChildren(children, [fadeStyles, getContentStyle({
|
|
169
|
+
}, iconBefore) : null, getChildren(children, [fadeStyles, getContentStyle({
|
|
175
170
|
spacing
|
|
176
171
|
})]), iconAfter ? jsx("span", {
|
|
177
172
|
css: [fadeStyles, getIconStyle({
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
import { getIfVisuallyHiddenChildren } from './get-if-visually-hidden-children';
|
|
3
2
|
export default function getIsOnlySingleIcon({
|
|
4
3
|
children,
|
|
5
4
|
iconBefore,
|
|
6
5
|
iconAfter
|
|
7
6
|
}) {
|
|
8
|
-
if (
|
|
7
|
+
if (getIfVisuallyHiddenChildren(children)) {
|
|
9
8
|
return true;
|
|
10
9
|
}
|
|
11
10
|
if (children) {
|
|
@@ -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.3.0",
|
|
113
113
|
analyticsData: analyticsContext,
|
|
114
114
|
actionSubject: buttonType
|
|
115
115
|
});
|
|
@@ -11,7 +11,6 @@ import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
|
|
|
11
11
|
import FocusRing from '@atlaskit/focus-ring';
|
|
12
12
|
// eslint-disable-next-line no-duplicate-imports
|
|
13
13
|
import InteractionContext from '@atlaskit/interaction-context';
|
|
14
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
15
14
|
import { N500 } from '@atlaskit/theme/colors';
|
|
16
15
|
import blockEvents from './block-events';
|
|
17
16
|
import { getContentStyle, getFadingCss, getIconStyle, overlayCss } from './css';
|
|
@@ -27,13 +26,13 @@ var noPointerEventsOnChildrenCss = {
|
|
|
27
26
|
}
|
|
28
27
|
};
|
|
29
28
|
var iconBeforeSpacingFixStyle = css({
|
|
30
|
-
|
|
29
|
+
marginInlineStart: "var(--ds-space-negative-025, -2px)"
|
|
31
30
|
});
|
|
32
31
|
var iconAfterSpacingFixStyle = css({
|
|
33
|
-
|
|
32
|
+
marginInlineEnd: "var(--ds-space-negative-025, -2px)"
|
|
34
33
|
});
|
|
35
34
|
var getSpacingFix = function getSpacingFix(children, spacingStyles) {
|
|
36
|
-
if (!
|
|
35
|
+
if (!children || getIfVisuallyHiddenChildren(children)) {
|
|
37
36
|
return null;
|
|
38
37
|
}
|
|
39
38
|
return spacingStyles;
|
|
@@ -109,7 +108,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
109
108
|
action: 'clicked',
|
|
110
109
|
componentName: 'button',
|
|
111
110
|
packageName: "@atlaskit/button",
|
|
112
|
-
packageVersion: "17.
|
|
111
|
+
packageVersion: "17.3.0",
|
|
113
112
|
analyticsData: analyticsContext
|
|
114
113
|
});
|
|
115
114
|
|
|
@@ -137,7 +136,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
137
136
|
/**
|
|
138
137
|
* HACK: Spinner needs to have different colours in the "new" tokens design compared to the old design.
|
|
139
138
|
* For now, while we support both, these styles reach into Spinner when a theme is set, applies the right color.
|
|
140
|
-
* Ticket to remove: https://product-fabric.atlassian.net/browse/DSP-2067
|
|
139
|
+
* Ticket to remove: https://product-fabric.atlassian.net/browse/DSP-2067.
|
|
141
140
|
*/
|
|
142
141
|
var spinnerHackCss = {};
|
|
143
142
|
if (isSelected || isDisabled || appearance === 'warning') {
|
|
@@ -173,11 +172,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
173
172
|
css: [fadeStyles, getIconStyle({
|
|
174
173
|
spacing: spacing
|
|
175
174
|
}), getSpacingFix(children, iconBeforeSpacingFixStyle)]
|
|
176
|
-
}, iconBefore) : null,
|
|
177
|
-
css: [fadeStyles, getContentStyle({
|
|
178
|
-
spacing: spacing
|
|
179
|
-
})]
|
|
180
|
-
}, children) : null, getBooleanFF('platform.design-system-team.icon-button-spacing-fix_o1zc5') && getChildren(children, [fadeStyles, getContentStyle({
|
|
175
|
+
}, iconBefore) : null, getChildren(children, [fadeStyles, getContentStyle({
|
|
181
176
|
spacing: spacing
|
|
182
177
|
})]), iconAfter ? jsx("span", {
|
|
183
178
|
css: [fadeStyles, getIconStyle({
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
import { getIfVisuallyHiddenChildren } from './get-if-visually-hidden-children';
|
|
3
2
|
export default function getIsOnlySingleIcon(_ref) {
|
|
4
3
|
var children = _ref.children,
|
|
5
4
|
iconBefore = _ref.iconBefore,
|
|
6
5
|
iconAfter = _ref.iconAfter;
|
|
7
|
-
if (
|
|
6
|
+
if (getIfVisuallyHiddenChildren(children)) {
|
|
8
7
|
return true;
|
|
9
8
|
}
|
|
10
9
|
if (children) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/button",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.3.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/"
|
|
@@ -73,22 +73,16 @@
|
|
|
73
73
|
"./types": "./src/entry-points/types.tsx",
|
|
74
74
|
".": "./src/index.tsx"
|
|
75
75
|
},
|
|
76
|
-
"platform-feature-flags": {
|
|
77
|
-
"platform.design-system-team.icon-button-spacing-fix_o1zc5": {
|
|
78
|
-
"type": "boolean"
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
76
|
"dependencies": {
|
|
82
77
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
83
78
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
84
79
|
"@atlaskit/focus-ring": "^1.3.0",
|
|
85
80
|
"@atlaskit/icon": "^22.0.0",
|
|
86
81
|
"@atlaskit/interaction-context": "^2.1.0",
|
|
87
|
-
"@atlaskit/
|
|
88
|
-
"@atlaskit/primitives": "^1.16.0",
|
|
82
|
+
"@atlaskit/primitives": "^2.0.0",
|
|
89
83
|
"@atlaskit/spinner": "^16.0.0",
|
|
90
84
|
"@atlaskit/theme": "^12.6.0",
|
|
91
|
-
"@atlaskit/tokens": "^1.
|
|
85
|
+
"@atlaskit/tokens": "^1.35.0",
|
|
92
86
|
"@atlaskit/visually-hidden": "^1.2.4",
|
|
93
87
|
"@babel/runtime": "^7.0.0",
|
|
94
88
|
"@emotion/react": "^11.7.1"
|