@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.
- package/CHANGELOG.md +26 -0
- package/dist/cjs/button.js +3 -1
- package/dist/cjs/custom-theme-button/custom-theme-button.js +5 -3
- package/dist/cjs/custom-theme-button/index.js +4 -4
- package/dist/cjs/custom-theme-button/theme.js +4 -4
- package/dist/cjs/entry-points/custom-theme-button.js +4 -4
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/loading-button.js +3 -1
- package/dist/cjs/shared/button-base.js +22 -4
- package/dist/cjs/shared/colors.js +160 -163
- package/dist/cjs/shared/css.js +4 -4
- package/dist/cjs/shared/loading-spinner.js +3 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/shared/button-base.js +18 -2
- package/dist/es2019/shared/colors.js +160 -162
- package/dist/es2019/version.json +1 -1
- package/dist/esm/button.js +2 -1
- package/dist/esm/custom-theme-button/custom-theme-button.js +4 -3
- package/dist/esm/custom-theme-button/theme.js +2 -2
- package/dist/esm/loading-button.js +2 -1
- package/dist/esm/shared/button-base.js +20 -3
- package/dist/esm/shared/colors.js +160 -162
- package/dist/esm/shared/css.js +2 -2
- package/dist/esm/shared/loading-spinner.js +2 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/shared/loading-spinner.d.ts +1 -0
- package/package.json +8 -7
|
@@ -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,
|
|
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,
|
package/dist/cjs/version.json
CHANGED
|
@@ -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.
|
|
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
|
});
|