@atlaskit/button 17.2.1 → 17.3.1

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,5 +1,17 @@
1
1
  # @atlaskit/button
2
2
 
3
+ ## 17.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#65509](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65509) [`9e9847bebdbe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9e9847bebdbe) - Fix aria-disabled not being passed to custom theme button
8
+
9
+ ## 17.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#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.
14
+
3
15
  ## 17.2.1
4
16
 
5
17
  ### Patch 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.2.1",
120
+ packageVersion: "17.3.1",
121
121
  analyticsData: analyticsContext,
122
122
  actionSubject: buttonType
123
123
  });
@@ -187,7 +187,7 @@ var CustomThemeButton = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.de
187
187
  overlay: isLoading ? /*#__PURE__*/_react.default.createElement(_loadingSpinner.default, restProps) : null
188
188
  // No need to render aria-disabled when it is false
189
189
  ,
190
- "aria-disabled": isLoading || undefined,
190
+ "aria-disabled": isLoading || restProps['aria-disabled'],
191
191
  onMouseEnter: onMouseEnter,
192
192
  onMouseLeave: onMouseLeave,
193
193
  onMouseDown: onMouseDown,
@@ -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
- marginLeft: "var(--ds-space-negative-025, -2px)"
38
+ marginInlineStart: "var(--ds-space-negative-025, -2px)"
40
39
  });
41
40
  var iconAfterSpacingFixStyle = (0, _react2.css)({
42
- marginRight: "var(--ds-space-negative-025, -2px)"
41
+ marginInlineEnd: "var(--ds-space-negative-025, -2px)"
43
42
  });
44
43
  var getSpacingFix = function getSpacingFix(children, spacingStyles) {
45
- if (!(0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.icon-button-spacing-fix_o1zc5') || !children || (0, _getIfVisuallyHiddenChildren.getIfVisuallyHiddenChildren)(children)) {
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.2.1",
120
+ packageVersion: "17.3.1",
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, !(0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.icon-button-spacing-fix_o1zc5') && children ? (0, _react2.jsx)("span", {
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, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.icon-button-spacing-fix_o1zc5') && (0, _getIfVisuallyHiddenChildren.getIfVisuallyHiddenChildren)(children)) {
12
+ if ((0, _getIfVisuallyHiddenChildren.getIfVisuallyHiddenChildren)(children)) {
14
13
  return true;
15
14
  }
16
15
  if (children) {
@@ -98,7 +98,7 @@ const useButtonBase = ({
98
98
  action: 'clicked',
99
99
  componentName: 'button',
100
100
  packageName: "@atlaskit/button",
101
- packageVersion: "17.2.1",
101
+ packageVersion: "17.3.1",
102
102
  analyticsData: analyticsContext,
103
103
  actionSubject: buttonType
104
104
  });
@@ -153,7 +153,7 @@ const CustomThemeButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef
153
153
  overlay: isLoading ? /*#__PURE__*/React.createElement(LoadingSpinner, restProps) : null
154
154
  // No need to render aria-disabled when it is false
155
155
  ,
156
- "aria-disabled": isLoading || undefined,
156
+ "aria-disabled": isLoading || restProps['aria-disabled'],
157
157
  onMouseEnter: onMouseEnter,
158
158
  onMouseLeave: onMouseLeave,
159
159
  onMouseDown: onMouseDown,
@@ -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
- marginLeft: "var(--ds-space-negative-025, -2px)"
27
+ marginInlineStart: "var(--ds-space-negative-025, -2px)"
29
28
  });
30
29
  const iconAfterSpacingFixStyle = css({
31
- marginRight: "var(--ds-space-negative-025, -2px)"
30
+ marginInlineEnd: "var(--ds-space-negative-025, -2px)"
32
31
  });
33
32
  const getSpacingFix = (children, spacingStyles) => {
34
- if (!getBooleanFF('platform.design-system-team.icon-button-spacing-fix_o1zc5') || !children || getIfVisuallyHiddenChildren(children)) {
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.2.1",
105
+ packageVersion: "17.3.1",
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, !getBooleanFF('platform.design-system-team.icon-button-spacing-fix_o1zc5') && children ? jsx("span", {
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 (getBooleanFF('platform.design-system-team.icon-button-spacing-fix_o1zc5') && getIfVisuallyHiddenChildren(children)) {
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.2.1",
112
+ packageVersion: "17.3.1",
113
113
  analyticsData: analyticsContext,
114
114
  actionSubject: buttonType
115
115
  });
@@ -177,7 +177,7 @@ var CustomThemeButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(f
177
177
  overlay: isLoading ? /*#__PURE__*/React.createElement(LoadingSpinner, restProps) : null
178
178
  // No need to render aria-disabled when it is false
179
179
  ,
180
- "aria-disabled": isLoading || undefined,
180
+ "aria-disabled": isLoading || restProps['aria-disabled'],
181
181
  onMouseEnter: onMouseEnter,
182
182
  onMouseLeave: onMouseLeave,
183
183
  onMouseDown: onMouseDown,
@@ -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
- marginLeft: "var(--ds-space-negative-025, -2px)"
29
+ marginInlineStart: "var(--ds-space-negative-025, -2px)"
31
30
  });
32
31
  var iconAfterSpacingFixStyle = css({
33
- marginRight: "var(--ds-space-negative-025, -2px)"
32
+ marginInlineEnd: "var(--ds-space-negative-025, -2px)"
34
33
  });
35
34
  var getSpacingFix = function getSpacingFix(children, spacingStyles) {
36
- if (!getBooleanFF('platform.design-system-team.icon-button-spacing-fix_o1zc5') || !children || getIfVisuallyHiddenChildren(children)) {
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.2.1",
111
+ packageVersion: "17.3.1",
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, !getBooleanFF('platform.design-system-team.icon-button-spacing-fix_o1zc5') && children ? jsx("span", {
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 (getBooleanFF('platform.design-system-team.icon-button-spacing-fix_o1zc5') && getIfVisuallyHiddenChildren(children)) {
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.2.1",
3
+ "version": "17.3.1",
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,18 +73,12 @@
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
- "@atlaskit/analytics-next": "^9.1.0",
77
+ "@atlaskit/analytics-next": "^9.2.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/platform-feature-flags": "^0.2.0",
88
82
  "@atlaskit/primitives": "^2.0.0",
89
83
  "@atlaskit/spinner": "^16.0.0",
90
84
  "@atlaskit/theme": "^12.6.0",
@@ -100,7 +94,7 @@
100
94
  "@af/accessibility-testing": "*",
101
95
  "@af/integration-testing": "*",
102
96
  "@af/visual-regression": "*",
103
- "@atlaskit/app-provider": "^0.4.0",
97
+ "@atlaskit/app-provider": "^1.0.0",
104
98
  "@atlaskit/ssr": "*",
105
99
  "@atlaskit/visual-regression": "*",
106
100
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",