@atlaskit/color-picker 3.2.8 → 3.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/components/ColorCard.js +8 -4
- package/dist/cjs/components/ColorPaletteMenu.js +2 -2
- package/dist/cjs/components/ColorPicker.js +31 -10
- package/dist/cjs/messages.js +19 -0
- package/dist/es2019/components/ColorCard.js +8 -4
- package/dist/es2019/components/ColorPaletteMenu.js +2 -2
- package/dist/es2019/components/ColorPicker.js +25 -4
- package/dist/es2019/messages.js +13 -0
- package/dist/esm/components/ColorCard.js +8 -4
- package/dist/esm/components/ColorPaletteMenu.js +2 -2
- package/dist/esm/components/ColorPicker.js +31 -10
- package/dist/esm/messages.js +13 -0
- package/dist/types/components/ColorPicker.d.ts +7 -15
- package/dist/types/messages.d.ts +13 -0
- package/dist/types-ts4.5/components/ColorPicker.d.ts +7 -15
- package/dist/types-ts4.5/messages.d.ts +13 -0
- package/package.json +12 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/color-picker
|
|
2
2
|
|
|
3
|
+
## 3.2.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#91736](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91736) [`29f4e565f90d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/29f4e565f90d) - Modified color picker aria-label format
|
|
8
|
+
|
|
9
|
+
## 3.2.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#91588](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91588) [`464adc72109c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/464adc72109c) - removed duplicate label annoucements for screen reader users at ColorPaletteMenu component
|
|
14
|
+
|
|
3
15
|
## 3.2.8
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -71,8 +71,10 @@ var ColorCard = function ColorCard(props) {
|
|
|
71
71
|
onMouseDown: handleMouseDown,
|
|
72
72
|
onKeyDown: handleKeyDown,
|
|
73
73
|
role: "radio",
|
|
74
|
-
"aria-checked": selected
|
|
75
|
-
|
|
74
|
+
"aria-checked": selected
|
|
75
|
+
}, !(0, _platformFeatureFlags.getBooleanFF)('platform.jca11y-1559-dashboard-view-dashboard-remove-duplicate-aria-label_g5i3i') && {
|
|
76
|
+
'aria-label': label
|
|
77
|
+
}, {
|
|
76
78
|
tabIndex: 0
|
|
77
79
|
}, (0, _platformFeatureFlags.getBooleanFF)('platform.color-picker-radio-button-functionality_6hkcy') && {
|
|
78
80
|
ref: ref
|
|
@@ -96,8 +98,10 @@ var ColorCard = function ColorCard(props) {
|
|
|
96
98
|
onMouseDown: handleMouseDown,
|
|
97
99
|
onKeyDown: handleKeyDown,
|
|
98
100
|
role: "radio",
|
|
99
|
-
"aria-checked": selected
|
|
100
|
-
|
|
101
|
+
"aria-checked": selected
|
|
102
|
+
}, !(0, _platformFeatureFlags.getBooleanFF)('platform.jca11y-1559-dashboard-view-dashboard-remove-duplicate-aria-label_g5i3i') && {
|
|
103
|
+
'aria-label': label
|
|
104
|
+
}, {
|
|
101
105
|
tabIndex: 0
|
|
102
106
|
}, (0, _platformFeatureFlags.getBooleanFF)('platform.color-picker-radio-button-functionality_6hkcy') && {
|
|
103
107
|
ref: ref
|
|
@@ -36,7 +36,7 @@ var ColorPaletteMenuWithoutAnalytics = exports.ColorPaletteMenuWithoutAnalytics
|
|
|
36
36
|
attributes: {
|
|
37
37
|
componentName: 'color-picker',
|
|
38
38
|
packageName: "@atlaskit/color-picker",
|
|
39
|
-
packageVersion: "3.2.
|
|
39
|
+
packageVersion: "3.2.10"
|
|
40
40
|
}
|
|
41
41
|
})(createAnalyticsEvent);
|
|
42
42
|
}
|
|
@@ -78,7 +78,7 @@ var ColorPaletteMenuWithoutAnalytics = exports.ColorPaletteMenuWithoutAnalytics
|
|
|
78
78
|
var _default = exports.default = (0, _analyticsNext.withAnalyticsContext)({
|
|
79
79
|
componentName: 'color-picker',
|
|
80
80
|
packageName: "@atlaskit/color-picker",
|
|
81
|
-
packageVersion: "3.2.
|
|
81
|
+
packageVersion: "3.2.10"
|
|
82
82
|
})((0, _analyticsNext.withAnalyticsEvents)()(ColorPaletteMenuWithoutAnalytics));
|
|
83
83
|
var colorCardWrapperStylesOld = (0, _react.css)({
|
|
84
84
|
display: 'flex',
|
|
@@ -23,6 +23,8 @@ var _analyticsNext = require("@atlaskit/analytics-next");
|
|
|
23
23
|
var _utils = require("../utils");
|
|
24
24
|
var _react2 = require("@emotion/react");
|
|
25
25
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
26
|
+
var _reactIntlNext = require("react-intl-next");
|
|
27
|
+
var _messages = _interopRequireDefault(require("../messages"));
|
|
26
28
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
27
29
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
28
30
|
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); }; }
|
|
@@ -38,13 +40,13 @@ var defaultPopperProps = {
|
|
|
38
40
|
placement: 'bottom-start'
|
|
39
41
|
};
|
|
40
42
|
var packageName = "@atlaskit/color-picker";
|
|
41
|
-
var packageVersion = "3.2.
|
|
42
|
-
var
|
|
43
|
-
(0, _inherits2.default)(
|
|
44
|
-
var _super = _createSuper(
|
|
45
|
-
function
|
|
43
|
+
var packageVersion = "3.2.10";
|
|
44
|
+
var ColorPickerWithoutAnalyticsBase = /*#__PURE__*/function (_React$Component) {
|
|
45
|
+
(0, _inherits2.default)(ColorPickerWithoutAnalyticsBase, _React$Component);
|
|
46
|
+
var _super = _createSuper(ColorPickerWithoutAnalyticsBase);
|
|
47
|
+
function ColorPickerWithoutAnalyticsBase() {
|
|
46
48
|
var _this;
|
|
47
|
-
(0, _classCallCheck2.default)(this,
|
|
49
|
+
(0, _classCallCheck2.default)(this, ColorPickerWithoutAnalyticsBase);
|
|
48
50
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
49
51
|
args[_key] = arguments[_key];
|
|
50
52
|
}
|
|
@@ -88,9 +90,26 @@ var ColorPickerWithoutAnalytics = exports.ColorPickerWithoutAnalytics = /*#__PUR
|
|
|
88
90
|
e.stopPropagation();
|
|
89
91
|
}
|
|
90
92
|
});
|
|
93
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getFullLabel", function (intl, value, label) {
|
|
94
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.jca11y-1480-inappropriate-label-for-color-picker_76tfe')) {
|
|
95
|
+
if (value && value.label) {
|
|
96
|
+
return intl.formatMessage(_messages.default.colorPickerAriaLabel, {
|
|
97
|
+
color: value.label,
|
|
98
|
+
message: label
|
|
99
|
+
});
|
|
100
|
+
} else {
|
|
101
|
+
return label;
|
|
102
|
+
}
|
|
103
|
+
} else {
|
|
104
|
+
return intl.formatMessage(_messages.default.colorPickerAriaLabelOldFormat, {
|
|
105
|
+
color: value.label,
|
|
106
|
+
message: label
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
});
|
|
91
110
|
return _this;
|
|
92
111
|
}
|
|
93
|
-
(0, _createClass2.default)(
|
|
112
|
+
(0, _createClass2.default)(ColorPickerWithoutAnalyticsBase, [{
|
|
94
113
|
key: "render",
|
|
95
114
|
value: function render() {
|
|
96
115
|
var _this$props = this.props,
|
|
@@ -105,11 +124,12 @@ var ColorPickerWithoutAnalytics = exports.ColorPickerWithoutAnalytics = /*#__PUR
|
|
|
105
124
|
selectedColourSwatchSize = _this$props.selectedColourSwatchSize,
|
|
106
125
|
_this$props$showDefau = _this$props.showDefaultSwatchColor,
|
|
107
126
|
showDefaultSwatchColor = _this$props$showDefau === void 0 ? true : _this$props$showDefau,
|
|
108
|
-
isDisabledSelectedSwatch = _this$props.isDisabledSelectedSwatch
|
|
127
|
+
isDisabledSelectedSwatch = _this$props.isDisabledSelectedSwatch,
|
|
128
|
+
intl = _this$props.intl;
|
|
109
129
|
var _getOptions = (0, _utils.getOptions)(palette, selectedColor, showDefaultSwatchColor),
|
|
110
130
|
options = _getOptions.options,
|
|
111
131
|
value = _getOptions.value;
|
|
112
|
-
var fullLabel =
|
|
132
|
+
var fullLabel = this.getFullLabel(intl, value, label);
|
|
113
133
|
return (0, _react2.jsx)(_select.PopupSelect, {
|
|
114
134
|
target: function target(_ref) {
|
|
115
135
|
var ref = _ref.ref,
|
|
@@ -146,8 +166,9 @@ var ColorPickerWithoutAnalytics = exports.ColorPickerWithoutAnalytics = /*#__PUR
|
|
|
146
166
|
});
|
|
147
167
|
}
|
|
148
168
|
}]);
|
|
149
|
-
return
|
|
169
|
+
return ColorPickerWithoutAnalyticsBase;
|
|
150
170
|
}(_react.default.Component);
|
|
171
|
+
var ColorPickerWithoutAnalytics = exports.ColorPickerWithoutAnalytics = (0, _reactIntlNext.injectIntl)(ColorPickerWithoutAnalyticsBase);
|
|
151
172
|
var _default = exports.default = (0, _analyticsNext.withAnalyticsContext)({
|
|
152
173
|
componentName: 'color-picker',
|
|
153
174
|
packageName: packageName,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactIntlNext = require("react-intl-next");
|
|
8
|
+
var _default = exports.default = (0, _reactIntlNext.defineMessages)({
|
|
9
|
+
colorPickerAriaLabel: {
|
|
10
|
+
id: 'jira.color-picker.src.color-picker-aria-label',
|
|
11
|
+
defaultMessage: '{color} selected, {message}',
|
|
12
|
+
description: 'This text is used as aria-label text in color picker component'
|
|
13
|
+
},
|
|
14
|
+
colorPickerAriaLabelOldFormat: {
|
|
15
|
+
id: 'jira.color-picker.src.color-picker-aria-label-old-format',
|
|
16
|
+
defaultMessage: "{message}, {color} selected",
|
|
17
|
+
description: 'This text is used as aria-label text in color picker component'
|
|
18
|
+
}
|
|
19
|
+
});
|
|
@@ -64,8 +64,10 @@ const ColorCard = props => {
|
|
|
64
64
|
onMouseDown: handleMouseDown,
|
|
65
65
|
onKeyDown: handleKeyDown,
|
|
66
66
|
role: "radio",
|
|
67
|
-
"aria-checked": selected
|
|
68
|
-
|
|
67
|
+
"aria-checked": selected
|
|
68
|
+
}, !getBooleanFF('platform.jca11y-1559-dashboard-view-dashboard-remove-duplicate-aria-label_g5i3i') && {
|
|
69
|
+
'aria-label': label
|
|
70
|
+
}, {
|
|
69
71
|
tabIndex: 0
|
|
70
72
|
}, getBooleanFF('platform.color-picker-radio-button-functionality_6hkcy') && {
|
|
71
73
|
ref: ref
|
|
@@ -89,8 +91,10 @@ const ColorCard = props => {
|
|
|
89
91
|
onMouseDown: handleMouseDown,
|
|
90
92
|
onKeyDown: handleKeyDown,
|
|
91
93
|
role: "radio",
|
|
92
|
-
"aria-checked": selected
|
|
93
|
-
|
|
94
|
+
"aria-checked": selected
|
|
95
|
+
}, !getBooleanFF('platform.jca11y-1559-dashboard-view-dashboard-remove-duplicate-aria-label_g5i3i') && {
|
|
96
|
+
'aria-label': label
|
|
97
|
+
}, {
|
|
94
98
|
tabIndex: 0
|
|
95
99
|
}, getBooleanFF('platform.color-picker-radio-button-functionality_6hkcy') && {
|
|
96
100
|
ref: ref
|
|
@@ -26,7 +26,7 @@ export const ColorPaletteMenuWithoutAnalytics = ({
|
|
|
26
26
|
attributes: {
|
|
27
27
|
componentName: 'color-picker',
|
|
28
28
|
packageName: "@atlaskit/color-picker",
|
|
29
|
-
packageVersion: "3.2.
|
|
29
|
+
packageVersion: "3.2.10"
|
|
30
30
|
}
|
|
31
31
|
})(createAnalyticsEvent);
|
|
32
32
|
}
|
|
@@ -68,7 +68,7 @@ export const ColorPaletteMenuWithoutAnalytics = ({
|
|
|
68
68
|
export default withAnalyticsContext({
|
|
69
69
|
componentName: 'color-picker',
|
|
70
70
|
packageName: "@atlaskit/color-picker",
|
|
71
|
-
packageVersion: "3.2.
|
|
71
|
+
packageVersion: "3.2.10"
|
|
72
72
|
})(withAnalyticsEvents()(ColorPaletteMenuWithoutAnalytics));
|
|
73
73
|
const colorCardWrapperStylesOld = css({
|
|
74
74
|
display: 'flex',
|
|
@@ -10,6 +10,8 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
10
10
|
import { getOptions } from '../utils';
|
|
11
11
|
import { css, jsx } from '@emotion/react';
|
|
12
12
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
13
|
+
import { injectIntl } from 'react-intl-next';
|
|
14
|
+
import messages from '../messages';
|
|
13
15
|
const defaultPopperProps = {
|
|
14
16
|
strategy: 'fixed',
|
|
15
17
|
modifiers: [{
|
|
@@ -21,8 +23,8 @@ const defaultPopperProps = {
|
|
|
21
23
|
placement: 'bottom-start'
|
|
22
24
|
};
|
|
23
25
|
const packageName = "@atlaskit/color-picker";
|
|
24
|
-
const packageVersion = "3.2.
|
|
25
|
-
|
|
26
|
+
const packageVersion = "3.2.10";
|
|
27
|
+
class ColorPickerWithoutAnalyticsBase extends React.Component {
|
|
26
28
|
constructor(...args) {
|
|
27
29
|
super(...args);
|
|
28
30
|
_defineProperty(this, "createAndFireEventOnAtlaskit", createAndFireEvent('atlaskit'));
|
|
@@ -66,6 +68,23 @@ export class ColorPickerWithoutAnalytics extends React.Component {
|
|
|
66
68
|
e.stopPropagation();
|
|
67
69
|
}
|
|
68
70
|
});
|
|
71
|
+
_defineProperty(this, "getFullLabel", (intl, value, label) => {
|
|
72
|
+
if (getBooleanFF('platform.jca11y-1480-inappropriate-label-for-color-picker_76tfe')) {
|
|
73
|
+
if (value && value.label) {
|
|
74
|
+
return intl.formatMessage(messages.colorPickerAriaLabel, {
|
|
75
|
+
color: value.label,
|
|
76
|
+
message: label
|
|
77
|
+
});
|
|
78
|
+
} else {
|
|
79
|
+
return label;
|
|
80
|
+
}
|
|
81
|
+
} else {
|
|
82
|
+
return intl.formatMessage(messages.colorPickerAriaLabelOldFormat, {
|
|
83
|
+
color: value.label,
|
|
84
|
+
message: label
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
});
|
|
69
88
|
}
|
|
70
89
|
render() {
|
|
71
90
|
const {
|
|
@@ -77,13 +96,14 @@ export class ColorPickerWithoutAnalytics extends React.Component {
|
|
|
77
96
|
label = 'Color picker',
|
|
78
97
|
selectedColourSwatchSize,
|
|
79
98
|
showDefaultSwatchColor = true,
|
|
80
|
-
isDisabledSelectedSwatch
|
|
99
|
+
isDisabledSelectedSwatch,
|
|
100
|
+
intl
|
|
81
101
|
} = this.props;
|
|
82
102
|
const {
|
|
83
103
|
options,
|
|
84
104
|
value
|
|
85
105
|
} = getOptions(palette, selectedColor, showDefaultSwatchColor);
|
|
86
|
-
const fullLabel =
|
|
106
|
+
const fullLabel = this.getFullLabel(intl, value, label);
|
|
87
107
|
return jsx(PopupSelect, {
|
|
88
108
|
target: ({
|
|
89
109
|
ref,
|
|
@@ -119,6 +139,7 @@ export class ColorPickerWithoutAnalytics extends React.Component {
|
|
|
119
139
|
});
|
|
120
140
|
}
|
|
121
141
|
}
|
|
142
|
+
export const ColorPickerWithoutAnalytics = injectIntl(ColorPickerWithoutAnalyticsBase);
|
|
122
143
|
export default withAnalyticsContext({
|
|
123
144
|
componentName: 'color-picker',
|
|
124
145
|
packageName,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export default defineMessages({
|
|
3
|
+
colorPickerAriaLabel: {
|
|
4
|
+
id: 'jira.color-picker.src.color-picker-aria-label',
|
|
5
|
+
defaultMessage: '{color} selected, {message}',
|
|
6
|
+
description: 'This text is used as aria-label text in color picker component'
|
|
7
|
+
},
|
|
8
|
+
colorPickerAriaLabelOldFormat: {
|
|
9
|
+
id: 'jira.color-picker.src.color-picker-aria-label-old-format',
|
|
10
|
+
defaultMessage: `{message}, {color} selected`,
|
|
11
|
+
description: 'This text is used as aria-label text in color picker component'
|
|
12
|
+
}
|
|
13
|
+
});
|
|
@@ -60,8 +60,10 @@ var ColorCard = function ColorCard(props) {
|
|
|
60
60
|
onMouseDown: handleMouseDown,
|
|
61
61
|
onKeyDown: handleKeyDown,
|
|
62
62
|
role: "radio",
|
|
63
|
-
"aria-checked": selected
|
|
64
|
-
|
|
63
|
+
"aria-checked": selected
|
|
64
|
+
}, !getBooleanFF('platform.jca11y-1559-dashboard-view-dashboard-remove-duplicate-aria-label_g5i3i') && {
|
|
65
|
+
'aria-label': label
|
|
66
|
+
}, {
|
|
65
67
|
tabIndex: 0
|
|
66
68
|
}, getBooleanFF('platform.color-picker-radio-button-functionality_6hkcy') && {
|
|
67
69
|
ref: ref
|
|
@@ -85,8 +87,10 @@ var ColorCard = function ColorCard(props) {
|
|
|
85
87
|
onMouseDown: handleMouseDown,
|
|
86
88
|
onKeyDown: handleKeyDown,
|
|
87
89
|
role: "radio",
|
|
88
|
-
"aria-checked": selected
|
|
89
|
-
|
|
90
|
+
"aria-checked": selected
|
|
91
|
+
}, !getBooleanFF('platform.jca11y-1559-dashboard-view-dashboard-remove-duplicate-aria-label_g5i3i') && {
|
|
92
|
+
'aria-label': label
|
|
93
|
+
}, {
|
|
90
94
|
tabIndex: 0
|
|
91
95
|
}, getBooleanFF('platform.color-picker-radio-button-functionality_6hkcy') && {
|
|
92
96
|
ref: ref
|
|
@@ -28,7 +28,7 @@ export var ColorPaletteMenuWithoutAnalytics = function ColorPaletteMenuWithoutAn
|
|
|
28
28
|
attributes: {
|
|
29
29
|
componentName: 'color-picker',
|
|
30
30
|
packageName: "@atlaskit/color-picker",
|
|
31
|
-
packageVersion: "3.2.
|
|
31
|
+
packageVersion: "3.2.10"
|
|
32
32
|
}
|
|
33
33
|
})(createAnalyticsEvent);
|
|
34
34
|
}
|
|
@@ -70,7 +70,7 @@ export var ColorPaletteMenuWithoutAnalytics = function ColorPaletteMenuWithoutAn
|
|
|
70
70
|
export default withAnalyticsContext({
|
|
71
71
|
componentName: 'color-picker',
|
|
72
72
|
packageName: "@atlaskit/color-picker",
|
|
73
|
-
packageVersion: "3.2.
|
|
73
|
+
packageVersion: "3.2.10"
|
|
74
74
|
})(withAnalyticsEvents()(ColorPaletteMenuWithoutAnalytics));
|
|
75
75
|
var colorCardWrapperStylesOld = css({
|
|
76
76
|
display: 'flex',
|
|
@@ -18,6 +18,8 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
18
18
|
import { getOptions } from '../utils';
|
|
19
19
|
import { css, jsx } from '@emotion/react';
|
|
20
20
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
21
|
+
import { injectIntl } from 'react-intl-next';
|
|
22
|
+
import messages from '../messages';
|
|
21
23
|
var defaultPopperProps = {
|
|
22
24
|
strategy: 'fixed',
|
|
23
25
|
modifiers: [{
|
|
@@ -29,13 +31,13 @@ var defaultPopperProps = {
|
|
|
29
31
|
placement: 'bottom-start'
|
|
30
32
|
};
|
|
31
33
|
var packageName = "@atlaskit/color-picker";
|
|
32
|
-
var packageVersion = "3.2.
|
|
33
|
-
|
|
34
|
-
_inherits(
|
|
35
|
-
var _super = _createSuper(
|
|
36
|
-
function
|
|
34
|
+
var packageVersion = "3.2.10";
|
|
35
|
+
var ColorPickerWithoutAnalyticsBase = /*#__PURE__*/function (_React$Component) {
|
|
36
|
+
_inherits(ColorPickerWithoutAnalyticsBase, _React$Component);
|
|
37
|
+
var _super = _createSuper(ColorPickerWithoutAnalyticsBase);
|
|
38
|
+
function ColorPickerWithoutAnalyticsBase() {
|
|
37
39
|
var _this;
|
|
38
|
-
_classCallCheck(this,
|
|
40
|
+
_classCallCheck(this, ColorPickerWithoutAnalyticsBase);
|
|
39
41
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
40
42
|
args[_key] = arguments[_key];
|
|
41
43
|
}
|
|
@@ -79,9 +81,26 @@ export var ColorPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component
|
|
|
79
81
|
e.stopPropagation();
|
|
80
82
|
}
|
|
81
83
|
});
|
|
84
|
+
_defineProperty(_assertThisInitialized(_this), "getFullLabel", function (intl, value, label) {
|
|
85
|
+
if (getBooleanFF('platform.jca11y-1480-inappropriate-label-for-color-picker_76tfe')) {
|
|
86
|
+
if (value && value.label) {
|
|
87
|
+
return intl.formatMessage(messages.colorPickerAriaLabel, {
|
|
88
|
+
color: value.label,
|
|
89
|
+
message: label
|
|
90
|
+
});
|
|
91
|
+
} else {
|
|
92
|
+
return label;
|
|
93
|
+
}
|
|
94
|
+
} else {
|
|
95
|
+
return intl.formatMessage(messages.colorPickerAriaLabelOldFormat, {
|
|
96
|
+
color: value.label,
|
|
97
|
+
message: label
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
});
|
|
82
101
|
return _this;
|
|
83
102
|
}
|
|
84
|
-
_createClass(
|
|
103
|
+
_createClass(ColorPickerWithoutAnalyticsBase, [{
|
|
85
104
|
key: "render",
|
|
86
105
|
value: function render() {
|
|
87
106
|
var _this$props = this.props,
|
|
@@ -96,11 +115,12 @@ export var ColorPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component
|
|
|
96
115
|
selectedColourSwatchSize = _this$props.selectedColourSwatchSize,
|
|
97
116
|
_this$props$showDefau = _this$props.showDefaultSwatchColor,
|
|
98
117
|
showDefaultSwatchColor = _this$props$showDefau === void 0 ? true : _this$props$showDefau,
|
|
99
|
-
isDisabledSelectedSwatch = _this$props.isDisabledSelectedSwatch
|
|
118
|
+
isDisabledSelectedSwatch = _this$props.isDisabledSelectedSwatch,
|
|
119
|
+
intl = _this$props.intl;
|
|
100
120
|
var _getOptions = getOptions(palette, selectedColor, showDefaultSwatchColor),
|
|
101
121
|
options = _getOptions.options,
|
|
102
122
|
value = _getOptions.value;
|
|
103
|
-
var fullLabel =
|
|
123
|
+
var fullLabel = this.getFullLabel(intl, value, label);
|
|
104
124
|
return jsx(PopupSelect, {
|
|
105
125
|
target: function target(_ref) {
|
|
106
126
|
var ref = _ref.ref,
|
|
@@ -137,8 +157,9 @@ export var ColorPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component
|
|
|
137
157
|
});
|
|
138
158
|
}
|
|
139
159
|
}]);
|
|
140
|
-
return
|
|
160
|
+
return ColorPickerWithoutAnalyticsBase;
|
|
141
161
|
}(React.Component);
|
|
162
|
+
export var ColorPickerWithoutAnalytics = injectIntl(ColorPickerWithoutAnalyticsBase);
|
|
142
163
|
export default withAnalyticsContext({
|
|
143
164
|
componentName: 'color-picker',
|
|
144
165
|
packageName: packageName,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export default defineMessages({
|
|
3
|
+
colorPickerAriaLabel: {
|
|
4
|
+
id: 'jira.color-picker.src.color-picker-aria-label',
|
|
5
|
+
defaultMessage: '{color} selected, {message}',
|
|
6
|
+
description: 'This text is used as aria-label text in color picker component'
|
|
7
|
+
},
|
|
8
|
+
colorPickerAriaLabelOldFormat: {
|
|
9
|
+
id: 'jira.color-picker.src.color-picker-aria-label-old-format',
|
|
10
|
+
defaultMessage: "{message}, {color} selected",
|
|
11
|
+
description: 'This text is used as aria-label text in color picker component'
|
|
12
|
+
}
|
|
13
|
+
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { PopupSelectProps
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { PopupSelectProps } from '@atlaskit/select';
|
|
4
|
+
import { Palette, SwatchSize } from '../types';
|
|
5
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
6
6
|
export interface Props {
|
|
7
7
|
/** color picker button label */
|
|
8
8
|
label?: string;
|
|
@@ -27,16 +27,8 @@ export interface Props {
|
|
|
27
27
|
/** diasble swatch button */
|
|
28
28
|
isDisabledSelectedSwatch?: boolean;
|
|
29
29
|
}
|
|
30
|
-
export declare
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
35
|
-
changeAnalyticsCaller: () => import("@atlaskit/analytics-next").UIAnalyticsEvent | undefined;
|
|
36
|
-
onChangeSelect: (option: ValueType<Color>) => void;
|
|
37
|
-
onOptionKeyDown: (value: string) => void;
|
|
38
|
-
onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
|
|
39
|
-
render(): jsx.JSX.Element;
|
|
40
|
-
}
|
|
41
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "label" | "analyticsContext" | "key" | "onChange" | "checkMarkColor" | "cols" | "popperProps" | "palette" | "selectedColor" | "selectedColourSwatchSize" | "showDefaultSwatchColor" | "isDisabledSelectedSwatch"> & React.RefAttributes<any>>;
|
|
30
|
+
export declare const ColorPickerWithoutAnalytics: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
31
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>; /** maximum column length */
|
|
32
|
+
};
|
|
33
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "label" | "analyticsContext" | "key" | "onChange" | "checkMarkColor" | "cols" | "popperProps" | "palette" | "selectedColor" | "selectedColourSwatchSize" | "showDefaultSwatchColor" | "isDisabledSelectedSwatch" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
42
34
|
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
colorPickerAriaLabel: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
colorPickerAriaLabelOldFormat: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { PopupSelectProps
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { PopupSelectProps } from '@atlaskit/select';
|
|
4
|
+
import { Palette, SwatchSize } from '../types';
|
|
5
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
6
6
|
export interface Props {
|
|
7
7
|
/** color picker button label */
|
|
8
8
|
label?: string;
|
|
@@ -27,16 +27,8 @@ export interface Props {
|
|
|
27
27
|
/** diasble swatch button */
|
|
28
28
|
isDisabledSelectedSwatch?: boolean;
|
|
29
29
|
}
|
|
30
|
-
export declare
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
35
|
-
changeAnalyticsCaller: () => import("@atlaskit/analytics-next").UIAnalyticsEvent | undefined;
|
|
36
|
-
onChangeSelect: (option: ValueType<Color>) => void;
|
|
37
|
-
onOptionKeyDown: (value: string) => void;
|
|
38
|
-
onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
|
|
39
|
-
render(): jsx.JSX.Element;
|
|
40
|
-
}
|
|
41
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "label" | "analyticsContext" | "key" | "onChange" | "checkMarkColor" | "cols" | "popperProps" | "palette" | "selectedColor" | "selectedColourSwatchSize" | "showDefaultSwatchColor" | "isDisabledSelectedSwatch"> & React.RefAttributes<any>>;
|
|
30
|
+
export declare const ColorPickerWithoutAnalytics: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
31
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>; /** maximum column length */
|
|
32
|
+
};
|
|
33
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "label" | "analyticsContext" | "key" | "onChange" | "checkMarkColor" | "cols" | "popperProps" | "palette" | "selectedColor" | "selectedColourSwatchSize" | "showDefaultSwatchColor" | "isDisabledSelectedSwatch" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
42
34
|
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
colorPickerAriaLabel: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
colorPickerAriaLabelOldFormat: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/color-picker",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.10",
|
|
4
4
|
"description": "Jira Color Picker Component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,23 +32,24 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/analytics-next": "^9.
|
|
35
|
+
"@atlaskit/analytics-next": "^9.3.0",
|
|
36
36
|
"@atlaskit/icon": "^22.1.0",
|
|
37
37
|
"@atlaskit/platform-feature-flags": "^0.2.5",
|
|
38
38
|
"@atlaskit/select": "^17.6.0",
|
|
39
39
|
"@atlaskit/theme": "^12.7.0",
|
|
40
|
-
"@atlaskit/tokens": "^1.
|
|
40
|
+
"@atlaskit/tokens": "^1.44.0",
|
|
41
41
|
"@atlaskit/tooltip": "^18.2.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0",
|
|
43
43
|
"@emotion/react": "^11.7.1",
|
|
44
|
-
"memoize-one": "^6.0.0"
|
|
44
|
+
"memoize-one": "^6.0.0",
|
|
45
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
45
46
|
},
|
|
46
47
|
"peerDependencies": {
|
|
47
48
|
"react": "^16.8.0"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
51
|
"@af/visual-regression": "*",
|
|
51
|
-
"@atlaskit/primitives": "^5.
|
|
52
|
+
"@atlaskit/primitives": "^5.6.0",
|
|
52
53
|
"@atlaskit/visual-regression": "*",
|
|
53
54
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
54
55
|
"@testing-library/react": "^12.1.5",
|
|
@@ -83,6 +84,12 @@
|
|
|
83
84
|
},
|
|
84
85
|
"platform.design-tokens-color-picker-portfolio-plan-wizard_w8rcl": {
|
|
85
86
|
"type": "boolean"
|
|
87
|
+
},
|
|
88
|
+
"platform.jca11y-1480-inappropriate-label-for-color-picker_76tfe": {
|
|
89
|
+
"type": "boolean"
|
|
90
|
+
},
|
|
91
|
+
"platform.jca11y-1559-dashboard-view-dashboard-remove-duplicate-aria-label_g5i3i": {
|
|
92
|
+
"type": "boolean"
|
|
86
93
|
}
|
|
87
94
|
}
|
|
88
95
|
}
|