@atlaskit/button 16.1.1 → 16.1.5

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.
@@ -13,6 +13,8 @@ var _react = _interopRequireDefault(require("react"));
13
13
 
14
14
  var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
15
15
 
16
+ var _excluded = ["spacing"];
17
+
16
18
  function getSpinnerAppearance(_ref) {
17
19
  var appearance = _ref.appearance,
18
20
  isDisabled = _ref.isDisabled,
@@ -36,7 +38,7 @@ function getSpinnerAppearance(_ref) {
36
38
  function LoadingSpinner(_ref2) {
37
39
  var _ref2$spacing = _ref2.spacing,
38
40
  spacing = _ref2$spacing === void 0 ? 'default' : _ref2$spacing,
39
- rest = (0, _objectWithoutProperties2.default)(_ref2, ["spacing"]);
41
+ rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
40
42
  var size = spacing === 'default' ? 'medium' : 'small';
41
43
  return /*#__PURE__*/_react.default.createElement(_spinner.default, {
42
44
  size: size,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/button",
3
- "version": "16.1.1",
3
+ "version": "16.1.5",
4
4
  "sideEffects": false
5
5
  }
@@ -5,6 +5,7 @@ import React, { useCallback, useEffect, useRef } from 'react';
5
5
  import { jsx } from '@emotion/core';
6
6
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
7
7
  import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
8
+ import { N500 } from '@atlaskit/theme/colors';
8
9
  import blockEvents from './block-events';
9
10
  import { getContentStyle, getFadingCss, getIconStyle, overlayCss } from './css';
10
11
 
@@ -69,7 +70,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
69
70
  action: 'clicked',
70
71
  componentName: 'button',
71
72
  packageName: "@atlaskit/button",
72
- packageVersion: "16.1.1",
73
+ packageVersion: "16.1.5",
73
74
  analyticsData: analyticsContext
74
75
  }); // Button currently calls preventDefault, which is not standard button behaviour
75
76
 
@@ -91,6 +92,21 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
91
92
  hasOverlay
92
93
  });
93
94
  const isInteractive = !isDisabled && !hasOverlay;
95
+ /** HACK: Spinner needs to have different colours in the "new" tokens design compared to the old design.
96
+ * For now, while we support both, these styles reach into Spinner when a theme is set, applies the right color.
97
+ * Ticket to remove: https://product-fabric.atlassian.net/browse/DSP-2067
98
+ */
99
+
100
+ var spinnerHackCss = {};
101
+
102
+ if (isSelected || isDisabled || appearance === 'warning') {
103
+ spinnerHackCss = {
104
+ '[data-theme] & svg': {
105
+ stroke: isSelected || isDisabled ? `var(--ds-text-mediumEmphasis, ${N500})` : `var(--ds-text-onBoldWarning, ${N500})`
106
+ }
107
+ };
108
+ }
109
+
94
110
  return jsx(Component, _extends({}, rest, {
95
111
  css: [buttonCss, isInteractive ? null : noPointerEventsOnChildrenCss],
96
112
  className: className,
@@ -122,6 +138,6 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
122
138
  spacing
123
139
  })]
124
140
  }, iconAfter) : null, overlay ? jsx("span", {
125
- css: overlayCss
141
+ css: [overlayCss, spinnerHackCss]
126
142
  }, overlay) : null);
127
143
  });