@atlaskit/button 16.0.0 → 16.1.3

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,14 +1,43 @@
1
1
  # @atlaskit/button
2
2
 
3
+ ## 16.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c3b0a17a96c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c3b0a17a96c) - Fix spinner colours for disabled, warning and selected states when using tokens
8
+ - Updated dependencies
9
+
10
+ ## 16.1.2
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 16.1.1
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+
22
+ ## 16.1.0
23
+
24
+ ### Minor Changes
25
+
26
+ - [`e267e790d38`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e267e790d38) - [ux] Colors are now sourced through tokens.
27
+
28
+ ### Patch Changes
29
+
30
+ - [`2d7cc544696`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2d7cc544696) - Updates token usage to match the latest token set
31
+ - Updated dependencies
32
+
3
33
  ## 16.0.0
4
34
 
5
35
  ### Major Changes
6
36
 
7
- - [`1f9aa6747c7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1f9aa6747c7) - [ux] This fixes a regression in Safari where 2px padding is added to the Button component. Before you upgrade, please ensure you are not relying on overriding styles in the Button element such as applying your own margin. Also ensure you do not have a group of two or more buttons that are not enclosed within a ButtonGroup. This is a breaking change - please ensure you are using a ButtonGroup or robust layout styles that do not rely on Button internals.
37
+ - An accidental release occurred, you can safely upgrade without making any changes as there is no difference between 15.1.8 and 16.0.0.
8
38
 
9
39
  ### Patch Changes
10
40
 
11
- - [`f75544b8b57`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f75544b8b57) - [ux] As a part of DSP-895, a 0px margin was applied to button to fix a regression in Safari. This has been reverted as the 0px margin will be moved to css-reset instead. As a part of that same ticket, the specificity of the footer buttons in modal dialog was updated. This has also been reverted now that the 0px margin is being moved to css-reset.
12
41
  - Updated dependencies
13
42
 
14
43
  ## 15.1.8
@@ -28,7 +28,7 @@ var stateToSelectorMap = {
28
28
  disabled: '&[disabled]'
29
29
  }; // Mapping the new clean css back to the legacy theme format.
30
30
  // The legacy theme format has all styles at the top level (no nested selectors)
31
- // and uses `getSpecifiers()` to apply the style to all psudeo states
31
+ // and uses `getSpecifiers()` to apply the style to all pseudo states
32
32
 
33
33
  function getCustomCss(_ref) {
34
34
  var _ref$appearance = _ref.appearance,
@@ -54,7 +54,7 @@ function getCustomCss(_ref) {
54
54
  shouldFitContainer: shouldFitContainer,
55
55
  isOnlySingleIcon: iconIsOnlyChild
56
56
  }); // we need to disable the default browser focus styles always
57
- // this is because we are not expressing that we can have two pesduo states at a time
57
+ // this is because we are not expressing that we can have two pseudo states at a time
58
58
 
59
59
  result.outline = 'none'; // Pulling relevant styles up to the top level
60
60
 
@@ -82,7 +82,7 @@ function getCustomCss(_ref) {
82
82
  });
83
83
  return result;
84
84
  } // This styling approach works by generating a 'style' and applying with maximum specificity
85
- // To do this we are overwriting all psuedo selectors
85
+ // To do this we are overwriting all pseudo selectors
86
86
 
87
87
 
88
88
  function getSpecifiers(styles) {
@@ -21,6 +21,10 @@ var _analyticsNext = require("@atlaskit/analytics-next");
21
21
 
22
22
  var _useAutoFocus = _interopRequireDefault(require("@atlaskit/ds-lib/use-auto-focus"));
23
23
 
24
+ var _colors = require("@atlaskit/theme/colors");
25
+
26
+ var _tokens = require("@atlaskit/tokens");
27
+
24
28
  var _blockEvents = _interopRequireDefault(require("./block-events"));
25
29
 
26
30
  var _css = require("./css");
@@ -98,7 +102,7 @@ var _default = /*#__PURE__*/_react.default.forwardRef(function ButtonBase(props,
98
102
  action: 'clicked',
99
103
  componentName: 'button',
100
104
  packageName: "@atlaskit/button",
101
- packageVersion: "16.0.0",
105
+ packageVersion: "16.1.3",
102
106
  analyticsData: analyticsContext
103
107
  }); // Button currently calls preventDefault, which is not standard button behaviour
104
108
 
@@ -120,6 +124,21 @@ var _default = /*#__PURE__*/_react.default.forwardRef(function ButtonBase(props,
120
124
  hasOverlay: hasOverlay
121
125
  });
122
126
  var isInteractive = !isDisabled && !hasOverlay;
127
+ /** HACK: Spinner needs to have different colours in the "new" tokens design compared to the old design.
128
+ * For now, while we support both, these styles reach into Spinner when a theme is set, applies the right color.
129
+ * Ticket to remove: https://product-fabric.atlassian.net/browse/DSP-2067
130
+ */
131
+
132
+ var spinnerHackCss = {};
133
+
134
+ if (isSelected || isDisabled || appearance === 'warning') {
135
+ spinnerHackCss = {
136
+ '[data-theme] & svg': {
137
+ stroke: isSelected || isDisabled ? (0, _tokens.token)('color.text.mediumEmphasis', _colors.N500) : (0, _tokens.token)('color.text.onBoldWarning', _colors.N500)
138
+ }
139
+ };
140
+ }
141
+
123
142
  return (0, _core.jsx)(Component, (0, _extends2.default)({}, rest, {
124
143
  css: [buttonCss, isInteractive ? null : noPointerEventsOnChildrenCss],
125
144
  className: className,
@@ -151,7 +170,7 @@ var _default = /*#__PURE__*/_react.default.forwardRef(function ButtonBase(props,
151
170
  spacing: spacing
152
171
  })]
153
172
  }, iconAfter) : null, overlay ? (0, _core.jsx)("span", {
154
- css: _css.overlayCss
173
+ css: [_css.overlayCss, spinnerHackCss]
155
174
  }, overlay) : null);
156
175
  });
157
176