@atlaskit/button 16.5.2 → 16.5.4
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/button-group.js +3 -11
- package/dist/cjs/button.js +14 -34
- package/dist/cjs/custom-theme-button/custom-theme-button.js +41 -76
- package/dist/cjs/custom-theme-button/index.js +0 -3
- package/dist/cjs/custom-theme-button/theme.js +31 -38
- package/dist/cjs/entry-points/button-group.js +0 -2
- package/dist/cjs/entry-points/custom-theme-button.js +0 -4
- package/dist/cjs/entry-points/loading-button.js +0 -2
- package/dist/cjs/entry-points/standard-button.js +0 -3
- package/dist/cjs/index.js +0 -8
- package/dist/cjs/loading-button.js +4 -12
- package/dist/cjs/shared/block-events.js +0 -6
- package/dist/cjs/shared/button-base.js +48 -66
- package/dist/cjs/shared/colors.js +8 -13
- package/dist/cjs/shared/css.js +17 -28
- package/dist/cjs/shared/get-is-only-single-icon.js +2 -7
- package/dist/cjs/shared/loading-spinner.js +4 -15
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/button-group.js +1 -3
- package/dist/es2019/button.js +7 -7
- package/dist/es2019/custom-theme-button/custom-theme-button.js +19 -25
- package/dist/es2019/custom-theme-button/theme.js +21 -16
- package/dist/es2019/index.js +3 -1
- package/dist/es2019/loading-button.js +2 -2
- package/dist/es2019/shared/block-events.js +0 -4
- package/dist/es2019/shared/button-base.js +19 -18
- package/dist/es2019/shared/colors.js +8 -8
- package/dist/es2019/shared/css.js +22 -14
- package/dist/es2019/shared/get-is-only-single-icon.js +0 -3
- package/dist/es2019/shared/loading-spinner.js +0 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/button-group.js +2 -4
- package/dist/esm/button.js +14 -18
- package/dist/esm/custom-theme-button/custom-theme-button.js +41 -61
- package/dist/esm/custom-theme-button/theme.js +31 -31
- package/dist/esm/index.js +3 -1
- package/dist/esm/loading-button.js +4 -5
- package/dist/esm/shared/block-events.js +0 -4
- package/dist/esm/shared/button-base.js +51 -51
- package/dist/esm/shared/colors.js +8 -8
- package/dist/esm/shared/css.js +17 -19
- package/dist/esm/shared/get-is-only-single-icon.js +2 -6
- package/dist/esm/shared/loading-spinner.js +4 -11
- package/dist/esm/version.json +1 -1
- package/package.json +2 -2
- package/report.api.md +14 -1
|
@@ -111,8 +111,8 @@ var values = {
|
|
|
111
111
|
},
|
|
112
112
|
link: {
|
|
113
113
|
default: {
|
|
114
|
-
light:
|
|
115
|
-
dark:
|
|
114
|
+
light: "var(--ds-background-neutral-subtle, none)",
|
|
115
|
+
dark: "var(--ds-background-neutral-subtle, none)"
|
|
116
116
|
},
|
|
117
117
|
selected: {
|
|
118
118
|
light: "var(--ds-background-selected, ".concat(colors.N700, ")"),
|
|
@@ -125,8 +125,8 @@ var values = {
|
|
|
125
125
|
},
|
|
126
126
|
subtle: {
|
|
127
127
|
default: {
|
|
128
|
-
light:
|
|
129
|
-
dark:
|
|
128
|
+
light: "var(--ds-background-neutral-subtle, none)",
|
|
129
|
+
dark: "var(--ds-background-neutral-subtle, none)"
|
|
130
130
|
},
|
|
131
131
|
hover: {
|
|
132
132
|
light: "var(--ds-background-neutral-subtle-hovered, ".concat(colors.N30A, ")"),
|
|
@@ -137,8 +137,8 @@ var values = {
|
|
|
137
137
|
dark: "var(--ds-background-neutral-subtle-pressed, ".concat(colors.B75, ")")
|
|
138
138
|
},
|
|
139
139
|
disabled: {
|
|
140
|
-
light:
|
|
141
|
-
dark:
|
|
140
|
+
light: "var(--ds-background-neutral-subtle, none)",
|
|
141
|
+
dark: "var(--ds-background-neutral-subtle, none)"
|
|
142
142
|
},
|
|
143
143
|
selected: {
|
|
144
144
|
light: "var(--ds-background-selected, ".concat(colors.N700, ")"),
|
|
@@ -151,8 +151,8 @@ var values = {
|
|
|
151
151
|
},
|
|
152
152
|
'subtle-link': {
|
|
153
153
|
default: {
|
|
154
|
-
light:
|
|
155
|
-
dark:
|
|
154
|
+
light: "var(--ds-background-neutral-subtle, none)",
|
|
155
|
+
dark: "var(--ds-background-neutral-subtle, none)"
|
|
156
156
|
},
|
|
157
157
|
selected: {
|
|
158
158
|
light: "var(--ds-background-selected, ".concat(colors.N700, ")"),
|
package/dist/esm/shared/css.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
4
|
import { css } from '@emotion/react';
|
|
8
5
|
import { borderRadius as getBorderRadius, fontSize as getFontSize, gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
9
6
|
import colors from './colors';
|
|
10
7
|
var borderRadius = getBorderRadius();
|
|
11
8
|
var gridSize = getGridSize();
|
|
12
|
-
var fontSize = getFontSize();
|
|
9
|
+
var fontSize = getFontSize();
|
|
10
|
+
|
|
11
|
+
// ## Button layout
|
|
13
12
|
//
|
|
14
13
|
// /------------------------------------------------------------------------------------------------------------------\
|
|
15
14
|
// | → | ← | | → | ← | | → | ← | | → | ← |
|
|
@@ -21,7 +20,6 @@ var fontSize = getFontSize(); // ## Button layout
|
|
|
21
20
|
// ↑ ↑
|
|
22
21
|
// Margins don't collapse with inline-flex
|
|
23
22
|
//
|
|
24
|
-
|
|
25
23
|
var heights = {
|
|
26
24
|
default: "".concat(gridSize * 4 / fontSize, "em"),
|
|
27
25
|
// 32px
|
|
@@ -54,19 +52,17 @@ var innerMargin = {
|
|
|
54
52
|
content: "0 ".concat(gridSize / 4, "px"),
|
|
55
53
|
icon: "0 ".concat(gridSize / 4, "px")
|
|
56
54
|
};
|
|
57
|
-
|
|
58
55
|
function getColor(_ref) {
|
|
59
56
|
var group = _ref.group,
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
key = _ref.key,
|
|
58
|
+
mode = _ref.mode;
|
|
62
59
|
var rule = group[key] || group.default;
|
|
63
60
|
return rule[mode];
|
|
64
61
|
}
|
|
65
|
-
|
|
66
62
|
function getColors(_ref2) {
|
|
67
63
|
var appearance = _ref2.appearance,
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
key = _ref2.key,
|
|
65
|
+
mode = _ref2.mode;
|
|
70
66
|
return {
|
|
71
67
|
background: getColor({
|
|
72
68
|
group: colors.background[appearance],
|
|
@@ -81,14 +77,13 @@ function getColors(_ref2) {
|
|
|
81
77
|
}), " !important")
|
|
82
78
|
};
|
|
83
79
|
}
|
|
84
|
-
|
|
85
80
|
export function getCss(_ref3) {
|
|
86
81
|
var appearance = _ref3.appearance,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
spacing = _ref3.spacing,
|
|
83
|
+
mode = _ref3.mode,
|
|
84
|
+
isSelected = _ref3.isSelected,
|
|
85
|
+
shouldFitContainer = _ref3.shouldFitContainer,
|
|
86
|
+
isOnlySingleIcon = _ref3.isOnlySingleIcon;
|
|
92
87
|
var baseColors = getColors({
|
|
93
88
|
appearance: appearance,
|
|
94
89
|
key: isSelected ? 'selected' : 'default',
|
|
@@ -125,6 +120,7 @@ export function getCss(_ref3) {
|
|
|
125
120
|
justifyContent: 'center',
|
|
126
121
|
// Note: we cannot disable pointer events when there is an overlay.
|
|
127
122
|
// That would be easy for styling, but it would start letting events through on disabled buttons
|
|
123
|
+
|
|
128
124
|
// Disabling visited styles (just using the base colors)
|
|
129
125
|
'&:visited': _objectSpread({}, baseColors),
|
|
130
126
|
'&:hover': _objectSpread(_objectSpread({}, getColors({
|
|
@@ -193,8 +189,9 @@ export function getCss(_ref3) {
|
|
|
193
189
|
padding: 0
|
|
194
190
|
}
|
|
195
191
|
});
|
|
196
|
-
}
|
|
192
|
+
}
|
|
197
193
|
|
|
194
|
+
// inline-flex child
|
|
198
195
|
export function getIconStyle(_ref4) {
|
|
199
196
|
var spacing = _ref4.spacing;
|
|
200
197
|
return css({
|
|
@@ -208,8 +205,9 @@ export function getIconStyle(_ref4) {
|
|
|
208
205
|
lineHeight: 0,
|
|
209
206
|
userSelect: 'none'
|
|
210
207
|
});
|
|
211
|
-
}
|
|
208
|
+
}
|
|
212
209
|
|
|
210
|
+
// inline-flex child
|
|
213
211
|
export function getContentStyle(_ref5) {
|
|
214
212
|
var spacing = _ref5.spacing;
|
|
215
213
|
return css({
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
export default function getIsOnlySingleIcon(_ref) {
|
|
2
2
|
var children = _ref.children,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
iconBefore = _ref.iconBefore,
|
|
4
|
+
iconAfter = _ref.iconAfter;
|
|
6
5
|
if (children) {
|
|
7
6
|
return false;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
if (iconBefore && !iconAfter) {
|
|
11
9
|
return true;
|
|
12
10
|
}
|
|
13
|
-
|
|
14
11
|
if (!iconBefore && iconAfter) {
|
|
15
12
|
return true;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
return false;
|
|
19
15
|
}
|
|
@@ -2,32 +2,25 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
2
2
|
var _excluded = ["spacing"];
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import Spinner from '@atlaskit/spinner';
|
|
5
|
-
|
|
6
5
|
function getSpinnerAppearance(_ref) {
|
|
7
6
|
var appearance = _ref.appearance,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
isDisabled = _ref.isDisabled,
|
|
8
|
+
isSelected = _ref.isSelected;
|
|
11
9
|
if (isDisabled) {
|
|
12
10
|
return 'inherit';
|
|
13
11
|
}
|
|
14
|
-
|
|
15
12
|
if (isSelected) {
|
|
16
13
|
return 'invert';
|
|
17
14
|
}
|
|
18
|
-
|
|
19
15
|
if (appearance === 'primary' || appearance === 'danger') {
|
|
20
16
|
return 'invert';
|
|
21
17
|
}
|
|
22
|
-
|
|
23
18
|
return 'inherit';
|
|
24
19
|
}
|
|
25
|
-
|
|
26
20
|
export default function LoadingSpinner(_ref2) {
|
|
27
21
|
var _ref2$spacing = _ref2.spacing,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
spacing = _ref2$spacing === void 0 ? 'default' : _ref2$spacing,
|
|
23
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
31
24
|
var size = spacing === 'default' ? 'medium' : 'small';
|
|
32
25
|
return /*#__PURE__*/React.createElement(Spinner, {
|
|
33
26
|
size: size,
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/button",
|
|
3
|
-
"version": "16.5.
|
|
3
|
+
"version": "16.5.4",
|
|
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/"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@atlaskit/icon": "^21.11.0",
|
|
51
51
|
"@atlaskit/logo": "^13.10.0",
|
|
52
52
|
"@atlaskit/section-message": "^6.3.0",
|
|
53
|
-
"@atlaskit/select": "^16.
|
|
53
|
+
"@atlaskit/select": "^16.1.0",
|
|
54
54
|
"@atlaskit/ssr": "*",
|
|
55
55
|
"@atlaskit/visual-regression": "*",
|
|
56
56
|
"@atlaskit/webdriver-runner": "*",
|
package/report.api.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- API Report Version: 2.
|
|
1
|
+
<!-- API Report Version: 2.3 -->
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/button"
|
|
4
4
|
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
### Table of contents
|
|
9
9
|
|
|
10
10
|
- [Main Entry Types](#main-entry-types)
|
|
11
|
+
- [Peer Dependencies](#peer-dependencies)
|
|
11
12
|
|
|
12
13
|
### Main Entry Types
|
|
13
14
|
|
|
@@ -190,3 +191,15 @@ export type ThemeTokens = {
|
|
|
190
191
|
```
|
|
191
192
|
|
|
192
193
|
<!--SECTION END: Main Entry Types-->
|
|
194
|
+
|
|
195
|
+
### Peer Dependencies
|
|
196
|
+
|
|
197
|
+
<!--SECTION START: Peer Dependencies-->
|
|
198
|
+
|
|
199
|
+
```json
|
|
200
|
+
{
|
|
201
|
+
"react": "^16.8.0"
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
<!--SECTION END: Peer Dependencies-->
|