@atlaskit/status 0.11.0 → 0.12.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 +29 -0
- package/build/tsconfig.json +6 -2
- package/dist/cjs/components/Status.js +11 -7
- package/dist/cjs/components/StatusPicker.js +11 -14
- package/dist/cjs/components/analytics.js +1 -1
- package/dist/cjs/components/internal/color-palette.js +6 -10
- package/dist/cjs/components/internal/color.js +9 -23
- 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/version.json +1 -1
- package/dist/esm/components/Status.js +5 -5
- package/dist/esm/components/StatusPicker.js +7 -14
- package/dist/esm/components/analytics.js +1 -1
- package/dist/esm/components/internal/color-palette.js +2 -10
- package/dist/esm/components/internal/color.js +5 -23
- package/dist/esm/version.json +1 -1
- package/dist/types/components/StatusPicker.d.ts +1 -0
- package/package.json +9 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @atlaskit/status
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`42c7ac64c39`](https://bitbucket.org/atlassian/atlassian-frontend/commits/42c7ac64c39) - AK-654 Set a status link label with input
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [`140df54164a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/140df54164a) - AK-570 Remove redundant title attribute for Status component
|
|
12
|
+
|
|
13
|
+
## 0.11.3
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
19
|
+
## 0.11.2
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- [`3dd496d620b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3dd496d620b) - Remove unneeded css prop from status component.
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
26
|
+
## 0.11.1
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies
|
|
31
|
+
|
|
3
32
|
## 0.11.0
|
|
4
33
|
|
|
5
34
|
### Minor Changes
|
package/build/tsconfig.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -33,9 +33,13 @@ 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
|
+
|
|
36
40
|
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); }; }
|
|
37
41
|
|
|
38
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
42
|
+
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; } }
|
|
39
43
|
|
|
40
44
|
var colorToLozengeAppearanceMap = {
|
|
41
45
|
neutral: 'default',
|
|
@@ -93,6 +97,7 @@ var StatusInternal = /*#__PURE__*/function (_PureComponent) {
|
|
|
93
97
|
text = _this$props.text,
|
|
94
98
|
color = _this$props.color,
|
|
95
99
|
style = _this$props.style,
|
|
100
|
+
localId = _this$props.localId,
|
|
96
101
|
onClick = _this$props.onClick;
|
|
97
102
|
|
|
98
103
|
if (text.trim().length === 0) {
|
|
@@ -102,15 +107,14 @@ var StatusInternal = /*#__PURE__*/function (_PureComponent) {
|
|
|
102
107
|
var appearance = colorToLozengeAppearanceMap[color] || DEFAULT_APPEARANCE; // Note: ommitted data-local-id attribute to avoid copying/pasting the same localId
|
|
103
108
|
|
|
104
109
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
105
|
-
className: "status-lozenge-span"
|
|
106
|
-
,
|
|
107
|
-
title: text,
|
|
110
|
+
className: "status-lozenge-span",
|
|
108
111
|
onClick: onClick,
|
|
109
112
|
onMouseEnter: this.handleMouseEnter,
|
|
110
113
|
onMouseLeave: this.handleMouseLeave,
|
|
111
114
|
"data-node-type": "status",
|
|
112
115
|
"data-color": color,
|
|
113
|
-
"data-style": style
|
|
116
|
+
"data-style": style,
|
|
117
|
+
id: localId
|
|
114
118
|
}, /*#__PURE__*/_react.default.createElement(_lozenge.default, {
|
|
115
119
|
appearance: appearance,
|
|
116
120
|
maxWidth: MAX_WIDTH
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -35,21 +35,17 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
35
35
|
|
|
36
36
|
var _colorPalette = _interopRequireDefault(require("./internal/color-palette"));
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
var _templateObject;
|
|
39
39
|
|
|
40
|
-
function
|
|
40
|
+
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); }
|
|
41
41
|
|
|
42
|
-
function
|
|
43
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n margin: 0 ", "px;\n"]);
|
|
42
|
+
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; }
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
return data;
|
|
47
|
-
};
|
|
44
|
+
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); }; }
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
}
|
|
46
|
+
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; } }
|
|
51
47
|
|
|
52
|
-
var FieldTextWrapper = _styledComponents.default.div(_templateObject(), (0, _constants.gridSize)());
|
|
48
|
+
var FieldTextWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n margin: 0 ", "px;\n"])), (0, _constants.gridSize)());
|
|
53
49
|
|
|
54
50
|
var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
55
51
|
(0, _inherits2.default)(StatusPicker, _PureComponent);
|
|
@@ -94,6 +90,7 @@ var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
94
90
|
var _this$props = this.props,
|
|
95
91
|
text = _this$props.text,
|
|
96
92
|
selectedColor = _this$props.selectedColor,
|
|
93
|
+
localId = _this$props.localId,
|
|
97
94
|
onColorClick = _this$props.onColorClick,
|
|
98
95
|
onColorHover = _this$props.onColorHover; // Using <React.Fragment> instead of [] to workaround Enzyme
|
|
99
96
|
// (https://github.com/airbnb/enzyme/issues/1149)
|
|
@@ -101,14 +98,14 @@ var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
101
98
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(FieldTextWrapper, {
|
|
102
99
|
key: this.fieldTextWrapperKey
|
|
103
100
|
}, /*#__PURE__*/_react.default.createElement(_textfield.default, {
|
|
104
|
-
css: null,
|
|
105
101
|
value: text,
|
|
106
102
|
isCompact: true,
|
|
107
103
|
ref: this.handleInputRef,
|
|
108
104
|
onChange: this.onChange,
|
|
109
105
|
onKeyPress: this.onKeyPress,
|
|
110
106
|
spellCheck: false,
|
|
111
|
-
autoComplete: "off"
|
|
107
|
+
autoComplete: "off",
|
|
108
|
+
"aria-labelledby": localId
|
|
112
109
|
})), /*#__PURE__*/_react.default.createElement(_colorPalette.default, {
|
|
113
110
|
key: this.colorPaletteKey,
|
|
114
111
|
onClick: onColorClick,
|
|
@@ -11,7 +11,7 @@ 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); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
15
15
|
|
|
16
16
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
17
17
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -23,20 +23,16 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
23
23
|
|
|
24
24
|
var _color = _interopRequireDefault(require("./color"));
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
var data = (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"]);
|
|
26
|
+
var _templateObject;
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
return data;
|
|
31
|
-
};
|
|
28
|
+
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); }
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
}
|
|
30
|
+
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; }
|
|
35
31
|
|
|
36
32
|
// color value, label, background, borderColor
|
|
37
33
|
var palette = [['neutral', colors.N40, colors.N400], ['purple', colors.P50, colors.P400], ['blue', colors.B50, colors.B400], ['red', colors.R50, colors.R400], ['yellow', colors.Y75, colors.Y400], ['green', colors.G50, colors.G400]];
|
|
38
34
|
|
|
39
|
-
var ColorPaletteWrapper = _styledComponents.default.div(_templateObject(), (0, _constants.gridSize)(), (0, _constants.gridSize)(), (0, _constants.gridSize)());
|
|
35
|
+
var ColorPaletteWrapper = _styledComponents.default.div(_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)());
|
|
40
36
|
|
|
41
37
|
var _default = function _default(_ref) {
|
|
42
38
|
var _ref$cols = _ref.cols,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -39,33 +39,19 @@ var _constants = require("../constants");
|
|
|
39
39
|
|
|
40
40
|
var _i18n = require("../i18n");
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
42
|
+
var _templateObject, _templateObject2;
|
|
45
43
|
|
|
46
|
-
function
|
|
47
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid transparent;\n margin: 0 2px;\n font-size: 0;\n display: flex;\n align-items: center;\n padding: 1px;\n border-radius: 6px;\n &:hover {\n border: 1px solid ", ";\n }\n"]);
|
|
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); }
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
return data;
|
|
51
|
-
};
|
|
46
|
+
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; }
|
|
52
47
|
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function _templateObject() {
|
|
57
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n height: 24px;\n width: 24px;\n background: ", ";\n padding: 0;\n border-radius: 4px;\n border: 1px solid ", ";\n cursor: pointer;\n display: block;\n box-sizing: border-box;\n overflow: hidden;\n"]);
|
|
58
|
-
|
|
59
|
-
_templateObject = function _templateObject() {
|
|
60
|
-
return data;
|
|
61
|
-
};
|
|
48
|
+
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); }; }
|
|
62
49
|
|
|
63
|
-
|
|
64
|
-
}
|
|
50
|
+
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; } }
|
|
65
51
|
|
|
66
|
-
var Button = _styledComponents.default.button(_templateObject(), _colors.N900, _colors.N0);
|
|
52
|
+
var Button = _styledComponents.default.button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n height: 24px;\n width: 24px;\n background: ", ";\n padding: 0;\n border-radius: 4px;\n border: 1px solid ", ";\n cursor: pointer;\n display: block;\n box-sizing: border-box;\n overflow: hidden;\n"])), _colors.N900, _colors.N0);
|
|
67
53
|
|
|
68
|
-
var ButtonWrapper = _styledComponents.default.span(_templateObject2(), _colors.N50);
|
|
54
|
+
var ButtonWrapper = _styledComponents.default.span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid transparent;\n margin: 0 2px;\n font-size: 0;\n display: flex;\n align-items: center;\n padding: 1px;\n border-radius: 6px;\n &:hover {\n border: 1px solid ", ";\n }\n"])), _colors.N50);
|
|
69
55
|
|
|
70
56
|
var Color = /*#__PURE__*/function (_PureComponent) {
|
|
71
57
|
(0, _inherits2.default)(Color, _PureComponent);
|
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,
|
package/dist/es2019/version.json
CHANGED
|
@@ -8,7 +8,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
8
8
|
|
|
9
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
10
|
|
|
11
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
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
|
import React from 'react';
|
|
14
14
|
import { PureComponent } from 'react';
|
|
@@ -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
|
|
@@ -7,19 +7,11 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
|
+
var _templateObject;
|
|
13
11
|
|
|
14
|
-
function
|
|
15
|
-
var data = _taggedTemplateLiteral(["\n margin: 0 ", "px;\n"]);
|
|
16
|
-
|
|
17
|
-
_templateObject = function _templateObject() {
|
|
18
|
-
return data;
|
|
19
|
-
};
|
|
12
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
20
13
|
|
|
21
|
-
|
|
22
|
-
}
|
|
14
|
+
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; } }
|
|
23
15
|
|
|
24
16
|
import TextField from '@atlaskit/textfield';
|
|
25
17
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
@@ -27,7 +19,7 @@ import React from 'react';
|
|
|
27
19
|
import { PureComponent } from 'react';
|
|
28
20
|
import styled from 'styled-components';
|
|
29
21
|
import ColorPalette from './internal/color-palette';
|
|
30
|
-
var FieldTextWrapper = styled.div(_templateObject(), gridSize());
|
|
22
|
+
var FieldTextWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: 0 ", "px;\n"])), gridSize());
|
|
31
23
|
export var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
32
24
|
_inherits(StatusPicker, _PureComponent);
|
|
33
25
|
|
|
@@ -77,6 +69,7 @@ export var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
77
69
|
var _this$props = this.props,
|
|
78
70
|
text = _this$props.text,
|
|
79
71
|
selectedColor = _this$props.selectedColor,
|
|
72
|
+
localId = _this$props.localId,
|
|
80
73
|
onColorClick = _this$props.onColorClick,
|
|
81
74
|
onColorHover = _this$props.onColorHover; // Using <React.Fragment> instead of [] to workaround Enzyme
|
|
82
75
|
// (https://github.com/airbnb/enzyme/issues/1149)
|
|
@@ -84,14 +77,14 @@ export var StatusPicker = /*#__PURE__*/function (_PureComponent) {
|
|
|
84
77
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FieldTextWrapper, {
|
|
85
78
|
key: this.fieldTextWrapperKey
|
|
86
79
|
}, /*#__PURE__*/React.createElement(TextField, {
|
|
87
|
-
css: null,
|
|
88
80
|
value: text,
|
|
89
81
|
isCompact: true,
|
|
90
82
|
ref: this.handleInputRef,
|
|
91
83
|
onChange: this.onChange,
|
|
92
84
|
onKeyPress: this.onKeyPress,
|
|
93
85
|
spellCheck: false,
|
|
94
|
-
autoComplete: "off"
|
|
86
|
+
autoComplete: "off",
|
|
87
|
+
"aria-labelledby": localId
|
|
95
88
|
})), /*#__PURE__*/React.createElement(ColorPalette, {
|
|
96
89
|
key: this.colorPaletteKey,
|
|
97
90
|
onClick: onColorClick,
|
|
@@ -1,6 +1,6 @@
|
|
|
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); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
6
|
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
var data = _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"]);
|
|
6
|
-
|
|
7
|
-
_templateObject = function _templateObject() {
|
|
8
|
-
return data;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
return data;
|
|
12
|
-
}
|
|
4
|
+
var _templateObject;
|
|
13
5
|
|
|
14
6
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
15
7
|
import * as colors from '@atlaskit/theme/colors';
|
|
@@ -18,7 +10,7 @@ import styled from 'styled-components';
|
|
|
18
10
|
import Color from './color'; // color value, label, background, borderColor
|
|
19
11
|
|
|
20
12
|
var palette = [['neutral', colors.N40, colors.N400], ['purple', colors.P50, colors.P400], ['blue', colors.B50, colors.B400], ['red', colors.R50, colors.R400], ['yellow', colors.Y75, colors.Y400], ['green', colors.G50, colors.G400]];
|
|
21
|
-
var ColorPaletteWrapper = styled.div(_templateObject(), gridSize(), gridSize(), gridSize());
|
|
13
|
+
var ColorPaletteWrapper = styled.div(_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());
|
|
22
14
|
export default (function (_ref) {
|
|
23
15
|
var _ref$cols = _ref.cols,
|
|
24
16
|
cols = _ref$cols === void 0 ? 7 : _ref$cols,
|
|
@@ -7,29 +7,11 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
-
|
|
14
|
-
function _templateObject2() {
|
|
15
|
-
var data = _taggedTemplateLiteral(["\n border: 1px solid transparent;\n margin: 0 2px;\n font-size: 0;\n display: flex;\n align-items: center;\n padding: 1px;\n border-radius: 6px;\n &:hover {\n border: 1px solid ", ";\n }\n"]);
|
|
16
|
-
|
|
17
|
-
_templateObject2 = function _templateObject2() {
|
|
18
|
-
return data;
|
|
19
|
-
};
|
|
10
|
+
var _templateObject, _templateObject2;
|
|
20
11
|
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function _templateObject() {
|
|
25
|
-
var data = _taggedTemplateLiteral(["\n height: 24px;\n width: 24px;\n background: ", ";\n padding: 0;\n border-radius: 4px;\n border: 1px solid ", ";\n cursor: pointer;\n display: block;\n box-sizing: border-box;\n overflow: hidden;\n"]);
|
|
26
|
-
|
|
27
|
-
_templateObject = function _templateObject() {
|
|
28
|
-
return data;
|
|
29
|
-
};
|
|
12
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
30
13
|
|
|
31
|
-
|
|
32
|
-
}
|
|
14
|
+
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; } }
|
|
33
15
|
|
|
34
16
|
import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
|
|
35
17
|
import { N900, N0, N50 } from '@atlaskit/theme/colors';
|
|
@@ -39,8 +21,8 @@ import { FormattedMessage } from 'react-intl';
|
|
|
39
21
|
import styled from 'styled-components';
|
|
40
22
|
import { ANALYTICS_HOVER_DELAY } from '../constants';
|
|
41
23
|
import { messages } from '../i18n';
|
|
42
|
-
var Button = styled.button(_templateObject(), N900, N0);
|
|
43
|
-
var ButtonWrapper = styled.span(_templateObject2(), N50);
|
|
24
|
+
var Button = styled.button(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 24px;\n width: 24px;\n background: ", ";\n padding: 0;\n border-radius: 4px;\n border: 1px solid ", ";\n cursor: pointer;\n display: block;\n box-sizing: border-box;\n overflow: hidden;\n"])), N900, N0);
|
|
25
|
+
var ButtonWrapper = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border: 1px solid transparent;\n margin: 0 2px;\n font-size: 0;\n display: flex;\n align-items: center;\n padding: 1px;\n border-radius: 6px;\n &:hover {\n border: 1px solid ", ";\n }\n"])), N50);
|
|
44
26
|
|
|
45
27
|
var Color = /*#__PURE__*/function (_PureComponent) {
|
|
46
28
|
_inherits(Color, _PureComponent);
|
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/status",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Fabric Status React Components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@atlaskit/analytics-next": "^8.0.0",
|
|
29
|
-
"@atlaskit/icon": "^21.
|
|
30
|
-
"@atlaskit/lozenge": "^
|
|
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
|
},
|
|
@@ -39,9 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@atlaskit/docs": "^9.0.0",
|
|
42
|
-
"@atlaskit/editor-test-helpers": "^
|
|
42
|
+
"@atlaskit/editor-test-helpers": "^15.6.0",
|
|
43
43
|
"@atlaskit/elements-test-helpers": "^0.7.0",
|
|
44
44
|
"@atlaskit/visual-regression": "*",
|
|
45
|
+
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
45
46
|
"enzyme": "^3.10.0",
|
|
46
47
|
"enzyme-adapter-react-16": "^1.15.1",
|
|
47
48
|
"react": "^16.8.0",
|
|
@@ -53,5 +54,6 @@
|
|
|
53
54
|
"date",
|
|
54
55
|
"fabric",
|
|
55
56
|
"editor"
|
|
56
|
-
]
|
|
57
|
+
],
|
|
58
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
57
59
|
}
|