@atlaskit/status 0.11.2 → 1.0.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 +65 -0
- package/dist/cjs/components/Status.js +4 -4
- package/dist/cjs/components/StatusPicker.js +19 -12
- package/dist/cjs/components/analytics.js +2 -2
- package/dist/cjs/components/i18n.js +7 -2
- package/dist/cjs/components/internal/color.js +4 -4
- package/dist/cjs/i18n/index.js +36 -36
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/Status.js +4 -4
- package/dist/es2019/components/StatusPicker.js +12 -5
- package/dist/es2019/components/i18n.js +6 -1
- package/dist/es2019/components/internal/color.js +4 -4
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/Status.js +4 -4
- package/dist/esm/components/StatusPicker.js +18 -11
- package/dist/esm/components/analytics.js +2 -2
- package/dist/esm/components/i18n.js +6 -1
- package/dist/esm/components/internal/color.js +4 -4
- package/dist/esm/version.json +1 -1
- package/dist/types/components/Status.d.ts +2 -1
- package/dist/types/components/StatusPicker.d.ts +5 -12
- package/dist/types/components/i18n.d.ts +37 -2
- package/dist/types/components/internal/color-palette.d.ts +1 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,70 @@
|
|
|
1
1
|
# @atlaskit/status
|
|
2
2
|
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b5375cd4f66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b5375cd4f66) - AK-316: add aria-label for the status picker input field
|
|
8
|
+
- [`85c4e5a71ee`](https://bitbucket.org/atlassian/atlassian-frontend/commits/85c4e5a71ee) - [AK-837] added role prop for Status component
|
|
9
|
+
|
|
10
|
+
## 1.0.0
|
|
11
|
+
|
|
12
|
+
### Major Changes
|
|
13
|
+
|
|
14
|
+
- [`47f58da5946`](https://bitbucket.org/atlassian/atlassian-frontend/commits/47f58da5946) - ED-13322, ED-13324, ED-13326, ED-13323, ED-13204: Upgrade and support react-intl@^5.18.1 including breaking API changes, types and tests in atlassian-frontend packages
|
|
15
|
+
|
|
16
|
+
What changed: Upgraded our react-intl support from ^2.6.0 to ^5.18.1. This means editor packages now rely on consumers installing ^5.18.1, otherwise editor usage of react-intl will mismatch with actual installed react-intl APIs.
|
|
17
|
+
Why change was made: As part of a coordinated upgrade effort across AF packages, as react-intl v2 is quite dated.
|
|
18
|
+
How consumer should update their code: Ensure react-intl ^5.18.1 is installed in consuming applications.
|
|
19
|
+
|
|
20
|
+
Upgrade guide: To consume atlassian-frontend packages that use react-intl5 setup a second provider for the new version, using an npm alias
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
"react-intl": "^2.6.0",
|
|
24
|
+
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import { IntlProvider } from 'react-intl';
|
|
29
|
+
import { IntlProvider as IntlNextProvider } from 'react-intl-next';
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<IntlProvider
|
|
33
|
+
key={locale}
|
|
34
|
+
data-test-language={locale}
|
|
35
|
+
locale={locale}
|
|
36
|
+
defaultLocale={DEFAULT_LOCALE}
|
|
37
|
+
messages={messages}
|
|
38
|
+
>
|
|
39
|
+
<IntlNextProvider
|
|
40
|
+
key={locale}
|
|
41
|
+
data-test-language={locale}
|
|
42
|
+
locale={locale}
|
|
43
|
+
defaultLocale={DEFAULT_LOCALE}
|
|
44
|
+
messages={messages}
|
|
45
|
+
>
|
|
46
|
+
{children}
|
|
47
|
+
</IntlNextProvider>
|
|
48
|
+
</IntlProvider>
|
|
49
|
+
);
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## 0.12.0
|
|
53
|
+
|
|
54
|
+
### Minor Changes
|
|
55
|
+
|
|
56
|
+
- [`42c7ac64c39`](https://bitbucket.org/atlassian/atlassian-frontend/commits/42c7ac64c39) - AK-654 Set a status link label with input
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- [`140df54164a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/140df54164a) - AK-570 Remove redundant title attribute for Status component
|
|
61
|
+
|
|
62
|
+
## 0.11.3
|
|
63
|
+
|
|
64
|
+
### Patch Changes
|
|
65
|
+
|
|
66
|
+
- Updated dependencies
|
|
67
|
+
|
|
3
68
|
## 0.11.2
|
|
4
69
|
|
|
5
70
|
### Patch Changes
|
|
@@ -97,6 +97,7 @@ var StatusInternal = /*#__PURE__*/function (_PureComponent) {
|
|
|
97
97
|
text = _this$props.text,
|
|
98
98
|
color = _this$props.color,
|
|
99
99
|
style = _this$props.style,
|
|
100
|
+
role = _this$props.role,
|
|
100
101
|
onClick = _this$props.onClick;
|
|
101
102
|
|
|
102
103
|
if (text.trim().length === 0) {
|
|
@@ -106,15 +107,14 @@ var StatusInternal = /*#__PURE__*/function (_PureComponent) {
|
|
|
106
107
|
var appearance = colorToLozengeAppearanceMap[color] || DEFAULT_APPEARANCE; // Note: ommitted data-local-id attribute to avoid copying/pasting the same localId
|
|
107
108
|
|
|
108
109
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
109
|
-
className: "status-lozenge-span"
|
|
110
|
-
,
|
|
111
|
-
title: text,
|
|
110
|
+
className: "status-lozenge-span",
|
|
112
111
|
onClick: onClick,
|
|
113
112
|
onMouseEnter: this.handleMouseEnter,
|
|
114
113
|
onMouseLeave: this.handleMouseLeave,
|
|
115
114
|
"data-node-type": "status",
|
|
116
115
|
"data-color": color,
|
|
117
|
-
"data-style": style
|
|
116
|
+
"data-style": style,
|
|
117
|
+
role: role
|
|
118
118
|
}, /*#__PURE__*/_react.default.createElement(_lozenge.default, {
|
|
119
119
|
appearance: appearance,
|
|
120
120
|
maxWidth: MAX_WIDTH
|
|
@@ -31,10 +31,14 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
31
31
|
|
|
32
32
|
var _react = _interopRequireWildcard(require("react"));
|
|
33
33
|
|
|
34
|
+
var _reactIntlNext = require("react-intl-next");
|
|
35
|
+
|
|
34
36
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
35
37
|
|
|
36
38
|
var _colorPalette = _interopRequireDefault(require("./internal/color-palette"));
|
|
37
39
|
|
|
40
|
+
var _i18n = require("./i18n");
|
|
41
|
+
|
|
38
42
|
var _templateObject;
|
|
39
43
|
|
|
40
44
|
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); }
|
|
@@ -47,15 +51,15 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
47
51
|
|
|
48
52
|
var FieldTextWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n margin: 0 ", "px;\n"])), (0, _constants.gridSize)());
|
|
49
53
|
|
|
50
|
-
var
|
|
51
|
-
(0, _inherits2.default)(
|
|
54
|
+
var Picker = /*#__PURE__*/function (_PureComponent) {
|
|
55
|
+
(0, _inherits2.default)(Picker, _PureComponent);
|
|
52
56
|
|
|
53
|
-
var _super = _createSuper(
|
|
57
|
+
var _super = _createSuper(Picker);
|
|
54
58
|
|
|
55
|
-
function
|
|
59
|
+
function Picker() {
|
|
56
60
|
var _this;
|
|
57
61
|
|
|
58
|
-
(0, _classCallCheck2.default)(this,
|
|
62
|
+
(0, _classCallCheck2.default)(this, Picker);
|
|
59
63
|
|
|
60
64
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
61
65
|
args[_key] = arguments[_key];
|
|
@@ -84,14 +88,15 @@ var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
84
88
|
return _this;
|
|
85
89
|
}
|
|
86
90
|
|
|
87
|
-
(0, _createClass2.default)(
|
|
91
|
+
(0, _createClass2.default)(Picker, [{
|
|
88
92
|
key: "render",
|
|
89
93
|
value: function render() {
|
|
90
94
|
var _this$props = this.props,
|
|
91
95
|
text = _this$props.text,
|
|
92
96
|
selectedColor = _this$props.selectedColor,
|
|
93
97
|
onColorClick = _this$props.onColorClick,
|
|
94
|
-
onColorHover = _this$props.onColorHover
|
|
98
|
+
onColorHover = _this$props.onColorHover,
|
|
99
|
+
intl = _this$props.intl; // Using <React.Fragment> instead of [] to workaround Enzyme
|
|
95
100
|
// (https://github.com/airbnb/enzyme/issues/1149)
|
|
96
101
|
|
|
97
102
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(FieldTextWrapper, {
|
|
@@ -103,7 +108,8 @@ var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
103
108
|
onChange: this.onChange,
|
|
104
109
|
onKeyPress: this.onKeyPress,
|
|
105
110
|
spellCheck: false,
|
|
106
|
-
autoComplete: "off"
|
|
111
|
+
autoComplete: "off",
|
|
112
|
+
"aria-label": intl.formatMessage(_i18n.messages.statusInputLabel)
|
|
107
113
|
})), /*#__PURE__*/_react.default.createElement(_colorPalette.default, {
|
|
108
114
|
key: this.colorPaletteKey,
|
|
109
115
|
onClick: onColorClick,
|
|
@@ -112,10 +118,11 @@ var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
112
118
|
}));
|
|
113
119
|
}
|
|
114
120
|
}]);
|
|
115
|
-
return
|
|
121
|
+
return Picker;
|
|
116
122
|
}(_react.PureComponent);
|
|
117
123
|
|
|
118
|
-
|
|
119
|
-
(0, _defineProperty2.default)(StatusPicker, "defaultProps", {
|
|
124
|
+
(0, _defineProperty2.default)(Picker, "defaultProps", {
|
|
120
125
|
autoFocus: true
|
|
121
|
-
});
|
|
126
|
+
});
|
|
127
|
+
var StatusPicker = (0, _reactIntlNext.injectIntl)(Picker);
|
|
128
|
+
exports.StatusPicker = StatusPicker;
|
|
@@ -11,9 +11,9 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
11
11
|
|
|
12
12
|
var _version = require("../version.json");
|
|
13
13
|
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
14
|
+
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; }
|
|
15
15
|
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
16
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
17
17
|
|
|
18
18
|
var ELEMENTS_CHANNEL = 'fabric-elements';
|
|
19
19
|
exports.ELEMENTS_CHANNEL = ELEMENTS_CHANNEL;
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.messages = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _reactIntlNext = require("react-intl-next");
|
|
9
9
|
|
|
10
|
-
var messages = (0,
|
|
10
|
+
var messages = (0, _reactIntlNext.defineMessages)({
|
|
11
11
|
neutralColor: {
|
|
12
12
|
id: 'fabric.status.color.grey',
|
|
13
13
|
defaultMessage: 'Grey',
|
|
@@ -37,6 +37,11 @@ var messages = (0, _reactIntl.defineMessages)({
|
|
|
37
37
|
id: 'fabric.status.color.green',
|
|
38
38
|
defaultMessage: 'Green',
|
|
39
39
|
description: 'Tooltip for the green color in color palette'
|
|
40
|
+
},
|
|
41
|
+
statusInputLabel: {
|
|
42
|
+
id: 'fabric.status.input.label',
|
|
43
|
+
defaultMessage: 'Set a status',
|
|
44
|
+
description: 'Aria label text for the status input field'
|
|
40
45
|
}
|
|
41
46
|
});
|
|
42
47
|
exports.messages = messages;
|
|
@@ -31,7 +31,7 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
31
31
|
|
|
32
32
|
var _react = _interopRequireWildcard(require("react"));
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _reactIntlNext = require("react-intl-next");
|
|
35
35
|
|
|
36
36
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
37
37
|
|
|
@@ -108,7 +108,7 @@ var Color = /*#__PURE__*/function (_PureComponent) {
|
|
|
108
108
|
borderColor = _this$props2.borderColor,
|
|
109
109
|
value = _this$props2.value;
|
|
110
110
|
var borderStyle = "1px solid ".concat(borderColor);
|
|
111
|
-
return /*#__PURE__*/_react.default.createElement(ButtonWrapper, null, /*#__PURE__*/_react.default.createElement(
|
|
111
|
+
return /*#__PURE__*/_react.default.createElement(ButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages["".concat(value, "Color")], function (labels) {
|
|
112
112
|
return /*#__PURE__*/_react.default.createElement(Button, {
|
|
113
113
|
onClick: _this2.onClick,
|
|
114
114
|
onMouseEnter: _this2.onMouseEnter,
|
|
@@ -116,14 +116,14 @@ var Color = /*#__PURE__*/function (_PureComponent) {
|
|
|
116
116
|
onMouseDown: _this2.onMouseDown,
|
|
117
117
|
tabIndex: tabIndex,
|
|
118
118
|
className: "".concat(isSelected ? 'selected' : ''),
|
|
119
|
-
title:
|
|
119
|
+
title: labels[0],
|
|
120
120
|
style: {
|
|
121
121
|
backgroundColor: backgroundColor || 'transparent',
|
|
122
122
|
border: borderStyle
|
|
123
123
|
}
|
|
124
124
|
}, isSelected && /*#__PURE__*/_react.default.createElement(_done.default, {
|
|
125
125
|
primaryColor: borderColor,
|
|
126
|
-
label:
|
|
126
|
+
label: labels[0]
|
|
127
127
|
}));
|
|
128
128
|
}));
|
|
129
129
|
}
|
package/dist/cjs/i18n/index.js
CHANGED
|
@@ -5,34 +5,40 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
Object.defineProperty(exports, "
|
|
8
|
+
Object.defineProperty(exports, "cs", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function get() {
|
|
11
|
-
return
|
|
11
|
+
return _cs.default;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
Object.defineProperty(exports, "
|
|
14
|
+
Object.defineProperty(exports, "da", {
|
|
15
15
|
enumerable: true,
|
|
16
16
|
get: function get() {
|
|
17
|
-
return
|
|
17
|
+
return _da.default;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
Object.defineProperty(exports, "
|
|
20
|
+
Object.defineProperty(exports, "de", {
|
|
21
21
|
enumerable: true,
|
|
22
22
|
get: function get() {
|
|
23
|
-
return
|
|
23
|
+
return _de.default;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
Object.defineProperty(exports, "
|
|
26
|
+
Object.defineProperty(exports, "en", {
|
|
27
27
|
enumerable: true,
|
|
28
28
|
get: function get() {
|
|
29
|
-
return
|
|
29
|
+
return _en.default;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
-
Object.defineProperty(exports, "
|
|
32
|
+
Object.defineProperty(exports, "en_GB", {
|
|
33
33
|
enumerable: true,
|
|
34
34
|
get: function get() {
|
|
35
|
-
return
|
|
35
|
+
return _en_GB.default;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "es", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function get() {
|
|
41
|
+
return _es.default;
|
|
36
42
|
}
|
|
37
43
|
});
|
|
38
44
|
Object.defineProperty(exports, "et", {
|
|
@@ -53,16 +59,16 @@ Object.defineProperty(exports, "fr", {
|
|
|
53
59
|
return _fr.default;
|
|
54
60
|
}
|
|
55
61
|
});
|
|
56
|
-
Object.defineProperty(exports, "
|
|
62
|
+
Object.defineProperty(exports, "hu", {
|
|
57
63
|
enumerable: true,
|
|
58
64
|
get: function get() {
|
|
59
|
-
return
|
|
65
|
+
return _hu.default;
|
|
60
66
|
}
|
|
61
67
|
});
|
|
62
|
-
Object.defineProperty(exports, "
|
|
68
|
+
Object.defineProperty(exports, "is", {
|
|
63
69
|
enumerable: true,
|
|
64
70
|
get: function get() {
|
|
65
|
-
return
|
|
71
|
+
return _is.default;
|
|
66
72
|
}
|
|
67
73
|
});
|
|
68
74
|
Object.defineProperty(exports, "it", {
|
|
@@ -89,6 +95,12 @@ Object.defineProperty(exports, "nb", {
|
|
|
89
95
|
return _nb.default;
|
|
90
96
|
}
|
|
91
97
|
});
|
|
98
|
+
Object.defineProperty(exports, "nl", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function get() {
|
|
101
|
+
return _nl.default;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
92
104
|
Object.defineProperty(exports, "pl", {
|
|
93
105
|
enumerable: true,
|
|
94
106
|
get: function get() {
|
|
@@ -107,22 +119,22 @@ Object.defineProperty(exports, "pt_PT", {
|
|
|
107
119
|
return _pt_PT.default;
|
|
108
120
|
}
|
|
109
121
|
});
|
|
110
|
-
Object.defineProperty(exports, "
|
|
122
|
+
Object.defineProperty(exports, "ro", {
|
|
111
123
|
enumerable: true,
|
|
112
124
|
get: function get() {
|
|
113
|
-
return
|
|
125
|
+
return _ro.default;
|
|
114
126
|
}
|
|
115
127
|
});
|
|
116
|
-
Object.defineProperty(exports, "
|
|
128
|
+
Object.defineProperty(exports, "ru", {
|
|
117
129
|
enumerable: true,
|
|
118
130
|
get: function get() {
|
|
119
|
-
return
|
|
131
|
+
return _ru.default;
|
|
120
132
|
}
|
|
121
133
|
});
|
|
122
|
-
Object.defineProperty(exports, "
|
|
134
|
+
Object.defineProperty(exports, "sk", {
|
|
123
135
|
enumerable: true,
|
|
124
136
|
get: function get() {
|
|
125
|
-
return
|
|
137
|
+
return _sk.default;
|
|
126
138
|
}
|
|
127
139
|
});
|
|
128
140
|
Object.defineProperty(exports, "sv", {
|
|
@@ -155,28 +167,16 @@ Object.defineProperty(exports, "vi", {
|
|
|
155
167
|
return _vi.default;
|
|
156
168
|
}
|
|
157
169
|
});
|
|
158
|
-
Object.defineProperty(exports, "
|
|
159
|
-
enumerable: true,
|
|
160
|
-
get: function get() {
|
|
161
|
-
return _en.default;
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
Object.defineProperty(exports, "en_GB", {
|
|
165
|
-
enumerable: true,
|
|
166
|
-
get: function get() {
|
|
167
|
-
return _en_GB.default;
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
Object.defineProperty(exports, "is", {
|
|
170
|
+
Object.defineProperty(exports, "zh", {
|
|
171
171
|
enumerable: true,
|
|
172
172
|
get: function get() {
|
|
173
|
-
return
|
|
173
|
+
return _zh.default;
|
|
174
174
|
}
|
|
175
175
|
});
|
|
176
|
-
Object.defineProperty(exports, "
|
|
176
|
+
Object.defineProperty(exports, "zh_TW", {
|
|
177
177
|
enumerable: true,
|
|
178
178
|
get: function get() {
|
|
179
|
-
return
|
|
179
|
+
return _zh_TW.default;
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
|
package/dist/cjs/version.json
CHANGED
|
@@ -49,6 +49,7 @@ class StatusInternal extends PureComponent {
|
|
|
49
49
|
text,
|
|
50
50
|
color,
|
|
51
51
|
style,
|
|
52
|
+
role,
|
|
52
53
|
onClick
|
|
53
54
|
} = this.props;
|
|
54
55
|
|
|
@@ -59,15 +60,14 @@ class StatusInternal extends PureComponent {
|
|
|
59
60
|
const appearance = colorToLozengeAppearanceMap[color] || DEFAULT_APPEARANCE; // Note: ommitted data-local-id attribute to avoid copying/pasting the same localId
|
|
60
61
|
|
|
61
62
|
return /*#__PURE__*/React.createElement("span", {
|
|
62
|
-
className: "status-lozenge-span"
|
|
63
|
-
,
|
|
64
|
-
title: text,
|
|
63
|
+
className: "status-lozenge-span",
|
|
65
64
|
onClick: onClick,
|
|
66
65
|
onMouseEnter: this.handleMouseEnter,
|
|
67
66
|
onMouseLeave: this.handleMouseLeave,
|
|
68
67
|
"data-node-type": "status",
|
|
69
68
|
"data-color": color,
|
|
70
|
-
"data-style": style
|
|
69
|
+
"data-style": style,
|
|
70
|
+
role: role
|
|
71
71
|
}, /*#__PURE__*/React.createElement(Lozenge, {
|
|
72
72
|
appearance: appearance,
|
|
73
73
|
maxWidth: MAX_WIDTH
|
|
@@ -2,13 +2,16 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import TextField from '@atlaskit/textfield';
|
|
3
3
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
4
4
|
import React from 'react';
|
|
5
|
+
import { injectIntl } from 'react-intl-next';
|
|
5
6
|
import { PureComponent } from 'react';
|
|
6
7
|
import styled from 'styled-components';
|
|
7
8
|
import ColorPalette from './internal/color-palette';
|
|
9
|
+
import { messages } from './i18n';
|
|
8
10
|
const FieldTextWrapper = styled.div`
|
|
9
11
|
margin: 0 ${gridSize()}px;
|
|
10
12
|
`;
|
|
11
|
-
|
|
13
|
+
|
|
14
|
+
class Picker extends PureComponent {
|
|
12
15
|
constructor(...args) {
|
|
13
16
|
super(...args);
|
|
14
17
|
|
|
@@ -42,7 +45,8 @@ export class StatusPicker extends PureComponent {
|
|
|
42
45
|
text,
|
|
43
46
|
selectedColor,
|
|
44
47
|
onColorClick,
|
|
45
|
-
onColorHover
|
|
48
|
+
onColorHover,
|
|
49
|
+
intl
|
|
46
50
|
} = this.props; // Using <React.Fragment> instead of [] to workaround Enzyme
|
|
47
51
|
// (https://github.com/airbnb/enzyme/issues/1149)
|
|
48
52
|
|
|
@@ -55,7 +59,8 @@ export class StatusPicker extends PureComponent {
|
|
|
55
59
|
onChange: this.onChange,
|
|
56
60
|
onKeyPress: this.onKeyPress,
|
|
57
61
|
spellCheck: false,
|
|
58
|
-
autoComplete: "off"
|
|
62
|
+
autoComplete: "off",
|
|
63
|
+
"aria-label": intl.formatMessage(messages.statusInputLabel)
|
|
59
64
|
})), /*#__PURE__*/React.createElement(ColorPalette, {
|
|
60
65
|
key: this.colorPaletteKey,
|
|
61
66
|
onClick: onColorClick,
|
|
@@ -66,6 +71,8 @@ export class StatusPicker extends PureComponent {
|
|
|
66
71
|
|
|
67
72
|
}
|
|
68
73
|
|
|
69
|
-
_defineProperty(
|
|
74
|
+
_defineProperty(Picker, "defaultProps", {
|
|
70
75
|
autoFocus: true
|
|
71
|
-
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
export const StatusPicker = injectIntl(Picker);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineMessages } from 'react-intl';
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
2
|
export const messages = defineMessages({
|
|
3
3
|
neutralColor: {
|
|
4
4
|
id: 'fabric.status.color.grey',
|
|
@@ -29,5 +29,10 @@ export const messages = defineMessages({
|
|
|
29
29
|
id: 'fabric.status.color.green',
|
|
30
30
|
defaultMessage: 'Green',
|
|
31
31
|
description: 'Tooltip for the green color in color palette'
|
|
32
|
+
},
|
|
33
|
+
statusInputLabel: {
|
|
34
|
+
id: 'fabric.status.input.label',
|
|
35
|
+
defaultMessage: 'Set a status',
|
|
36
|
+
description: 'Aria label text for the status input field'
|
|
32
37
|
}
|
|
33
38
|
});
|
|
@@ -3,7 +3,7 @@ import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
|
|
|
3
3
|
import { N900, N0, N50 } from '@atlaskit/theme/colors';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { PureComponent } from 'react';
|
|
6
|
-
import { FormattedMessage } from 'react-intl';
|
|
6
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { ANALYTICS_HOVER_DELAY } from '../constants';
|
|
9
9
|
import { messages } from '../i18n';
|
|
@@ -77,21 +77,21 @@ export default class Color extends PureComponent {
|
|
|
77
77
|
value
|
|
78
78
|
} = this.props;
|
|
79
79
|
const borderStyle = `1px solid ${borderColor}`;
|
|
80
|
-
return /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(FormattedMessage, messages[`${value}Color`],
|
|
80
|
+
return /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(FormattedMessage, messages[`${value}Color`], labels => /*#__PURE__*/React.createElement(Button, {
|
|
81
81
|
onClick: this.onClick,
|
|
82
82
|
onMouseEnter: this.onMouseEnter,
|
|
83
83
|
onMouseLeave: this.onMouseLeave,
|
|
84
84
|
onMouseDown: this.onMouseDown,
|
|
85
85
|
tabIndex: tabIndex,
|
|
86
86
|
className: `${isSelected ? 'selected' : ''}`,
|
|
87
|
-
title:
|
|
87
|
+
title: labels[0],
|
|
88
88
|
style: {
|
|
89
89
|
backgroundColor: backgroundColor || 'transparent',
|
|
90
90
|
border: borderStyle
|
|
91
91
|
}
|
|
92
92
|
}, isSelected && /*#__PURE__*/React.createElement(EditorDoneIcon, {
|
|
93
93
|
primaryColor: borderColor,
|
|
94
|
-
label:
|
|
94
|
+
label: labels[0]
|
|
95
95
|
}))));
|
|
96
96
|
}
|
|
97
97
|
|
package/dist/es2019/version.json
CHANGED
|
@@ -76,6 +76,7 @@ var StatusInternal = /*#__PURE__*/function (_PureComponent) {
|
|
|
76
76
|
text = _this$props.text,
|
|
77
77
|
color = _this$props.color,
|
|
78
78
|
style = _this$props.style,
|
|
79
|
+
role = _this$props.role,
|
|
79
80
|
onClick = _this$props.onClick;
|
|
80
81
|
|
|
81
82
|
if (text.trim().length === 0) {
|
|
@@ -85,15 +86,14 @@ var StatusInternal = /*#__PURE__*/function (_PureComponent) {
|
|
|
85
86
|
var appearance = colorToLozengeAppearanceMap[color] || DEFAULT_APPEARANCE; // Note: ommitted data-local-id attribute to avoid copying/pasting the same localId
|
|
86
87
|
|
|
87
88
|
return /*#__PURE__*/React.createElement("span", {
|
|
88
|
-
className: "status-lozenge-span"
|
|
89
|
-
,
|
|
90
|
-
title: text,
|
|
89
|
+
className: "status-lozenge-span",
|
|
91
90
|
onClick: onClick,
|
|
92
91
|
onMouseEnter: this.handleMouseEnter,
|
|
93
92
|
onMouseLeave: this.handleMouseLeave,
|
|
94
93
|
"data-node-type": "status",
|
|
95
94
|
"data-color": color,
|
|
96
|
-
"data-style": style
|
|
95
|
+
"data-style": style,
|
|
96
|
+
role: role
|
|
97
97
|
}, /*#__PURE__*/React.createElement(Lozenge, {
|
|
98
98
|
appearance: appearance,
|
|
99
99
|
maxWidth: MAX_WIDTH
|
|
@@ -16,19 +16,22 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
16
16
|
import TextField from '@atlaskit/textfield';
|
|
17
17
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
18
18
|
import React from 'react';
|
|
19
|
+
import { injectIntl } from 'react-intl-next';
|
|
19
20
|
import { PureComponent } from 'react';
|
|
20
21
|
import styled from 'styled-components';
|
|
21
22
|
import ColorPalette from './internal/color-palette';
|
|
23
|
+
import { messages } from './i18n';
|
|
22
24
|
var FieldTextWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: 0 ", "px;\n"])), gridSize());
|
|
23
|
-
export var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
24
|
-
_inherits(StatusPicker, _PureComponent);
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
var Picker = /*#__PURE__*/function (_PureComponent) {
|
|
27
|
+
_inherits(Picker, _PureComponent);
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
var _super = _createSuper(Picker);
|
|
30
|
+
|
|
31
|
+
function Picker() {
|
|
29
32
|
var _this;
|
|
30
33
|
|
|
31
|
-
_classCallCheck(this,
|
|
34
|
+
_classCallCheck(this, Picker);
|
|
32
35
|
|
|
33
36
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
34
37
|
args[_key] = arguments[_key];
|
|
@@ -63,14 +66,15 @@ export var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
63
66
|
return _this;
|
|
64
67
|
}
|
|
65
68
|
|
|
66
|
-
_createClass(
|
|
69
|
+
_createClass(Picker, [{
|
|
67
70
|
key: "render",
|
|
68
71
|
value: function render() {
|
|
69
72
|
var _this$props = this.props,
|
|
70
73
|
text = _this$props.text,
|
|
71
74
|
selectedColor = _this$props.selectedColor,
|
|
72
75
|
onColorClick = _this$props.onColorClick,
|
|
73
|
-
onColorHover = _this$props.onColorHover
|
|
76
|
+
onColorHover = _this$props.onColorHover,
|
|
77
|
+
intl = _this$props.intl; // Using <React.Fragment> instead of [] to workaround Enzyme
|
|
74
78
|
// (https://github.com/airbnb/enzyme/issues/1149)
|
|
75
79
|
|
|
76
80
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FieldTextWrapper, {
|
|
@@ -82,7 +86,8 @@ export var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
82
86
|
onChange: this.onChange,
|
|
83
87
|
onKeyPress: this.onKeyPress,
|
|
84
88
|
spellCheck: false,
|
|
85
|
-
autoComplete: "off"
|
|
89
|
+
autoComplete: "off",
|
|
90
|
+
"aria-label": intl.formatMessage(messages.statusInputLabel)
|
|
86
91
|
})), /*#__PURE__*/React.createElement(ColorPalette, {
|
|
87
92
|
key: this.colorPaletteKey,
|
|
88
93
|
onClick: onColorClick,
|
|
@@ -92,9 +97,11 @@ export var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
92
97
|
}
|
|
93
98
|
}]);
|
|
94
99
|
|
|
95
|
-
return
|
|
100
|
+
return Picker;
|
|
96
101
|
}(PureComponent);
|
|
97
102
|
|
|
98
|
-
_defineProperty(
|
|
103
|
+
_defineProperty(Picker, "defaultProps", {
|
|
99
104
|
autoFocus: true
|
|
100
|
-
});
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
export var StatusPicker = injectIntl(Picker);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
3
|
+
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
4
|
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
5
|
+
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
6
|
|
|
7
7
|
import { name as packageName, version as packageVersion } from '../version.json';
|
|
8
8
|
export var ELEMENTS_CHANNEL = 'fabric-elements';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineMessages } from 'react-intl';
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
2
|
export var messages = defineMessages({
|
|
3
3
|
neutralColor: {
|
|
4
4
|
id: 'fabric.status.color.grey',
|
|
@@ -29,5 +29,10 @@ export var messages = defineMessages({
|
|
|
29
29
|
id: 'fabric.status.color.green',
|
|
30
30
|
defaultMessage: 'Green',
|
|
31
31
|
description: 'Tooltip for the green color in color palette'
|
|
32
|
+
},
|
|
33
|
+
statusInputLabel: {
|
|
34
|
+
id: 'fabric.status.input.label',
|
|
35
|
+
defaultMessage: 'Set a status',
|
|
36
|
+
description: 'Aria label text for the status input field'
|
|
32
37
|
}
|
|
33
38
|
});
|
|
@@ -17,7 +17,7 @@ import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
|
|
|
17
17
|
import { N900, N0, N50 } from '@atlaskit/theme/colors';
|
|
18
18
|
import React from 'react';
|
|
19
19
|
import { PureComponent } from 'react';
|
|
20
|
-
import { FormattedMessage } from 'react-intl';
|
|
20
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
21
21
|
import styled from 'styled-components';
|
|
22
22
|
import { ANALYTICS_HOVER_DELAY } from '../constants';
|
|
23
23
|
import { messages } from '../i18n';
|
|
@@ -85,7 +85,7 @@ var Color = /*#__PURE__*/function (_PureComponent) {
|
|
|
85
85
|
borderColor = _this$props2.borderColor,
|
|
86
86
|
value = _this$props2.value;
|
|
87
87
|
var borderStyle = "1px solid ".concat(borderColor);
|
|
88
|
-
return /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(FormattedMessage, messages["".concat(value, "Color")], function (
|
|
88
|
+
return /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(FormattedMessage, messages["".concat(value, "Color")], function (labels) {
|
|
89
89
|
return /*#__PURE__*/React.createElement(Button, {
|
|
90
90
|
onClick: _this2.onClick,
|
|
91
91
|
onMouseEnter: _this2.onMouseEnter,
|
|
@@ -93,14 +93,14 @@ var Color = /*#__PURE__*/function (_PureComponent) {
|
|
|
93
93
|
onMouseDown: _this2.onMouseDown,
|
|
94
94
|
tabIndex: tabIndex,
|
|
95
95
|
className: "".concat(isSelected ? 'selected' : ''),
|
|
96
|
-
title:
|
|
96
|
+
title: labels[0],
|
|
97
97
|
style: {
|
|
98
98
|
backgroundColor: backgroundColor || 'transparent',
|
|
99
99
|
border: borderStyle
|
|
100
100
|
}
|
|
101
101
|
}, isSelected && /*#__PURE__*/React.createElement(EditorDoneIcon, {
|
|
102
102
|
primaryColor: borderColor,
|
|
103
|
-
label:
|
|
103
|
+
label: labels[0]
|
|
104
104
|
}));
|
|
105
105
|
}));
|
|
106
106
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -9,6 +9,7 @@ export interface OwnProps {
|
|
|
9
9
|
localId?: string;
|
|
10
10
|
onClick?: (event: React.SyntheticEvent<any>) => void;
|
|
11
11
|
onHover?: () => void;
|
|
12
|
+
role?: string;
|
|
12
13
|
}
|
|
13
14
|
export declare type Props = OwnProps & WithAnalyticsEventsProps;
|
|
14
|
-
export declare const Status: React.ForwardRefExoticComponent<Pick<Props, "text" | "color" | "style" | "localId" | "onClick" | "onHover"> & React.RefAttributes<any>>;
|
|
15
|
+
export declare const Status: React.ForwardRefExoticComponent<Pick<Props, "text" | "color" | "style" | "localId" | "onClick" | "onHover" | "role"> & React.RefAttributes<any>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
2
3
|
import { Color } from './Status';
|
|
3
4
|
export declare type ColorType = Color;
|
|
4
5
|
export interface Props {
|
|
@@ -10,14 +11,6 @@ export interface Props {
|
|
|
10
11
|
onTextChanged: (value: string) => void;
|
|
11
12
|
autoFocus?: boolean;
|
|
12
13
|
}
|
|
13
|
-
export declare
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
static defaultProps: {
|
|
17
|
-
autoFocus: boolean;
|
|
18
|
-
};
|
|
19
|
-
render(): JSX.Element;
|
|
20
|
-
private onChange;
|
|
21
|
-
private onKeyPress;
|
|
22
|
-
private handleInputRef;
|
|
23
|
-
}
|
|
14
|
+
export declare const StatusPicker: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
15
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
16
|
+
};
|
|
@@ -1,2 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare const messages: {
|
|
2
|
+
neutralColor: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
purpleColor: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
blueColor: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
redColor: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
yellowColor: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
greenColor: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
statusInputLabel: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/status",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Fabric Status React Components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,27 +26,27 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@atlaskit/analytics-next": "^8.0.0",
|
|
29
|
-
"@atlaskit/icon": "^21.
|
|
29
|
+
"@atlaskit/icon": "^21.10.0",
|
|
30
30
|
"@atlaskit/lozenge": "^11.1.0",
|
|
31
31
|
"@atlaskit/textfield": "^5.1.0",
|
|
32
|
-
"@atlaskit/theme": "^
|
|
32
|
+
"@atlaskit/theme": "^12.1.0",
|
|
33
33
|
"@babel/runtime": "^7.0.0",
|
|
34
34
|
"styled-components": "^3.2.6"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"react": "^16.8.0",
|
|
38
|
-
"react-intl": "
|
|
38
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@atlaskit/docs": "^9.0.0",
|
|
42
|
-
"@atlaskit/editor-test-helpers": "^
|
|
42
|
+
"@atlaskit/editor-test-helpers": "^16.1.0",
|
|
43
43
|
"@atlaskit/elements-test-helpers": "^0.7.0",
|
|
44
44
|
"@atlaskit/visual-regression": "*",
|
|
45
45
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
46
46
|
"enzyme": "^3.10.0",
|
|
47
47
|
"enzyme-adapter-react-16": "^1.15.1",
|
|
48
48
|
"react": "^16.8.0",
|
|
49
|
-
"react-intl": "
|
|
49
|
+
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
50
50
|
"typescript": "3.9.6"
|
|
51
51
|
},
|
|
52
52
|
"keywords": [
|