@atlaskit/status 0.11.1 → 1.0.0
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 +3 -2
- package/dist/cjs/components/i18n.js +2 -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 +3 -2
- package/dist/es2019/components/i18n.js +1 -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 +3 -2
- package/dist/esm/components/i18n.js +1 -1
- package/dist/esm/components/internal/color.js +4 -4
- package/dist/esm/version.json +1 -1
- package/dist/types/components/StatusPicker.d.ts +1 -0
- package/dist/types/components/i18n.d.ts +32 -2
- package/dist/types/components/internal/color-palette.d.ts +1 -0
- package/package.json +7 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,70 @@
|
|
|
1
1
|
# @atlaskit/status
|
|
2
2
|
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`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
|
|
8
|
+
|
|
9
|
+
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.
|
|
10
|
+
Why change was made: As part of a coordinated upgrade effort across AF packages, as react-intl v2 is quite dated.
|
|
11
|
+
How consumer should update their code: Ensure react-intl ^5.18.1 is installed in consuming applications.
|
|
12
|
+
|
|
13
|
+
Upgrade guide: To consume atlassian-frontend packages that use react-intl5 setup a second provider for the new version, using an npm alias
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
"react-intl": "^2.6.0",
|
|
17
|
+
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
import { IntlProvider } from 'react-intl';
|
|
22
|
+
import { IntlProvider as IntlNextProvider } from 'react-intl-next';
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<IntlProvider
|
|
26
|
+
key={locale}
|
|
27
|
+
data-test-language={locale}
|
|
28
|
+
locale={locale}
|
|
29
|
+
defaultLocale={DEFAULT_LOCALE}
|
|
30
|
+
messages={messages}
|
|
31
|
+
>
|
|
32
|
+
<IntlNextProvider
|
|
33
|
+
key={locale}
|
|
34
|
+
data-test-language={locale}
|
|
35
|
+
locale={locale}
|
|
36
|
+
defaultLocale={DEFAULT_LOCALE}
|
|
37
|
+
messages={messages}
|
|
38
|
+
>
|
|
39
|
+
{children}
|
|
40
|
+
</IntlNextProvider>
|
|
41
|
+
</IntlProvider>
|
|
42
|
+
);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 0.12.0
|
|
46
|
+
|
|
47
|
+
### Minor Changes
|
|
48
|
+
|
|
49
|
+
- [`42c7ac64c39`](https://bitbucket.org/atlassian/atlassian-frontend/commits/42c7ac64c39) - AK-654 Set a status link label with input
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- [`140df54164a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/140df54164a) - AK-570 Remove redundant title attribute for Status component
|
|
54
|
+
|
|
55
|
+
## 0.11.3
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- Updated dependencies
|
|
60
|
+
|
|
61
|
+
## 0.11.2
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- [`3dd496d620b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3dd496d620b) - Remove unneeded css prop from status component.
|
|
66
|
+
- Updated dependencies
|
|
67
|
+
|
|
3
68
|
## 0.11.1
|
|
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
|
+
localId = _this$props.localId,
|
|
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
|
+
id: localId
|
|
118
118
|
}, /*#__PURE__*/_react.default.createElement(_lozenge.default, {
|
|
119
119
|
appearance: appearance,
|
|
120
120
|
maxWidth: MAX_WIDTH
|
|
@@ -90,6 +90,7 @@ var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
90
90
|
var _this$props = this.props,
|
|
91
91
|
text = _this$props.text,
|
|
92
92
|
selectedColor = _this$props.selectedColor,
|
|
93
|
+
localId = _this$props.localId,
|
|
93
94
|
onColorClick = _this$props.onColorClick,
|
|
94
95
|
onColorHover = _this$props.onColorHover; // Using <React.Fragment> instead of [] to workaround Enzyme
|
|
95
96
|
// (https://github.com/airbnb/enzyme/issues/1149)
|
|
@@ -97,14 +98,14 @@ var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
97
98
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(FieldTextWrapper, {
|
|
98
99
|
key: this.fieldTextWrapperKey
|
|
99
100
|
}, /*#__PURE__*/_react.default.createElement(_textfield.default, {
|
|
100
|
-
css: null,
|
|
101
101
|
value: text,
|
|
102
102
|
isCompact: true,
|
|
103
103
|
ref: this.handleInputRef,
|
|
104
104
|
onChange: this.onChange,
|
|
105
105
|
onKeyPress: this.onKeyPress,
|
|
106
106
|
spellCheck: false,
|
|
107
|
-
autoComplete: "off"
|
|
107
|
+
autoComplete: "off",
|
|
108
|
+
"aria-labelledby": localId
|
|
108
109
|
})), /*#__PURE__*/_react.default.createElement(_colorPalette.default, {
|
|
109
110
|
key: this.colorPaletteKey,
|
|
110
111
|
onClick: onColorClick,
|
|
@@ -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',
|
|
@@ -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
|
+
localId,
|
|
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
|
+
id: localId
|
|
71
71
|
}, /*#__PURE__*/React.createElement(Lozenge, {
|
|
72
72
|
appearance: appearance,
|
|
73
73
|
maxWidth: MAX_WIDTH
|
|
@@ -41,6 +41,7 @@ export class StatusPicker extends PureComponent {
|
|
|
41
41
|
const {
|
|
42
42
|
text,
|
|
43
43
|
selectedColor,
|
|
44
|
+
localId,
|
|
44
45
|
onColorClick,
|
|
45
46
|
onColorHover
|
|
46
47
|
} = this.props; // Using <React.Fragment> instead of [] to workaround Enzyme
|
|
@@ -49,14 +50,14 @@ export class StatusPicker extends PureComponent {
|
|
|
49
50
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FieldTextWrapper, {
|
|
50
51
|
key: this.fieldTextWrapperKey
|
|
51
52
|
}, /*#__PURE__*/React.createElement(TextField, {
|
|
52
|
-
css: null,
|
|
53
53
|
value: text,
|
|
54
54
|
isCompact: true,
|
|
55
55
|
ref: this.handleInputRef,
|
|
56
56
|
onChange: this.onChange,
|
|
57
57
|
onKeyPress: this.onKeyPress,
|
|
58
58
|
spellCheck: false,
|
|
59
|
-
autoComplete: "off"
|
|
59
|
+
autoComplete: "off",
|
|
60
|
+
"aria-labelledby": localId
|
|
60
61
|
})), /*#__PURE__*/React.createElement(ColorPalette, {
|
|
61
62
|
key: this.colorPaletteKey,
|
|
62
63
|
onClick: onColorClick,
|
|
@@ -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
|
+
localId = _this$props.localId,
|
|
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
|
+
id: localId
|
|
97
97
|
}, /*#__PURE__*/React.createElement(Lozenge, {
|
|
98
98
|
appearance: appearance,
|
|
99
99
|
maxWidth: MAX_WIDTH
|
|
@@ -69,6 +69,7 @@ export var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
69
69
|
var _this$props = this.props,
|
|
70
70
|
text = _this$props.text,
|
|
71
71
|
selectedColor = _this$props.selectedColor,
|
|
72
|
+
localId = _this$props.localId,
|
|
72
73
|
onColorClick = _this$props.onColorClick,
|
|
73
74
|
onColorHover = _this$props.onColorHover; // Using <React.Fragment> instead of [] to workaround Enzyme
|
|
74
75
|
// (https://github.com/airbnb/enzyme/issues/1149)
|
|
@@ -76,14 +77,14 @@ export var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
76
77
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FieldTextWrapper, {
|
|
77
78
|
key: this.fieldTextWrapperKey
|
|
78
79
|
}, /*#__PURE__*/React.createElement(TextField, {
|
|
79
|
-
css: null,
|
|
80
80
|
value: text,
|
|
81
81
|
isCompact: true,
|
|
82
82
|
ref: this.handleInputRef,
|
|
83
83
|
onChange: this.onChange,
|
|
84
84
|
onKeyPress: this.onKeyPress,
|
|
85
85
|
spellCheck: false,
|
|
86
|
-
autoComplete: "off"
|
|
86
|
+
autoComplete: "off",
|
|
87
|
+
"aria-labelledby": localId
|
|
87
88
|
})), /*#__PURE__*/React.createElement(ColorPalette, {
|
|
88
89
|
key: this.colorPaletteKey,
|
|
89
90
|
onClick: onColorClick,
|
|
@@ -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 Props {
|
|
|
9
9
|
onColorHover?: (value: ColorType) => void;
|
|
10
10
|
onTextChanged: (value: string) => void;
|
|
11
11
|
autoFocus?: boolean;
|
|
12
|
+
localId?: string;
|
|
12
13
|
}
|
|
13
14
|
export declare class StatusPicker extends PureComponent<Props, any> {
|
|
14
15
|
private fieldTextWrapperKey;
|
|
@@ -1,2 +1,32 @@
|
|
|
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
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/status",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Fabric Status React Components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,27 +26,26 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@atlaskit/analytics-next": "^8.0.0",
|
|
29
|
-
"@atlaskit/icon": "^21.
|
|
30
|
-
"@atlaskit/lozenge": "^11.
|
|
31
|
-
"@atlaskit/textfield": "^5.
|
|
32
|
-
"@atlaskit/theme": "^
|
|
29
|
+
"@atlaskit/icon": "^21.9.0",
|
|
30
|
+
"@atlaskit/lozenge": "^11.1.0",
|
|
31
|
+
"@atlaskit/textfield": "^5.1.0",
|
|
32
|
+
"@atlaskit/theme": "^12.0.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.0.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": "^2.6.0",
|
|
50
49
|
"typescript": "3.9.6"
|
|
51
50
|
},
|
|
52
51
|
"keywords": [
|