@atlaskit/status 1.2.1 → 1.2.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 +12 -0
- package/dist/cjs/components/Status.js +20 -9
- package/dist/cjs/components/analytics.js +1 -1
- package/dist/cjs/components/internal/color-palette.js +5 -4
- package/dist/cjs/components/internal/color.js +3 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/Status.js +20 -3
- package/dist/es2019/components/analytics.js +1 -1
- package/dist/es2019/components/internal/color-palette.js +4 -4
- package/dist/es2019/components/internal/color.js +3 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/Status.js +19 -3
- package/dist/esm/components/analytics.js +1 -1
- package/dist/esm/components/internal/color-palette.js +6 -5
- package/dist/esm/components/internal/color.js +3 -3
- package/dist/esm/version.json +1 -1
- package/dist/types/components/Status.d.ts +2 -2
- package/dist/types/components/internal/color.d.ts +1 -0
- package/package.json +1 -1
- package/report.api.md +13 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/status
|
|
2
2
|
|
|
3
|
+
## 1.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a6900fd8727`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a6900fd8727) - DSP-6671 - Separates icon and border color and adds semantic tokens to status color palette. Updated appearances only visible in applications configured to use the new Tokens API (currently in alpha).
|
|
8
|
+
|
|
9
|
+
## 1.2.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`5d2eeac35f7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5d2eeac35f7) - Fixes a browser specific bug that occurred in android chromium that led to the component losing focus unexpectedly when selected for editing.
|
|
14
|
+
|
|
3
15
|
## 1.2.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -23,7 +21,9 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
23
21
|
|
|
24
22
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
23
|
|
|
26
|
-
var _react =
|
|
24
|
+
var _react = require("react");
|
|
25
|
+
|
|
26
|
+
var _react2 = require("@emotion/react");
|
|
27
27
|
|
|
28
28
|
var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
|
|
29
29
|
|
|
@@ -33,10 +33,6 @@ var _analytics = require("./analytics");
|
|
|
33
33
|
|
|
34
34
|
var _constants = require("./constants");
|
|
35
35
|
|
|
36
|
-
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); }
|
|
37
|
-
|
|
38
|
-
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; }
|
|
39
|
-
|
|
40
36
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
41
37
|
|
|
42
38
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -54,6 +50,20 @@ var colorToLozengeAppearanceMap = {
|
|
|
54
50
|
|
|
55
51
|
var DEFAULT_APPEARANCE = 'default';
|
|
56
52
|
var MAX_WIDTH = 200;
|
|
53
|
+
/**
|
|
54
|
+
* This is to account for a bug in android chromium and should be removed
|
|
55
|
+
* when the editor fixes its focus handling with respect to Status.
|
|
56
|
+
*
|
|
57
|
+
* See DSP-7701 for additional context.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
var inlineBlockStyles = (0, _react2.css)({
|
|
61
|
+
'& > *': {
|
|
62
|
+
display: 'inline-block !important'
|
|
63
|
+
}
|
|
64
|
+
}); // eg. Version/4.0 Chrome/95.0.4638.50
|
|
65
|
+
|
|
66
|
+
var isAndroidChromium = typeof window !== 'undefined' && /Version\/.* Chrome\/.*/.test(window.navigator.userAgent);
|
|
57
67
|
|
|
58
68
|
var StatusInternal = /*#__PURE__*/function (_PureComponent) {
|
|
59
69
|
(0, _inherits2.default)(StatusInternal, _PureComponent);
|
|
@@ -109,7 +119,8 @@ var StatusInternal = /*#__PURE__*/function (_PureComponent) {
|
|
|
109
119
|
|
|
110
120
|
var appearance = colorToLozengeAppearanceMap[color] || DEFAULT_APPEARANCE; // Note: ommitted data-local-id attribute to avoid copying/pasting the same localId
|
|
111
121
|
|
|
112
|
-
return
|
|
122
|
+
return (0, _react2.jsx)("span", {
|
|
123
|
+
css: isAndroidChromium ? inlineBlockStyles : undefined,
|
|
113
124
|
className: "status-lozenge-span",
|
|
114
125
|
onClick: onClick,
|
|
115
126
|
onMouseEnter: this.handleMouseEnter,
|
|
@@ -118,7 +129,7 @@ var StatusInternal = /*#__PURE__*/function (_PureComponent) {
|
|
|
118
129
|
"data-color": color,
|
|
119
130
|
"data-style": style,
|
|
120
131
|
role: role
|
|
121
|
-
},
|
|
132
|
+
}, (0, _react2.jsx)(_lozenge.default, {
|
|
122
133
|
appearance: appearance,
|
|
123
134
|
maxWidth: MAX_WIDTH
|
|
124
135
|
}, text));
|
|
@@ -16,7 +16,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
16
16
|
var ELEMENTS_CHANNEL = 'fabric-elements';
|
|
17
17
|
exports.ELEMENTS_CHANNEL = ELEMENTS_CHANNEL;
|
|
18
18
|
var packageName = "@atlaskit/status";
|
|
19
|
-
var packageVersion = "1.2.
|
|
19
|
+
var packageVersion = "1.2.3";
|
|
20
20
|
|
|
21
21
|
var createStatusAnalyticsAndFire = function createStatusAnalyticsAndFire(createAnalyticsEvent) {
|
|
22
22
|
return function (payload) {
|
|
@@ -31,8 +31,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
31
31
|
|
|
32
32
|
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; }
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
var palette = [['neutral', (0, _tokens.token)('color.background.neutral', colors.N40), (0, _tokens.token)('color.text', colors.N400)], ['purple', (0, _tokens.token)('color.background.discovery', colors.P50), (0, _tokens.token)('color.text.discovery', colors.P400)], ['blue', (0, _tokens.token)('color.background.information', colors.B50), (0, _tokens.token)('color.text.information', colors.B400)], ['red', (0, _tokens.token)('color.background.danger', colors.R50), (0, _tokens.token)('color.text.danger', colors.R400)], ['yellow', (0, _tokens.token)('color.background.warning', colors.Y50), (0, _tokens.token)('color.text.warning', colors.Y400)], ['green', (0, _tokens.token)('color.background.success', colors.G50), (0, _tokens.token)('color.text.success', colors.G400)]];
|
|
34
|
+
var palette = [['neutral', (0, _tokens.token)('color.background.neutral', colors.N40), (0, _tokens.token)('color.border.bold', colors.N400), (0, _tokens.token)('color.icon', colors.N400)], ['purple', (0, _tokens.token)('color.background.discovery', colors.P50), (0, _tokens.token)('color.border.discovery', colors.P400), (0, _tokens.token)('color.icon.discovery', colors.P400)], ['blue', (0, _tokens.token)('color.background.information', colors.B50), (0, _tokens.token)('color.border.information', colors.B400), (0, _tokens.token)('color.icon.information', colors.B400)], ['red', (0, _tokens.token)('color.background.danger', colors.R50), (0, _tokens.token)('color.border.danger', colors.R400), (0, _tokens.token)('color.icon.danger', colors.R400)], ['yellow', (0, _tokens.token)('color.background.warning', colors.Y50), (0, _tokens.token)('color.border.warning', colors.Y400), (0, _tokens.token)('color.icon.warning', colors.Y400)], ['green', (0, _tokens.token)('color.background.success', colors.G50), (0, _tokens.token)('color.border.success', colors.G400), (0, _tokens.token)('color.icon.success', colors.G400)]];
|
|
36
35
|
var colorPaletteWrapperStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n margin: ", "px ", "px 0 ", "px;\n /* Firefox bug fix: https://product-fabric.atlassian.net/browse/ED-1789 */\n display: flex;\n flex-wrap: wrap;\n"])), (0, _constants.gridSize)(), (0, _constants.gridSize)(), (0, _constants.gridSize)());
|
|
37
36
|
var VK_LEFT = 37; //ArrowLeft
|
|
38
37
|
|
|
@@ -123,16 +122,18 @@ var _default = function _default(_ref) {
|
|
|
123
122
|
},
|
|
124
123
|
onKeyDown: memoizedHandleKeyDown
|
|
125
124
|
}, palette.map(function (_ref4, i) {
|
|
126
|
-
var _ref5 = (0, _slicedToArray2.default)(_ref4,
|
|
125
|
+
var _ref5 = (0, _slicedToArray2.default)(_ref4, 4),
|
|
127
126
|
colorValue = _ref5[0],
|
|
128
127
|
backgroundColor = _ref5[1],
|
|
129
|
-
borderColor = _ref5[2]
|
|
128
|
+
borderColor = _ref5[2],
|
|
129
|
+
iconColor = _ref5[3];
|
|
130
130
|
|
|
131
131
|
return (0, _react2.jsx)(_color.default, {
|
|
132
132
|
key: colorValue,
|
|
133
133
|
value: colorValue,
|
|
134
134
|
backgroundColor: backgroundColor,
|
|
135
135
|
borderColor: borderColor,
|
|
136
|
+
iconColor: iconColor,
|
|
136
137
|
onClick: onClick,
|
|
137
138
|
onHover: onHover,
|
|
138
139
|
isSelected: colorValue === selectedColor,
|
|
@@ -107,9 +107,9 @@ var Color = /*#__PURE__*/function (_PureComponent) {
|
|
|
107
107
|
backgroundColor = _this$props2.backgroundColor,
|
|
108
108
|
isSelected = _this$props2.isSelected,
|
|
109
109
|
borderColor = _this$props2.borderColor,
|
|
110
|
+
iconColor = _this$props2.iconColor,
|
|
110
111
|
value = _this$props2.value,
|
|
111
112
|
setRef = _this$props2.setRef;
|
|
112
|
-
var borderStyle = "1px solid ".concat(borderColor);
|
|
113
113
|
return (0, _react2.jsx)("span", {
|
|
114
114
|
css: buttonWrapperStyles
|
|
115
115
|
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages["".concat(value, "Color")], function (labels) {
|
|
@@ -129,11 +129,11 @@ var Color = /*#__PURE__*/function (_PureComponent) {
|
|
|
129
129
|
"aria-pressed": isSelected,
|
|
130
130
|
style: {
|
|
131
131
|
backgroundColor: backgroundColor || 'transparent',
|
|
132
|
-
|
|
132
|
+
borderColor: borderColor
|
|
133
133
|
},
|
|
134
134
|
ref: setRef
|
|
135
135
|
}, isSelected && (0, _react2.jsx)(_done.default, {
|
|
136
|
-
primaryColor:
|
|
136
|
+
primaryColor: iconColor,
|
|
137
137
|
label: labels[0]
|
|
138
138
|
}));
|
|
139
139
|
}));
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
3
4
|
import { PureComponent } from 'react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
4
6
|
import Lozenge from '@atlaskit/lozenge';
|
|
5
7
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
8
|
import { createStatusAnalyticsAndFire } from './analytics';
|
|
@@ -19,6 +21,20 @@ const colorToLozengeAppearanceMap = {
|
|
|
19
21
|
|
|
20
22
|
const DEFAULT_APPEARANCE = 'default';
|
|
21
23
|
const MAX_WIDTH = 200;
|
|
24
|
+
/**
|
|
25
|
+
* This is to account for a bug in android chromium and should be removed
|
|
26
|
+
* when the editor fixes its focus handling with respect to Status.
|
|
27
|
+
*
|
|
28
|
+
* See DSP-7701 for additional context.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
const inlineBlockStyles = css({
|
|
32
|
+
'& > *': {
|
|
33
|
+
display: 'inline-block !important'
|
|
34
|
+
}
|
|
35
|
+
}); // eg. Version/4.0 Chrome/95.0.4638.50
|
|
36
|
+
|
|
37
|
+
const isAndroidChromium = typeof window !== 'undefined' && /Version\/.* Chrome\/.*/.test(window.navigator.userAgent);
|
|
22
38
|
|
|
23
39
|
class StatusInternal extends PureComponent {
|
|
24
40
|
constructor(...args) {
|
|
@@ -63,7 +79,8 @@ class StatusInternal extends PureComponent {
|
|
|
63
79
|
|
|
64
80
|
const appearance = colorToLozengeAppearanceMap[color] || DEFAULT_APPEARANCE; // Note: ommitted data-local-id attribute to avoid copying/pasting the same localId
|
|
65
81
|
|
|
66
|
-
return
|
|
82
|
+
return jsx("span", {
|
|
83
|
+
css: isAndroidChromium ? inlineBlockStyles : undefined,
|
|
67
84
|
className: "status-lozenge-span",
|
|
68
85
|
onClick: onClick,
|
|
69
86
|
onMouseEnter: this.handleMouseEnter,
|
|
@@ -72,7 +89,7 @@ class StatusInternal extends PureComponent {
|
|
|
72
89
|
"data-color": color,
|
|
73
90
|
"data-style": style,
|
|
74
91
|
role: role
|
|
75
|
-
},
|
|
92
|
+
}, jsx(Lozenge, {
|
|
76
93
|
appearance: appearance,
|
|
77
94
|
maxWidth: MAX_WIDTH
|
|
78
95
|
}, text));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const ELEMENTS_CHANNEL = 'fabric-elements';
|
|
2
2
|
const packageName = "@atlaskit/status";
|
|
3
|
-
const packageVersion = "1.2.
|
|
3
|
+
const packageVersion = "1.2.3";
|
|
4
4
|
export const createStatusAnalyticsAndFire = createAnalyticsEvent => payload => {
|
|
5
5
|
const statusPayload = { ...payload,
|
|
6
6
|
eventType: 'ui'
|
|
@@ -4,9 +4,8 @@ import * as colors from '@atlaskit/theme/colors';
|
|
|
4
4
|
import { token } from '@atlaskit/tokens';
|
|
5
5
|
import React, { useEffect, useRef, useCallback } from 'react';
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
|
-
import Color from './color';
|
|
8
|
-
|
|
9
|
-
const palette = [['neutral', token('color.background.neutral', colors.N40), token('color.text', colors.N400)], ['purple', token('color.background.discovery', colors.P50), token('color.text.discovery', colors.P400)], ['blue', token('color.background.information', colors.B50), token('color.text.information', colors.B400)], ['red', token('color.background.danger', colors.R50), token('color.text.danger', colors.R400)], ['yellow', token('color.background.warning', colors.Y50), token('color.text.warning', colors.Y400)], ['green', token('color.background.success', colors.G50), token('color.text.success', colors.G400)]];
|
|
7
|
+
import Color from './color';
|
|
8
|
+
const palette = [['neutral', token('color.background.neutral', colors.N40), token('color.border.bold', colors.N400), token('color.icon', colors.N400)], ['purple', token('color.background.discovery', colors.P50), token('color.border.discovery', colors.P400), token('color.icon.discovery', colors.P400)], ['blue', token('color.background.information', colors.B50), token('color.border.information', colors.B400), token('color.icon.information', colors.B400)], ['red', token('color.background.danger', colors.R50), token('color.border.danger', colors.R400), token('color.icon.danger', colors.R400)], ['yellow', token('color.background.warning', colors.Y50), token('color.border.warning', colors.Y400), token('color.icon.warning', colors.Y400)], ['green', token('color.background.success', colors.G50), token('color.border.success', colors.G400), token('color.icon.success', colors.G400)]];
|
|
10
9
|
const colorPaletteWrapperStyles = css`
|
|
11
10
|
margin: ${gridSize()}px ${gridSize()}px 0 ${gridSize()}px;
|
|
12
11
|
/* Firefox bug fix: https://product-fabric.atlassian.net/browse/ED-1789 */
|
|
@@ -91,12 +90,13 @@ export default (({
|
|
|
91
90
|
maxWidth: cols * 32
|
|
92
91
|
},
|
|
93
92
|
onKeyDown: memoizedHandleKeyDown
|
|
94
|
-
}, palette.map(([colorValue, backgroundColor, borderColor], i) => {
|
|
93
|
+
}, palette.map(([colorValue, backgroundColor, borderColor, iconColor], i) => {
|
|
95
94
|
return jsx(Color, {
|
|
96
95
|
key: colorValue,
|
|
97
96
|
value: colorValue,
|
|
98
97
|
backgroundColor: backgroundColor,
|
|
99
98
|
borderColor: borderColor,
|
|
99
|
+
iconColor: iconColor,
|
|
100
100
|
onClick: onClick,
|
|
101
101
|
onHover: onHover,
|
|
102
102
|
isSelected: colorValue === selectedColor,
|
|
@@ -76,10 +76,10 @@ export default class Color extends PureComponent {
|
|
|
76
76
|
backgroundColor,
|
|
77
77
|
isSelected,
|
|
78
78
|
borderColor,
|
|
79
|
+
iconColor,
|
|
79
80
|
value,
|
|
80
81
|
setRef
|
|
81
82
|
} = this.props;
|
|
82
|
-
const borderStyle = `1px solid ${borderColor}`;
|
|
83
83
|
return jsx("span", {
|
|
84
84
|
css: buttonWrapperStyles
|
|
85
85
|
}, jsx(FormattedMessage, messages[`${value}Color`], labels => jsx("button", {
|
|
@@ -98,11 +98,11 @@ export default class Color extends PureComponent {
|
|
|
98
98
|
"aria-pressed": isSelected,
|
|
99
99
|
style: {
|
|
100
100
|
backgroundColor: backgroundColor || 'transparent',
|
|
101
|
-
|
|
101
|
+
borderColor
|
|
102
102
|
},
|
|
103
103
|
ref: setRef
|
|
104
104
|
}, isSelected && jsx(EditorDoneIcon, {
|
|
105
|
-
primaryColor:
|
|
105
|
+
primaryColor: iconColor,
|
|
106
106
|
label: labels[0]
|
|
107
107
|
}))));
|
|
108
108
|
}
|
package/dist/es2019/version.json
CHANGED
|
@@ -10,8 +10,9 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
10
|
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
/** @jsx jsx */
|
|
14
14
|
import { PureComponent } from 'react';
|
|
15
|
+
import { css, jsx } from '@emotion/react';
|
|
15
16
|
import Lozenge from '@atlaskit/lozenge';
|
|
16
17
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
17
18
|
import { createStatusAnalyticsAndFire } from './analytics';
|
|
@@ -30,6 +31,20 @@ var colorToLozengeAppearanceMap = {
|
|
|
30
31
|
|
|
31
32
|
var DEFAULT_APPEARANCE = 'default';
|
|
32
33
|
var MAX_WIDTH = 200;
|
|
34
|
+
/**
|
|
35
|
+
* This is to account for a bug in android chromium and should be removed
|
|
36
|
+
* when the editor fixes its focus handling with respect to Status.
|
|
37
|
+
*
|
|
38
|
+
* See DSP-7701 for additional context.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
var inlineBlockStyles = css({
|
|
42
|
+
'& > *': {
|
|
43
|
+
display: 'inline-block !important'
|
|
44
|
+
}
|
|
45
|
+
}); // eg. Version/4.0 Chrome/95.0.4638.50
|
|
46
|
+
|
|
47
|
+
var isAndroidChromium = typeof window !== 'undefined' && /Version\/.* Chrome\/.*/.test(window.navigator.userAgent);
|
|
33
48
|
|
|
34
49
|
var StatusInternal = /*#__PURE__*/function (_PureComponent) {
|
|
35
50
|
_inherits(StatusInternal, _PureComponent);
|
|
@@ -89,7 +104,8 @@ var StatusInternal = /*#__PURE__*/function (_PureComponent) {
|
|
|
89
104
|
|
|
90
105
|
var appearance = colorToLozengeAppearanceMap[color] || DEFAULT_APPEARANCE; // Note: ommitted data-local-id attribute to avoid copying/pasting the same localId
|
|
91
106
|
|
|
92
|
-
return
|
|
107
|
+
return jsx("span", {
|
|
108
|
+
css: isAndroidChromium ? inlineBlockStyles : undefined,
|
|
93
109
|
className: "status-lozenge-span",
|
|
94
110
|
onClick: onClick,
|
|
95
111
|
onMouseEnter: this.handleMouseEnter,
|
|
@@ -98,7 +114,7 @@ var StatusInternal = /*#__PURE__*/function (_PureComponent) {
|
|
|
98
114
|
"data-color": color,
|
|
99
115
|
"data-style": style,
|
|
100
116
|
role: role
|
|
101
|
-
},
|
|
117
|
+
}, jsx(Lozenge, {
|
|
102
118
|
appearance: appearance,
|
|
103
119
|
maxWidth: MAX_WIDTH
|
|
104
120
|
}, text));
|
|
@@ -6,7 +6,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
6
6
|
|
|
7
7
|
export var ELEMENTS_CHANNEL = 'fabric-elements';
|
|
8
8
|
var packageName = "@atlaskit/status";
|
|
9
|
-
var packageVersion = "1.2.
|
|
9
|
+
var packageVersion = "1.2.3";
|
|
10
10
|
export var createStatusAnalyticsAndFire = function createStatusAnalyticsAndFire(createAnalyticsEvent) {
|
|
11
11
|
return function (payload) {
|
|
12
12
|
var statusPayload = _objectSpread(_objectSpread({}, payload), {}, {
|
|
@@ -9,9 +9,8 @@ import * as colors from '@atlaskit/theme/colors';
|
|
|
9
9
|
import { token } from '@atlaskit/tokens';
|
|
10
10
|
import React, { useEffect, useRef, useCallback } from 'react';
|
|
11
11
|
import { css, jsx } from '@emotion/react';
|
|
12
|
-
import Color from './color';
|
|
13
|
-
|
|
14
|
-
var palette = [['neutral', token('color.background.neutral', colors.N40), token('color.text', colors.N400)], ['purple', token('color.background.discovery', colors.P50), token('color.text.discovery', colors.P400)], ['blue', token('color.background.information', colors.B50), token('color.text.information', colors.B400)], ['red', token('color.background.danger', colors.R50), token('color.text.danger', colors.R400)], ['yellow', token('color.background.warning', colors.Y50), token('color.text.warning', colors.Y400)], ['green', token('color.background.success', colors.G50), token('color.text.success', colors.G400)]];
|
|
12
|
+
import Color from './color';
|
|
13
|
+
var palette = [['neutral', token('color.background.neutral', colors.N40), token('color.border.bold', colors.N400), token('color.icon', colors.N400)], ['purple', token('color.background.discovery', colors.P50), token('color.border.discovery', colors.P400), token('color.icon.discovery', colors.P400)], ['blue', token('color.background.information', colors.B50), token('color.border.information', colors.B400), token('color.icon.information', colors.B400)], ['red', token('color.background.danger', colors.R50), token('color.border.danger', colors.R400), token('color.icon.danger', colors.R400)], ['yellow', token('color.background.warning', colors.Y50), token('color.border.warning', colors.Y400), token('color.icon.warning', colors.Y400)], ['green', token('color.background.success', colors.G50), token('color.border.success', colors.G400), token('color.icon.success', colors.G400)]];
|
|
15
14
|
var colorPaletteWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: ", "px ", "px 0 ", "px;\n /* Firefox bug fix: https://product-fabric.atlassian.net/browse/ED-1789 */\n display: flex;\n flex-wrap: wrap;\n"])), gridSize(), gridSize(), gridSize());
|
|
16
15
|
var VK_LEFT = 37; //ArrowLeft
|
|
17
16
|
|
|
@@ -101,16 +100,18 @@ export default (function (_ref) {
|
|
|
101
100
|
},
|
|
102
101
|
onKeyDown: memoizedHandleKeyDown
|
|
103
102
|
}, palette.map(function (_ref4, i) {
|
|
104
|
-
var _ref5 = _slicedToArray(_ref4,
|
|
103
|
+
var _ref5 = _slicedToArray(_ref4, 4),
|
|
105
104
|
colorValue = _ref5[0],
|
|
106
105
|
backgroundColor = _ref5[1],
|
|
107
|
-
borderColor = _ref5[2]
|
|
106
|
+
borderColor = _ref5[2],
|
|
107
|
+
iconColor = _ref5[3];
|
|
108
108
|
|
|
109
109
|
return jsx(Color, {
|
|
110
110
|
key: colorValue,
|
|
111
111
|
value: colorValue,
|
|
112
112
|
backgroundColor: backgroundColor,
|
|
113
113
|
borderColor: borderColor,
|
|
114
|
+
iconColor: iconColor,
|
|
114
115
|
onClick: onClick,
|
|
115
116
|
onHover: onHover,
|
|
116
117
|
isSelected: colorValue === selectedColor,
|
|
@@ -84,9 +84,9 @@ var Color = /*#__PURE__*/function (_PureComponent) {
|
|
|
84
84
|
backgroundColor = _this$props2.backgroundColor,
|
|
85
85
|
isSelected = _this$props2.isSelected,
|
|
86
86
|
borderColor = _this$props2.borderColor,
|
|
87
|
+
iconColor = _this$props2.iconColor,
|
|
87
88
|
value = _this$props2.value,
|
|
88
89
|
setRef = _this$props2.setRef;
|
|
89
|
-
var borderStyle = "1px solid ".concat(borderColor);
|
|
90
90
|
return jsx("span", {
|
|
91
91
|
css: buttonWrapperStyles
|
|
92
92
|
}, jsx(FormattedMessage, messages["".concat(value, "Color")], function (labels) {
|
|
@@ -106,11 +106,11 @@ var Color = /*#__PURE__*/function (_PureComponent) {
|
|
|
106
106
|
"aria-pressed": isSelected,
|
|
107
107
|
style: {
|
|
108
108
|
backgroundColor: backgroundColor || 'transparent',
|
|
109
|
-
|
|
109
|
+
borderColor: borderColor
|
|
110
110
|
},
|
|
111
111
|
ref: setRef
|
|
112
112
|
}, isSelected && jsx(EditorDoneIcon, {
|
|
113
|
-
primaryColor:
|
|
113
|
+
primaryColor: iconColor,
|
|
114
114
|
label: labels[0]
|
|
115
115
|
}));
|
|
116
116
|
}));
|
package/dist/esm/version.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
3
|
export declare type Color = 'neutral' | 'purple' | 'blue' | 'red' | 'yellow' | 'green';
|
|
4
4
|
export declare type StatusStyle = 'bold' | 'subtle';
|
|
@@ -12,4 +12,4 @@ export interface OwnProps {
|
|
|
12
12
|
role?: string;
|
|
13
13
|
}
|
|
14
14
|
export declare type Props = OwnProps & WithAnalyticsEventsProps;
|
|
15
|
-
export declare const Status:
|
|
15
|
+
export declare const Status: import("react").ForwardRefExoticComponent<Omit<Props, keyof WithAnalyticsEventsProps> & import("react").RefAttributes<any>>;
|
|
@@ -9,6 +9,7 @@ export interface ColorProps {
|
|
|
9
9
|
onHover?: (value: ColorType) => void;
|
|
10
10
|
backgroundColor: string;
|
|
11
11
|
borderColor: string;
|
|
12
|
+
iconColor: string;
|
|
12
13
|
setRef?: (value: HTMLButtonElement) => HTMLButtonElement;
|
|
13
14
|
}
|
|
14
15
|
export default class Color extends PureComponent<ColorProps> {
|
package/package.json
CHANGED
package/report.api.md
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
<!-- API Report Version: 2.2 -->
|
|
2
|
+
|
|
1
3
|
## API Report File for "@atlaskit/status"
|
|
2
4
|
|
|
3
|
-
> Do not edit this file.
|
|
5
|
+
> Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
|
|
6
|
+
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
|
+
|
|
8
|
+
### Table of contents
|
|
4
9
|
|
|
5
|
-
|
|
6
|
-
Generated API Report version: 2.0
|
|
7
|
-
-->
|
|
10
|
+
- [Main Entry Types](#main-entry-types)
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
### Main Entry Types
|
|
13
|
+
|
|
14
|
+
<!--SECTION START: Main Entry Types-->
|
|
10
15
|
|
|
11
16
|
```ts
|
|
12
17
|
import { default as React_2 } from 'react';
|
|
@@ -15,7 +20,7 @@ import { WithIntlProps } from 'react-intl-next';
|
|
|
15
20
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
16
21
|
|
|
17
22
|
// @public (undocumented)
|
|
18
|
-
export type Color = '
|
|
23
|
+
export type Color = 'blue' | 'green' | 'neutral' | 'purple' | 'red' | 'yellow';
|
|
19
24
|
|
|
20
25
|
// @public (undocumented)
|
|
21
26
|
type ColorType = Color;
|
|
@@ -78,3 +83,5 @@ export type StatusStyle = 'bold' | 'subtle';
|
|
|
78
83
|
|
|
79
84
|
// (No @packageDocumentation comment for this package)
|
|
80
85
|
```
|
|
86
|
+
|
|
87
|
+
<!--SECTION END: Main Entry Types-->
|