@atlaskit/button 16.5.7 → 16.6.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 +14 -0
- package/dist/cjs/custom-theme-button/theme.js +1 -1
- package/dist/cjs/shared/button-base.js +6 -3
- package/dist/cjs/shared/colors.js +0 -72
- package/dist/cjs/shared/css.js +1 -12
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/custom-theme-button/theme.js +1 -1
- package/dist/es2019/shared/button-base.js +4 -3
- package/dist/es2019/shared/colors.js +0 -72
- package/dist/es2019/shared/css.js +1 -13
- package/dist/es2019/version.json +1 -1
- package/dist/esm/custom-theme-button/theme.js +1 -1
- package/dist/esm/shared/button-base.js +4 -3
- package/dist/esm/shared/colors.js +0 -72
- package/dist/esm/shared/css.js +1 -12
- package/dist/esm/version.json +1 -1
- package/dist/types/shared/colors.d.ts +0 -8
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/button
|
|
2
2
|
|
|
3
|
+
## 16.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`23a850fe471`](https://bitbucket.org/atlassian/atlassian-frontend/commits/23a850fe471) - DUMMY changeset to fix PI
|
|
8
|
+
|
|
9
|
+
## 16.6.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`3367210dce8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3367210dce8) - [ux] Internal change to the way focus is rendered for buttons.
|
|
14
|
+
Focus states now apply a 2px offset to the focus ring to aid the contrast of the focus state when applied on the 'primary' and 'selected' buttons.
|
|
15
|
+
As part of this change, and to settle on a more systemic approach to focus, button also no longer applies a different colored shadow per appearance.
|
|
16
|
+
|
|
3
17
|
## 16.5.7
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -81,7 +81,7 @@ function getCustomCss(_ref) {
|
|
|
81
81
|
// To do this we are overwriting all pseudo selectors
|
|
82
82
|
function getSpecifiers(styles) {
|
|
83
83
|
return {
|
|
84
|
-
'&, &:hover, &:active, &:focus, &:visited, &:disabled, &[disabled]': styles
|
|
84
|
+
'&, &:hover, &:active, &:focus, &:focus-visible, &:visited, &:disabled, &[disabled]': styles
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
function defaultThemeFn(current, values) {
|
|
@@ -13,11 +13,14 @@ var _react2 = require("@emotion/react");
|
|
|
13
13
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
14
14
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
15
15
|
var _useAutoFocus = _interopRequireDefault(require("@atlaskit/ds-lib/use-auto-focus"));
|
|
16
|
+
var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
|
|
16
17
|
var _interactionContext = _interopRequireDefault(require("@atlaskit/interaction-context"));
|
|
17
18
|
var _colors = require("@atlaskit/theme/colors");
|
|
18
19
|
var _blockEvents = _interopRequireDefault(require("./block-events"));
|
|
19
20
|
var _css = require("./css");
|
|
20
21
|
var _excluded = ["appearance", "buttonCss", "spacing", "autoFocus", "isDisabled", "shouldFitContainer", "isSelected", "iconBefore", "iconAfter", "children", "className", "href", "overlay", "tabIndex", "type", "onMouseDown", "onClick", "component", "testId", "interactionName", "analyticsContext"];
|
|
22
|
+
/** @jsx jsx */
|
|
23
|
+
// eslint-disable-next-line no-duplicate-imports
|
|
21
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
25
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
26
|
// Disabled buttons will still publish events for nested elements in webkit.
|
|
@@ -90,7 +93,7 @@ var _default = /*#__PURE__*/_react.default.forwardRef(function ButtonBase(props,
|
|
|
90
93
|
action: 'clicked',
|
|
91
94
|
componentName: 'button',
|
|
92
95
|
packageName: "@atlaskit/button",
|
|
93
|
-
packageVersion: "16.
|
|
96
|
+
packageVersion: "16.6.1",
|
|
94
97
|
analyticsData: analyticsContext
|
|
95
98
|
});
|
|
96
99
|
|
|
@@ -128,7 +131,7 @@ var _default = /*#__PURE__*/_react.default.forwardRef(function ButtonBase(props,
|
|
|
128
131
|
}
|
|
129
132
|
};
|
|
130
133
|
}
|
|
131
|
-
return (0, _react2.jsx)(Component, (0, _extends2.default)({}, rest, {
|
|
134
|
+
return (0, _react2.jsx)(_focusRing.default, null, (0, _react2.jsx)(Component, (0, _extends2.default)({}, rest, {
|
|
132
135
|
css: [buttonCss, isInteractive ? null : noPointerEventsOnChildrenCss],
|
|
133
136
|
className: className,
|
|
134
137
|
ref: setRef,
|
|
@@ -162,6 +165,6 @@ var _default = /*#__PURE__*/_react.default.forwardRef(function ButtonBase(props,
|
|
|
162
165
|
})]
|
|
163
166
|
}, iconAfter) : null, overlay ? (0, _react2.jsx)("span", {
|
|
164
167
|
css: [_css.overlayCss, spinnerHackCss]
|
|
165
|
-
}, overlay) : null);
|
|
168
|
+
}, overlay) : null));
|
|
166
169
|
});
|
|
167
170
|
exports.default = _default;
|
|
@@ -173,78 +173,6 @@ var values = {
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
},
|
|
176
|
-
boxShadowColor: {
|
|
177
|
-
default: {
|
|
178
|
-
focus: {
|
|
179
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
180
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
181
|
-
},
|
|
182
|
-
focusSelected: {
|
|
183
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
184
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
primary: {
|
|
188
|
-
focus: {
|
|
189
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
190
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
191
|
-
},
|
|
192
|
-
focusSelected: {
|
|
193
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
194
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
warning: {
|
|
198
|
-
focus: {
|
|
199
|
-
light: "var(--ds-border-focused, ".concat(colors.Y500, ")"),
|
|
200
|
-
dark: "var(--ds-border-focused, ".concat(colors.Y500, ")")
|
|
201
|
-
},
|
|
202
|
-
focusSelected: {
|
|
203
|
-
light: "var(--ds-border-focused, ".concat(colors.Y500, ")"),
|
|
204
|
-
dark: "var(--ds-border-focused, ".concat(colors.Y500, ")")
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
danger: {
|
|
208
|
-
focus: {
|
|
209
|
-
light: "var(--ds-border-focused, ".concat(colors.R100, ")"),
|
|
210
|
-
dark: "var(--ds-border-focused, ".concat(colors.R100, ")")
|
|
211
|
-
},
|
|
212
|
-
focusSelected: {
|
|
213
|
-
light: "var(--ds-border-focused, ".concat(colors.R100, ")"),
|
|
214
|
-
dark: "var(--ds-border-focused, ".concat(colors.R100, ")")
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
link: {
|
|
218
|
-
focus: {
|
|
219
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
220
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
221
|
-
},
|
|
222
|
-
focusSelected: {
|
|
223
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
224
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
subtle: {
|
|
228
|
-
focus: {
|
|
229
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
230
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
231
|
-
},
|
|
232
|
-
focusSelected: {
|
|
233
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
234
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
'subtle-link': {
|
|
238
|
-
focus: {
|
|
239
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
240
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
241
|
-
},
|
|
242
|
-
focusSelected: {
|
|
243
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
244
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
176
|
color: {
|
|
249
177
|
default: {
|
|
250
178
|
default: {
|
package/dist/cjs/shared/css.js
CHANGED
|
@@ -143,17 +143,6 @@ function getCss(_ref3) {
|
|
|
143
143
|
// background, box-shadow
|
|
144
144
|
transitionDuration: '0s, 0.15s'
|
|
145
145
|
}),
|
|
146
|
-
'&:focus': _objectSpread(_objectSpread({}, getColors({
|
|
147
|
-
appearance: appearance,
|
|
148
|
-
key: isSelected ? 'focusSelected' : 'focus',
|
|
149
|
-
mode: mode
|
|
150
|
-
})), {}, {
|
|
151
|
-
boxShadow: "0 0 0 2px ".concat(_colors.default.boxShadowColor[appearance].focus[mode]),
|
|
152
|
-
// background, box-shadow
|
|
153
|
-
transitionDuration: '0s, 0.2s',
|
|
154
|
-
// disabling browser focus outline
|
|
155
|
-
outline: 'none'
|
|
156
|
-
}),
|
|
157
146
|
// giving active styles preference by listing them after focus
|
|
158
147
|
'&:active': _objectSpread(_objectSpread({}, getColors({
|
|
159
148
|
appearance: appearance,
|
|
@@ -207,9 +196,9 @@ function getIconStyle(_ref4) {
|
|
|
207
196
|
var spacing = _ref4.spacing;
|
|
208
197
|
return (0, _react.css)({
|
|
209
198
|
display: 'flex',
|
|
199
|
+
// icon size cannot grow and shrink
|
|
210
200
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
211
201
|
margin: spacing === 'none' ? 0 : innerMargin.icon,
|
|
212
|
-
// icon size cannot grow and shrink
|
|
213
202
|
flexGrow: 0,
|
|
214
203
|
flexShrink: 0,
|
|
215
204
|
alignSelf: 'center',
|
package/dist/cjs/version.json
CHANGED
|
@@ -69,7 +69,7 @@ export function getCustomCss({
|
|
|
69
69
|
// To do this we are overwriting all pseudo selectors
|
|
70
70
|
export function getSpecifiers(styles) {
|
|
71
71
|
return {
|
|
72
|
-
'&, &:hover, &:active, &:focus, &:visited, &:disabled, &[disabled]': styles
|
|
72
|
+
'&, &:hover, &:active, &:focus, &:focus-visible, &:visited, &:disabled, &[disabled]': styles
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
export function defaultThemeFn(current, values) {
|
|
@@ -5,6 +5,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
5
5
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
6
6
|
import noop from '@atlaskit/ds-lib/noop';
|
|
7
7
|
import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
|
|
8
|
+
import FocusRing from '@atlaskit/focus-ring';
|
|
8
9
|
// eslint-disable-next-line no-duplicate-imports
|
|
9
10
|
import InteractionContext from '@atlaskit/interaction-context';
|
|
10
11
|
import { N500 } from '@atlaskit/theme/colors';
|
|
@@ -75,7 +76,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
75
76
|
action: 'clicked',
|
|
76
77
|
componentName: 'button',
|
|
77
78
|
packageName: "@atlaskit/button",
|
|
78
|
-
packageVersion: "16.
|
|
79
|
+
packageVersion: "16.6.1",
|
|
79
80
|
analyticsData: analyticsContext
|
|
80
81
|
});
|
|
81
82
|
|
|
@@ -113,7 +114,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
113
114
|
}
|
|
114
115
|
};
|
|
115
116
|
}
|
|
116
|
-
return jsx(Component, _extends({}, rest, {
|
|
117
|
+
return jsx(FocusRing, null, jsx(Component, _extends({}, rest, {
|
|
117
118
|
css: [buttonCss, isInteractive ? null : noPointerEventsOnChildrenCss],
|
|
118
119
|
className: className,
|
|
119
120
|
ref: setRef,
|
|
@@ -147,5 +148,5 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
147
148
|
})]
|
|
148
149
|
}, iconAfter) : null, overlay ? jsx("span", {
|
|
149
150
|
css: [overlayCss, spinnerHackCss]
|
|
150
|
-
}, overlay) : null);
|
|
151
|
+
}, overlay) : null));
|
|
151
152
|
});
|
|
@@ -164,78 +164,6 @@ const values = {
|
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
},
|
|
167
|
-
boxShadowColor: {
|
|
168
|
-
default: {
|
|
169
|
-
focus: {
|
|
170
|
-
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
171
|
-
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
172
|
-
},
|
|
173
|
-
focusSelected: {
|
|
174
|
-
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
175
|
-
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
primary: {
|
|
179
|
-
focus: {
|
|
180
|
-
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
181
|
-
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
182
|
-
},
|
|
183
|
-
focusSelected: {
|
|
184
|
-
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
185
|
-
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
warning: {
|
|
189
|
-
focus: {
|
|
190
|
-
light: `var(--ds-border-focused, ${colors.Y500})`,
|
|
191
|
-
dark: `var(--ds-border-focused, ${colors.Y500})`
|
|
192
|
-
},
|
|
193
|
-
focusSelected: {
|
|
194
|
-
light: `var(--ds-border-focused, ${colors.Y500})`,
|
|
195
|
-
dark: `var(--ds-border-focused, ${colors.Y500})`
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
danger: {
|
|
199
|
-
focus: {
|
|
200
|
-
light: `var(--ds-border-focused, ${colors.R100})`,
|
|
201
|
-
dark: `var(--ds-border-focused, ${colors.R100})`
|
|
202
|
-
},
|
|
203
|
-
focusSelected: {
|
|
204
|
-
light: `var(--ds-border-focused, ${colors.R100})`,
|
|
205
|
-
dark: `var(--ds-border-focused, ${colors.R100})`
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
link: {
|
|
209
|
-
focus: {
|
|
210
|
-
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
211
|
-
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
212
|
-
},
|
|
213
|
-
focusSelected: {
|
|
214
|
-
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
215
|
-
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
216
|
-
}
|
|
217
|
-
},
|
|
218
|
-
subtle: {
|
|
219
|
-
focus: {
|
|
220
|
-
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
221
|
-
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
222
|
-
},
|
|
223
|
-
focusSelected: {
|
|
224
|
-
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
225
|
-
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
226
|
-
}
|
|
227
|
-
},
|
|
228
|
-
'subtle-link': {
|
|
229
|
-
focus: {
|
|
230
|
-
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
231
|
-
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
232
|
-
},
|
|
233
|
-
focusSelected: {
|
|
234
|
-
light: `var(--ds-border-focused, ${colors.B100})`,
|
|
235
|
-
dark: `var(--ds-border-focused, ${colors.B75})`
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
167
|
color: {
|
|
240
168
|
default: {
|
|
241
169
|
default: {
|
|
@@ -136,18 +136,6 @@ export function getCss({
|
|
|
136
136
|
// background, box-shadow
|
|
137
137
|
transitionDuration: '0s, 0.15s'
|
|
138
138
|
},
|
|
139
|
-
'&:focus': {
|
|
140
|
-
...getColors({
|
|
141
|
-
appearance,
|
|
142
|
-
key: isSelected ? 'focusSelected' : 'focus',
|
|
143
|
-
mode
|
|
144
|
-
}),
|
|
145
|
-
boxShadow: `0 0 0 2px ${colors.boxShadowColor[appearance].focus[mode]}`,
|
|
146
|
-
// background, box-shadow
|
|
147
|
-
transitionDuration: '0s, 0.2s',
|
|
148
|
-
// disabling browser focus outline
|
|
149
|
-
outline: 'none'
|
|
150
|
-
},
|
|
151
139
|
// giving active styles preference by listing them after focus
|
|
152
140
|
'&:active': {
|
|
153
141
|
...getColors({
|
|
@@ -208,9 +196,9 @@ export function getIconStyle({
|
|
|
208
196
|
}) {
|
|
209
197
|
return css({
|
|
210
198
|
display: 'flex',
|
|
199
|
+
// icon size cannot grow and shrink
|
|
211
200
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
212
201
|
margin: spacing === 'none' ? 0 : innerMargin.icon,
|
|
213
|
-
// icon size cannot grow and shrink
|
|
214
202
|
flexGrow: 0,
|
|
215
203
|
flexShrink: 0,
|
|
216
204
|
alignSelf: 'center',
|
package/dist/es2019/version.json
CHANGED
|
@@ -71,7 +71,7 @@ export function getCustomCss(_ref) {
|
|
|
71
71
|
// To do this we are overwriting all pseudo selectors
|
|
72
72
|
export function getSpecifiers(styles) {
|
|
73
73
|
return {
|
|
74
|
-
'&, &:hover, &:active, &:focus, &:visited, &:disabled, &[disabled]': styles
|
|
74
|
+
'&, &:hover, &:active, &:focus, &:focus-visible, &:visited, &:disabled, &[disabled]': styles
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
export function defaultThemeFn(current, values) {
|
|
@@ -7,6 +7,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
7
7
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
8
8
|
import noop from '@atlaskit/ds-lib/noop';
|
|
9
9
|
import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
|
|
10
|
+
import FocusRing from '@atlaskit/focus-ring';
|
|
10
11
|
// eslint-disable-next-line no-duplicate-imports
|
|
11
12
|
import InteractionContext from '@atlaskit/interaction-context';
|
|
12
13
|
import { N500 } from '@atlaskit/theme/colors';
|
|
@@ -83,7 +84,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
83
84
|
action: 'clicked',
|
|
84
85
|
componentName: 'button',
|
|
85
86
|
packageName: "@atlaskit/button",
|
|
86
|
-
packageVersion: "16.
|
|
87
|
+
packageVersion: "16.6.1",
|
|
87
88
|
analyticsData: analyticsContext
|
|
88
89
|
});
|
|
89
90
|
|
|
@@ -121,7 +122,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
121
122
|
}
|
|
122
123
|
};
|
|
123
124
|
}
|
|
124
|
-
return jsx(Component, _extends({}, rest, {
|
|
125
|
+
return jsx(FocusRing, null, jsx(Component, _extends({}, rest, {
|
|
125
126
|
css: [buttonCss, isInteractive ? null : noPointerEventsOnChildrenCss],
|
|
126
127
|
className: className,
|
|
127
128
|
ref: setRef,
|
|
@@ -155,5 +156,5 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
155
156
|
})]
|
|
156
157
|
}, iconAfter) : null, overlay ? jsx("span", {
|
|
157
158
|
css: [overlayCss, spinnerHackCss]
|
|
158
|
-
}, overlay) : null);
|
|
159
|
+
}, overlay) : null));
|
|
159
160
|
});
|
|
@@ -164,78 +164,6 @@ var values = {
|
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
},
|
|
167
|
-
boxShadowColor: {
|
|
168
|
-
default: {
|
|
169
|
-
focus: {
|
|
170
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
171
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
172
|
-
},
|
|
173
|
-
focusSelected: {
|
|
174
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
175
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
primary: {
|
|
179
|
-
focus: {
|
|
180
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
181
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
182
|
-
},
|
|
183
|
-
focusSelected: {
|
|
184
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
185
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
warning: {
|
|
189
|
-
focus: {
|
|
190
|
-
light: "var(--ds-border-focused, ".concat(colors.Y500, ")"),
|
|
191
|
-
dark: "var(--ds-border-focused, ".concat(colors.Y500, ")")
|
|
192
|
-
},
|
|
193
|
-
focusSelected: {
|
|
194
|
-
light: "var(--ds-border-focused, ".concat(colors.Y500, ")"),
|
|
195
|
-
dark: "var(--ds-border-focused, ".concat(colors.Y500, ")")
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
danger: {
|
|
199
|
-
focus: {
|
|
200
|
-
light: "var(--ds-border-focused, ".concat(colors.R100, ")"),
|
|
201
|
-
dark: "var(--ds-border-focused, ".concat(colors.R100, ")")
|
|
202
|
-
},
|
|
203
|
-
focusSelected: {
|
|
204
|
-
light: "var(--ds-border-focused, ".concat(colors.R100, ")"),
|
|
205
|
-
dark: "var(--ds-border-focused, ".concat(colors.R100, ")")
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
link: {
|
|
209
|
-
focus: {
|
|
210
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
211
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
212
|
-
},
|
|
213
|
-
focusSelected: {
|
|
214
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
215
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
216
|
-
}
|
|
217
|
-
},
|
|
218
|
-
subtle: {
|
|
219
|
-
focus: {
|
|
220
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
221
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
222
|
-
},
|
|
223
|
-
focusSelected: {
|
|
224
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
225
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
226
|
-
}
|
|
227
|
-
},
|
|
228
|
-
'subtle-link': {
|
|
229
|
-
focus: {
|
|
230
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
231
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
232
|
-
},
|
|
233
|
-
focusSelected: {
|
|
234
|
-
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
235
|
-
dark: "var(--ds-border-focused, ".concat(colors.B75, ")")
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
167
|
color: {
|
|
240
168
|
default: {
|
|
241
169
|
default: {
|
package/dist/esm/shared/css.js
CHANGED
|
@@ -132,17 +132,6 @@ export function getCss(_ref3) {
|
|
|
132
132
|
// background, box-shadow
|
|
133
133
|
transitionDuration: '0s, 0.15s'
|
|
134
134
|
}),
|
|
135
|
-
'&:focus': _objectSpread(_objectSpread({}, getColors({
|
|
136
|
-
appearance: appearance,
|
|
137
|
-
key: isSelected ? 'focusSelected' : 'focus',
|
|
138
|
-
mode: mode
|
|
139
|
-
})), {}, {
|
|
140
|
-
boxShadow: "0 0 0 2px ".concat(colors.boxShadowColor[appearance].focus[mode]),
|
|
141
|
-
// background, box-shadow
|
|
142
|
-
transitionDuration: '0s, 0.2s',
|
|
143
|
-
// disabling browser focus outline
|
|
144
|
-
outline: 'none'
|
|
145
|
-
}),
|
|
146
135
|
// giving active styles preference by listing them after focus
|
|
147
136
|
'&:active': _objectSpread(_objectSpread({}, getColors({
|
|
148
137
|
appearance: appearance,
|
|
@@ -196,9 +185,9 @@ export function getIconStyle(_ref4) {
|
|
|
196
185
|
var spacing = _ref4.spacing;
|
|
197
186
|
return css({
|
|
198
187
|
display: 'flex',
|
|
188
|
+
// icon size cannot grow and shrink
|
|
199
189
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
200
190
|
margin: spacing === 'none' ? 0 : innerMargin.icon,
|
|
201
|
-
// icon size cannot grow and shrink
|
|
202
191
|
flexGrow: 0,
|
|
203
192
|
flexShrink: 0,
|
|
204
193
|
alignSelf: 'center',
|
package/dist/esm/version.json
CHANGED
|
@@ -15,16 +15,8 @@ export declare type ColorGroup = {
|
|
|
15
15
|
export declare type ColorPreset = {
|
|
16
16
|
[key in Appearance]: ColorGroup;
|
|
17
17
|
};
|
|
18
|
-
export declare type BoxShadowColorGroup = {
|
|
19
|
-
focus: ColorRule;
|
|
20
|
-
focusSelected: ColorRule;
|
|
21
|
-
};
|
|
22
|
-
declare type BoxShadowColorPreset = {
|
|
23
|
-
[key in Appearance]: BoxShadowColorGroup;
|
|
24
|
-
};
|
|
25
18
|
declare type Values = {
|
|
26
19
|
background: ColorPreset;
|
|
27
|
-
boxShadowColor: BoxShadowColorPreset;
|
|
28
20
|
color: ColorPreset;
|
|
29
21
|
};
|
|
30
22
|
declare const values: Values;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/button",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.6.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/"
|
|
@@ -33,9 +33,10 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/analytics-next": "^9.0.0",
|
|
35
35
|
"@atlaskit/ds-lib": "^2.1.0",
|
|
36
|
+
"@atlaskit/focus-ring": "^1.0.6",
|
|
36
37
|
"@atlaskit/interaction-context": "^2.0.0",
|
|
37
38
|
"@atlaskit/spinner": "^15.4.0",
|
|
38
|
-
"@atlaskit/theme": "^12.
|
|
39
|
+
"@atlaskit/theme": "^12.4.0",
|
|
39
40
|
"@atlaskit/tokens": "^1.2.0",
|
|
40
41
|
"@babel/runtime": "^7.0.0",
|
|
41
42
|
"@emotion/react": "^11.7.1"
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
"@atlaskit/checkbox": "^12.4.0",
|
|
48
49
|
"@atlaskit/docs": "*",
|
|
49
50
|
"@atlaskit/icon": "^21.11.0",
|
|
50
|
-
"@atlaskit/logo": "^13.
|
|
51
|
+
"@atlaskit/logo": "^13.13.0",
|
|
51
52
|
"@atlaskit/section-message": "^6.3.0",
|
|
52
53
|
"@atlaskit/select": "^16.1.0",
|
|
53
54
|
"@atlaskit/ssr": "*",
|