@atlaskit/color-picker 3.4.0 → 3.4.2
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 +17 -0
- package/dist/cjs/components/ColorCard.js +7 -3
- package/dist/cjs/components/ColorPaletteMenu.js +5 -3
- package/dist/cjs/components/ColorPicker.js +2 -1
- package/dist/cjs/components/components.js +17 -5
- package/dist/cjs/messages.js +5 -0
- package/dist/es2019/components/ColorCard.js +7 -3
- package/dist/es2019/components/ColorPaletteMenu.js +5 -3
- package/dist/es2019/components/ColorPicker.js +2 -1
- package/dist/es2019/components/components.js +20 -5
- package/dist/es2019/messages.js +5 -0
- package/dist/esm/components/ColorCard.js +7 -3
- package/dist/esm/components/ColorPaletteMenu.js +5 -3
- package/dist/esm/components/ColorPicker.js +2 -1
- package/dist/esm/components/components.js +17 -5
- package/dist/esm/messages.js +5 -0
- package/dist/types/components/ColorPicker.d.ts +3 -1
- package/dist/types/messages.d.ts +5 -0
- package/dist/types-ts4.5/components/ColorPicker.d.ts +3 -1
- package/dist/types-ts4.5/messages.d.ts +5 -0
- package/package.json +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/color-picker
|
|
2
2
|
|
|
3
|
+
## 3.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#150969](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/150969)
|
|
8
|
+
[`a15fc4e53f226`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a15fc4e53f226) -
|
|
9
|
+
Fixed a11y violations in ColorPicker and ColorPaletteMenu
|
|
10
|
+
|
|
11
|
+
## 3.4.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#143559](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/143559)
|
|
16
|
+
[`56dfbfe361f96`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/56dfbfe361f96) -
|
|
17
|
+
Upgrade react-select from 5.4 to 5.8 and replace it with internal atlaskit/react-select
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 3.4.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -93,16 +93,20 @@ var ColorCard = /*#__PURE__*/(0, _react.forwardRef)(function (props, componentRe
|
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
}, [autoFocus, isColorPaletteMenu, initialFocusRef]);
|
|
96
|
+
var isInsideMenuRole = isInsideMenu ? 'menuitemradio' : 'radio';
|
|
97
|
+
var role = isColorPaletteMenu ? isInsideMenuRole : 'presentation';
|
|
98
|
+
var ariaChecked = isColorPaletteMenu ? selected : undefined;
|
|
99
|
+
var ariaLabel = isColorPaletteMenu ? label : undefined;
|
|
96
100
|
return (0, _react2.jsx)(_tooltip.default, {
|
|
97
101
|
content: label
|
|
98
102
|
}, function (tooltipProps) {
|
|
99
103
|
delete tooltipProps['aria-describedby'];
|
|
100
104
|
return (0, _react2.jsx)("div", (0, _extends2.default)({}, tooltipProps, {
|
|
101
105
|
ref: initialFocusRef ? (0, _useCallbackRef.mergeRefs)([ref, tooltipProps.ref, initialFocusRef]) : (0, _useCallbackRef.mergeRefs)([ref, tooltipProps.ref]),
|
|
102
|
-
role:
|
|
106
|
+
role: (0, _platformFeatureFlags.fg)('platform_color_picker-fix-a11y-violations') ? role : isInsideMenuRole,
|
|
103
107
|
tabIndex: selected ? 0 : -1,
|
|
104
|
-
"aria-checked": selected,
|
|
105
|
-
"aria-label": label,
|
|
108
|
+
"aria-checked": (0, _platformFeatureFlags.fg)('platform_color_picker-fix-a11y-violations') ? ariaChecked : selected,
|
|
109
|
+
"aria-label": (0, _platformFeatureFlags.fg)('platform_color_picker-fix-a11y-violations') ? ariaLabel : label,
|
|
106
110
|
css: [sharedColorContainerStyles, (isColorPaletteMenu || isTabbing === undefined || isTabbing) && colorCardOptionTabbingStyles, focused && (isColorPaletteMenu || !isTabbing) && colorCardOptionFocusedStyles],
|
|
107
111
|
onClick: handleClick,
|
|
108
112
|
onMouseDown: handleMouseDown,
|
|
@@ -64,7 +64,7 @@ var ColorPaletteMenuWithoutAnalytics = exports.ColorPaletteMenuWithoutAnalytics
|
|
|
64
64
|
attributes: {
|
|
65
65
|
componentName: 'color-picker',
|
|
66
66
|
packageName: "@atlaskit/color-picker",
|
|
67
|
-
packageVersion: "3.4.
|
|
67
|
+
packageVersion: "3.4.2"
|
|
68
68
|
}
|
|
69
69
|
})(createAnalyticsEvent);
|
|
70
70
|
}
|
|
@@ -112,9 +112,11 @@ var ColorPaletteMenuWithoutAnalytics = exports.ColorPaletteMenuWithoutAnalytics
|
|
|
112
112
|
break;
|
|
113
113
|
}
|
|
114
114
|
}, [isFocusLockEnabled, selectedColorIndex, setFocusedIndex, options]);
|
|
115
|
+
var isInsideMenuRole = (0, _platformFeatureFlags.fg)('platform_color_picker-fix-a11y-violations') ? 'menu' : 'group';
|
|
116
|
+
var role = isInsideMenu ? isInsideMenuRole : 'radiogroup';
|
|
115
117
|
return (0, _react2.jsx)("div", {
|
|
116
118
|
"aria-label": fullLabel,
|
|
117
|
-
role:
|
|
119
|
+
role: role
|
|
118
120
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
119
121
|
,
|
|
120
122
|
css: [colorPaletteMenuStyles, mode === _types.Mode.Standard && colorPaletteMenuStandardStyles],
|
|
@@ -157,7 +159,7 @@ var ColorPaletteMenuWithoutAnalytics = exports.ColorPaletteMenuWithoutAnalytics
|
|
|
157
159
|
var _default = exports.default = (0, _analyticsNext.withAnalyticsContext)({
|
|
158
160
|
componentName: 'color-picker',
|
|
159
161
|
packageName: "@atlaskit/color-picker",
|
|
160
|
-
packageVersion: "3.4.
|
|
162
|
+
packageVersion: "3.4.2"
|
|
161
163
|
})((0, _analyticsNext.withAnalyticsEvents)()(ColorPaletteMenuWithoutAnalytics));
|
|
162
164
|
var colorCardWrapperStyles = (0, _react2.css)({
|
|
163
165
|
display: 'flex',
|
|
@@ -42,7 +42,7 @@ var defaultPopperProps = {
|
|
|
42
42
|
placement: 'bottom-start'
|
|
43
43
|
};
|
|
44
44
|
var packageName = "@atlaskit/color-picker";
|
|
45
|
-
var packageVersion = "3.4.
|
|
45
|
+
var packageVersion = "3.4.2";
|
|
46
46
|
var ColorPickerWithoutAnalyticsBase = /*#__PURE__*/function (_React$Component) {
|
|
47
47
|
(0, _inherits2.default)(ColorPickerWithoutAnalyticsBase, _React$Component);
|
|
48
48
|
var _super = _createSuper(ColorPickerWithoutAnalyticsBase);
|
|
@@ -153,6 +153,7 @@ var ColorPickerWithoutAnalyticsBase = /*#__PURE__*/function (_React$Component) {
|
|
|
153
153
|
,
|
|
154
154
|
searchThreshold: Number.MAX_VALUE
|
|
155
155
|
// palette props
|
|
156
|
+
//@ts-ignore react-select unsupported props
|
|
156
157
|
,
|
|
157
158
|
cols: cols,
|
|
158
159
|
checkMarkColor: checkMarkColor,
|
|
@@ -10,6 +10,9 @@ var _ColorCard = _interopRequireDefault(require("./ColorCard"));
|
|
|
10
10
|
var _utils = require("../utils");
|
|
11
11
|
var _react = require("@emotion/react");
|
|
12
12
|
var _constants = require("../constants");
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
|
+
var _reactIntlNext = require("react-intl-next");
|
|
15
|
+
var _messages = _interopRequireDefault(require("../messages"));
|
|
13
16
|
/**
|
|
14
17
|
* @jsxRuntime classic
|
|
15
18
|
* @jsx jsx
|
|
@@ -21,15 +24,22 @@ var MenuList = exports.MenuList = function MenuList(props) {
|
|
|
21
24
|
var cols = props.selectProps.cols,
|
|
22
25
|
innerRef = props.innerRef,
|
|
23
26
|
children = props.children;
|
|
24
|
-
|
|
27
|
+
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
28
|
+
formatMessage = _useIntl.formatMessage;
|
|
29
|
+
return (0, _react.jsx)("div", (0, _extends2.default)({
|
|
25
30
|
css: colorPaletteContainerStyles,
|
|
26
|
-
role:
|
|
31
|
+
role: (0, _platformFeatureFlags.fg)('platform_color_picker-fix-a11y-violations') ? 'listbox' : 'group'
|
|
32
|
+
}, (0, _platformFeatureFlags.fg)('platform_color_picker-fix-a11y-violations') ? {
|
|
33
|
+
'aria-label': formatMessage(_messages.default.menuListAriaLabel)
|
|
34
|
+
} : {}, {
|
|
27
35
|
style: {
|
|
28
36
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
29
37
|
maxWidth: cols ? (0, _utils.getWidth)(cols) : undefined
|
|
30
|
-
}
|
|
38
|
+
}
|
|
39
|
+
//@ts-ignore react-select unsupported props
|
|
40
|
+
,
|
|
31
41
|
ref: innerRef
|
|
32
|
-
}, children);
|
|
42
|
+
}), children);
|
|
33
43
|
};
|
|
34
44
|
var Option = exports.Option = function Option(props) {
|
|
35
45
|
var _props$data = props.data,
|
|
@@ -44,7 +54,9 @@ var Option = exports.Option = function Option(props) {
|
|
|
44
54
|
innerProps = props.innerProps;
|
|
45
55
|
return (0, _react.jsx)("div", (0, _extends2.default)({
|
|
46
56
|
css: colorCardWrapperStyles
|
|
47
|
-
}, innerProps
|
|
57
|
+
}, innerProps, (0, _platformFeatureFlags.fg)('platform_color_picker-fix-a11y-violations') ? {
|
|
58
|
+
'aria-label': label
|
|
59
|
+
} : {}), (0, _react.jsx)(_ColorCard.default, {
|
|
48
60
|
type: _constants.COLOR_PICKER,
|
|
49
61
|
label: label,
|
|
50
62
|
value: value,
|
package/dist/cjs/messages.js
CHANGED
|
@@ -10,5 +10,10 @@ var _default = exports.default = (0, _reactIntlNext.defineMessages)({
|
|
|
10
10
|
id: 'jira.color-picker.src.color-picker-aria-label',
|
|
11
11
|
defaultMessage: '{color} selected, {message}',
|
|
12
12
|
description: 'This text is used as aria-label text in color picker component'
|
|
13
|
+
},
|
|
14
|
+
menuListAriaLabel: {
|
|
15
|
+
id: 'jira.color-picker.src.menu-list-aria-label',
|
|
16
|
+
defaultMessage: 'Color picker list',
|
|
17
|
+
description: 'This text is used as aria-label text for the listbox element in color picker component'
|
|
13
18
|
}
|
|
14
19
|
});
|
|
@@ -78,16 +78,20 @@ const ColorCard = /*#__PURE__*/forwardRef((props, componentRef) => {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}), [autoFocus, isColorPaletteMenu, initialFocusRef]);
|
|
81
|
+
const isInsideMenuRole = isInsideMenu ? 'menuitemradio' : 'radio';
|
|
82
|
+
const role = isColorPaletteMenu ? isInsideMenuRole : 'presentation';
|
|
83
|
+
const ariaChecked = isColorPaletteMenu ? selected : undefined;
|
|
84
|
+
const ariaLabel = isColorPaletteMenu ? label : undefined;
|
|
81
85
|
return jsx(Tooltip, {
|
|
82
86
|
content: label
|
|
83
87
|
}, tooltipProps => {
|
|
84
88
|
delete tooltipProps['aria-describedby'];
|
|
85
89
|
return jsx("div", _extends({}, tooltipProps, {
|
|
86
90
|
ref: initialFocusRef ? mergeRefs([ref, tooltipProps.ref, initialFocusRef]) : mergeRefs([ref, tooltipProps.ref]),
|
|
87
|
-
role:
|
|
91
|
+
role: fg('platform_color_picker-fix-a11y-violations') ? role : isInsideMenuRole,
|
|
88
92
|
tabIndex: selected ? 0 : -1,
|
|
89
|
-
"aria-checked": selected,
|
|
90
|
-
"aria-label": label,
|
|
93
|
+
"aria-checked": fg('platform_color_picker-fix-a11y-violations') ? ariaChecked : selected,
|
|
94
|
+
"aria-label": fg('platform_color_picker-fix-a11y-violations') ? ariaLabel : label,
|
|
91
95
|
css: [sharedColorContainerStyles, (isColorPaletteMenu || isTabbing === undefined || isTabbing) && colorCardOptionTabbingStyles, focused && (isColorPaletteMenu || !isTabbing) && colorCardOptionFocusedStyles],
|
|
92
96
|
onClick: handleClick,
|
|
93
97
|
onMouseDown: handleMouseDown,
|
|
@@ -46,7 +46,7 @@ export const ColorPaletteMenuWithoutAnalytics = ({
|
|
|
46
46
|
attributes: {
|
|
47
47
|
componentName: 'color-picker',
|
|
48
48
|
packageName: "@atlaskit/color-picker",
|
|
49
|
-
packageVersion: "3.4.
|
|
49
|
+
packageVersion: "3.4.2"
|
|
50
50
|
}
|
|
51
51
|
})(createAnalyticsEvent);
|
|
52
52
|
}
|
|
@@ -88,9 +88,11 @@ export const ColorPaletteMenuWithoutAnalytics = ({
|
|
|
88
88
|
break;
|
|
89
89
|
}
|
|
90
90
|
}, [isFocusLockEnabled, selectedColorIndex, setFocusedIndex, options]);
|
|
91
|
+
const isInsideMenuRole = fg('platform_color_picker-fix-a11y-violations') ? 'menu' : 'group';
|
|
92
|
+
const role = isInsideMenu ? isInsideMenuRole : 'radiogroup';
|
|
91
93
|
return jsx("div", {
|
|
92
94
|
"aria-label": fullLabel,
|
|
93
|
-
role:
|
|
95
|
+
role: role
|
|
94
96
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
95
97
|
,
|
|
96
98
|
css: [colorPaletteMenuStyles, mode === Mode.Standard && colorPaletteMenuStandardStyles],
|
|
@@ -132,7 +134,7 @@ export const ColorPaletteMenuWithoutAnalytics = ({
|
|
|
132
134
|
export default withAnalyticsContext({
|
|
133
135
|
componentName: 'color-picker',
|
|
134
136
|
packageName: "@atlaskit/color-picker",
|
|
135
|
-
packageVersion: "3.4.
|
|
137
|
+
packageVersion: "3.4.2"
|
|
136
138
|
})(withAnalyticsEvents()(ColorPaletteMenuWithoutAnalytics));
|
|
137
139
|
const colorCardWrapperStyles = css({
|
|
138
140
|
display: 'flex',
|
|
@@ -26,7 +26,7 @@ const defaultPopperProps = {
|
|
|
26
26
|
placement: 'bottom-start'
|
|
27
27
|
};
|
|
28
28
|
const packageName = "@atlaskit/color-picker";
|
|
29
|
-
const packageVersion = "3.4.
|
|
29
|
+
const packageVersion = "3.4.2";
|
|
30
30
|
class ColorPickerWithoutAnalyticsBase extends React.Component {
|
|
31
31
|
constructor(...args) {
|
|
32
32
|
super(...args);
|
|
@@ -127,6 +127,7 @@ class ColorPickerWithoutAnalyticsBase extends React.Component {
|
|
|
127
127
|
,
|
|
128
128
|
searchThreshold: Number.MAX_VALUE
|
|
129
129
|
// palette props
|
|
130
|
+
//@ts-ignore react-select unsupported props
|
|
130
131
|
,
|
|
131
132
|
cols: cols,
|
|
132
133
|
checkMarkColor: checkMarkColor,
|
|
@@ -9,23 +9,35 @@ import { getWidth } from '../utils';
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
11
|
import { COLOR_PICKER } from '../constants';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
+
import { useIntl } from 'react-intl-next';
|
|
14
|
+
import messages from '../messages';
|
|
12
15
|
export const MenuList = props => {
|
|
13
16
|
const {
|
|
17
|
+
//@ts-ignore react-select unsupported props
|
|
14
18
|
selectProps: {
|
|
15
19
|
cols
|
|
16
20
|
},
|
|
17
21
|
innerRef,
|
|
18
22
|
children
|
|
19
23
|
} = props;
|
|
20
|
-
|
|
24
|
+
const {
|
|
25
|
+
formatMessage
|
|
26
|
+
} = useIntl();
|
|
27
|
+
return jsx("div", _extends({
|
|
21
28
|
css: colorPaletteContainerStyles,
|
|
22
|
-
role:
|
|
29
|
+
role: fg('platform_color_picker-fix-a11y-violations') ? 'listbox' : 'group'
|
|
30
|
+
}, fg('platform_color_picker-fix-a11y-violations') ? {
|
|
31
|
+
'aria-label': formatMessage(messages.menuListAriaLabel)
|
|
32
|
+
} : {}, {
|
|
23
33
|
style: {
|
|
24
34
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
25
35
|
maxWidth: cols ? getWidth(cols) : undefined
|
|
26
|
-
}
|
|
36
|
+
}
|
|
37
|
+
//@ts-ignore react-select unsupported props
|
|
38
|
+
,
|
|
27
39
|
ref: innerRef
|
|
28
|
-
}, children);
|
|
40
|
+
}), children);
|
|
29
41
|
};
|
|
30
42
|
export const Option = props => {
|
|
31
43
|
const {
|
|
@@ -33,6 +45,7 @@ export const Option = props => {
|
|
|
33
45
|
value,
|
|
34
46
|
label
|
|
35
47
|
},
|
|
48
|
+
//@ts-ignore react-select unsupported props
|
|
36
49
|
selectProps: {
|
|
37
50
|
checkMarkColor,
|
|
38
51
|
onOptionKeyDown,
|
|
@@ -44,7 +57,9 @@ export const Option = props => {
|
|
|
44
57
|
} = props;
|
|
45
58
|
return jsx("div", _extends({
|
|
46
59
|
css: colorCardWrapperStyles
|
|
47
|
-
}, innerProps
|
|
60
|
+
}, innerProps, fg('platform_color_picker-fix-a11y-violations') ? {
|
|
61
|
+
'aria-label': label
|
|
62
|
+
} : {}), jsx(ColorCard, {
|
|
48
63
|
type: COLOR_PICKER,
|
|
49
64
|
label: label,
|
|
50
65
|
value: value,
|
package/dist/es2019/messages.js
CHANGED
|
@@ -4,5 +4,10 @@ export default defineMessages({
|
|
|
4
4
|
id: 'jira.color-picker.src.color-picker-aria-label',
|
|
5
5
|
defaultMessage: '{color} selected, {message}',
|
|
6
6
|
description: 'This text is used as aria-label text in color picker component'
|
|
7
|
+
},
|
|
8
|
+
menuListAriaLabel: {
|
|
9
|
+
id: 'jira.color-picker.src.menu-list-aria-label',
|
|
10
|
+
defaultMessage: 'Color picker list',
|
|
11
|
+
description: 'This text is used as aria-label text for the listbox element in color picker component'
|
|
7
12
|
}
|
|
8
13
|
});
|
|
@@ -81,16 +81,20 @@ var ColorCard = /*#__PURE__*/forwardRef(function (props, componentRef) {
|
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
}, [autoFocus, isColorPaletteMenu, initialFocusRef]);
|
|
84
|
+
var isInsideMenuRole = isInsideMenu ? 'menuitemradio' : 'radio';
|
|
85
|
+
var role = isColorPaletteMenu ? isInsideMenuRole : 'presentation';
|
|
86
|
+
var ariaChecked = isColorPaletteMenu ? selected : undefined;
|
|
87
|
+
var ariaLabel = isColorPaletteMenu ? label : undefined;
|
|
84
88
|
return jsx(Tooltip, {
|
|
85
89
|
content: label
|
|
86
90
|
}, function (tooltipProps) {
|
|
87
91
|
delete tooltipProps['aria-describedby'];
|
|
88
92
|
return jsx("div", _extends({}, tooltipProps, {
|
|
89
93
|
ref: initialFocusRef ? mergeRefs([ref, tooltipProps.ref, initialFocusRef]) : mergeRefs([ref, tooltipProps.ref]),
|
|
90
|
-
role:
|
|
94
|
+
role: fg('platform_color_picker-fix-a11y-violations') ? role : isInsideMenuRole,
|
|
91
95
|
tabIndex: selected ? 0 : -1,
|
|
92
|
-
"aria-checked": selected,
|
|
93
|
-
"aria-label": label,
|
|
96
|
+
"aria-checked": fg('platform_color_picker-fix-a11y-violations') ? ariaChecked : selected,
|
|
97
|
+
"aria-label": fg('platform_color_picker-fix-a11y-violations') ? ariaLabel : label,
|
|
94
98
|
css: [sharedColorContainerStyles, (isColorPaletteMenu || isTabbing === undefined || isTabbing) && colorCardOptionTabbingStyles, focused && (isColorPaletteMenu || !isTabbing) && colorCardOptionFocusedStyles],
|
|
95
99
|
onClick: handleClick,
|
|
96
100
|
onMouseDown: handleMouseDown,
|
|
@@ -55,7 +55,7 @@ export var ColorPaletteMenuWithoutAnalytics = function ColorPaletteMenuWithoutAn
|
|
|
55
55
|
attributes: {
|
|
56
56
|
componentName: 'color-picker',
|
|
57
57
|
packageName: "@atlaskit/color-picker",
|
|
58
|
-
packageVersion: "3.4.
|
|
58
|
+
packageVersion: "3.4.2"
|
|
59
59
|
}
|
|
60
60
|
})(createAnalyticsEvent);
|
|
61
61
|
}
|
|
@@ -103,9 +103,11 @@ export var ColorPaletteMenuWithoutAnalytics = function ColorPaletteMenuWithoutAn
|
|
|
103
103
|
break;
|
|
104
104
|
}
|
|
105
105
|
}, [isFocusLockEnabled, selectedColorIndex, setFocusedIndex, options]);
|
|
106
|
+
var isInsideMenuRole = fg('platform_color_picker-fix-a11y-violations') ? 'menu' : 'group';
|
|
107
|
+
var role = isInsideMenu ? isInsideMenuRole : 'radiogroup';
|
|
106
108
|
return jsx("div", {
|
|
107
109
|
"aria-label": fullLabel,
|
|
108
|
-
role:
|
|
110
|
+
role: role
|
|
109
111
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
110
112
|
,
|
|
111
113
|
css: [colorPaletteMenuStyles, mode === Mode.Standard && colorPaletteMenuStandardStyles],
|
|
@@ -148,7 +150,7 @@ export var ColorPaletteMenuWithoutAnalytics = function ColorPaletteMenuWithoutAn
|
|
|
148
150
|
export default withAnalyticsContext({
|
|
149
151
|
componentName: 'color-picker',
|
|
150
152
|
packageName: "@atlaskit/color-picker",
|
|
151
|
-
packageVersion: "3.4.
|
|
153
|
+
packageVersion: "3.4.2"
|
|
152
154
|
})(withAnalyticsEvents()(ColorPaletteMenuWithoutAnalytics));
|
|
153
155
|
var colorCardWrapperStyles = css({
|
|
154
156
|
display: 'flex',
|
|
@@ -34,7 +34,7 @@ var defaultPopperProps = {
|
|
|
34
34
|
placement: 'bottom-start'
|
|
35
35
|
};
|
|
36
36
|
var packageName = "@atlaskit/color-picker";
|
|
37
|
-
var packageVersion = "3.4.
|
|
37
|
+
var packageVersion = "3.4.2";
|
|
38
38
|
var ColorPickerWithoutAnalyticsBase = /*#__PURE__*/function (_React$Component) {
|
|
39
39
|
_inherits(ColorPickerWithoutAnalyticsBase, _React$Component);
|
|
40
40
|
var _super = _createSuper(ColorPickerWithoutAnalyticsBase);
|
|
@@ -145,6 +145,7 @@ var ColorPickerWithoutAnalyticsBase = /*#__PURE__*/function (_React$Component) {
|
|
|
145
145
|
,
|
|
146
146
|
searchThreshold: Number.MAX_VALUE
|
|
147
147
|
// palette props
|
|
148
|
+
//@ts-ignore react-select unsupported props
|
|
148
149
|
,
|
|
149
150
|
cols: cols,
|
|
150
151
|
checkMarkColor: checkMarkColor,
|
|
@@ -9,19 +9,29 @@ import { getWidth } from '../utils';
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
11
|
import { COLOR_PICKER } from '../constants';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
+
import { useIntl } from 'react-intl-next';
|
|
14
|
+
import messages from '../messages';
|
|
12
15
|
export var MenuList = function MenuList(props) {
|
|
13
16
|
var cols = props.selectProps.cols,
|
|
14
17
|
innerRef = props.innerRef,
|
|
15
18
|
children = props.children;
|
|
16
|
-
|
|
19
|
+
var _useIntl = useIntl(),
|
|
20
|
+
formatMessage = _useIntl.formatMessage;
|
|
21
|
+
return jsx("div", _extends({
|
|
17
22
|
css: colorPaletteContainerStyles,
|
|
18
|
-
role:
|
|
23
|
+
role: fg('platform_color_picker-fix-a11y-violations') ? 'listbox' : 'group'
|
|
24
|
+
}, fg('platform_color_picker-fix-a11y-violations') ? {
|
|
25
|
+
'aria-label': formatMessage(messages.menuListAriaLabel)
|
|
26
|
+
} : {}, {
|
|
19
27
|
style: {
|
|
20
28
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
21
29
|
maxWidth: cols ? getWidth(cols) : undefined
|
|
22
|
-
}
|
|
30
|
+
}
|
|
31
|
+
//@ts-ignore react-select unsupported props
|
|
32
|
+
,
|
|
23
33
|
ref: innerRef
|
|
24
|
-
}, children);
|
|
34
|
+
}), children);
|
|
25
35
|
};
|
|
26
36
|
export var Option = function Option(props) {
|
|
27
37
|
var _props$data = props.data,
|
|
@@ -36,7 +46,9 @@ export var Option = function Option(props) {
|
|
|
36
46
|
innerProps = props.innerProps;
|
|
37
47
|
return jsx("div", _extends({
|
|
38
48
|
css: colorCardWrapperStyles
|
|
39
|
-
}, innerProps
|
|
49
|
+
}, innerProps, fg('platform_color_picker-fix-a11y-violations') ? {
|
|
50
|
+
'aria-label': label
|
|
51
|
+
} : {}), jsx(ColorCard, {
|
|
40
52
|
type: COLOR_PICKER,
|
|
41
53
|
label: label,
|
|
42
54
|
value: value,
|
package/dist/esm/messages.js
CHANGED
|
@@ -4,5 +4,10 @@ export default defineMessages({
|
|
|
4
4
|
id: 'jira.color-picker.src.color-picker-aria-label',
|
|
5
5
|
defaultMessage: '{color} selected, {message}',
|
|
6
6
|
description: 'This text is used as aria-label text in color picker component'
|
|
7
|
+
},
|
|
8
|
+
menuListAriaLabel: {
|
|
9
|
+
id: 'jira.color-picker.src.menu-list-aria-label',
|
|
10
|
+
defaultMessage: 'Color picker list',
|
|
11
|
+
description: 'This text is used as aria-label text for the listbox element in color picker component'
|
|
7
12
|
}
|
|
8
13
|
});
|
|
@@ -35,5 +35,7 @@ export interface Props {
|
|
|
35
35
|
export declare const ColorPickerWithoutAnalytics: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
36
36
|
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
37
37
|
};
|
|
38
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<
|
|
38
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Omit<Props & WrappedComponentProps, "intl"> & {
|
|
39
|
+
forwardedRef?: React.Ref<any> | undefined;
|
|
40
|
+
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "label" | "analyticsContext" | "key" | "onChange" | "checkMarkColor" | "cols" | "popperProps" | "palette" | "triggerId" | "selectedColor" | "selectedColourSwatchSize" | "showDefaultSwatchColor" | "isDisabledSelectedSwatch" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
39
41
|
export default _default;
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -35,5 +35,7 @@ export interface Props {
|
|
|
35
35
|
export declare const ColorPickerWithoutAnalytics: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
36
36
|
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
37
37
|
};
|
|
38
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<
|
|
38
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<Omit<Props & WrappedComponentProps, "intl"> & {
|
|
39
|
+
forwardedRef?: React.Ref<any> | undefined;
|
|
40
|
+
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "label" | "analyticsContext" | "key" | "onChange" | "checkMarkColor" | "cols" | "popperProps" | "palette" | "triggerId" | "selectedColor" | "selectedColourSwatchSize" | "showDefaultSwatchColor" | "isDisabledSelectedSwatch" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
39
41
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/color-picker",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2",
|
|
4
4
|
"description": "Jira Color Picker Component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
33
|
-
"@atlaskit/icon": "^22.
|
|
33
|
+
"@atlaskit/icon": "^22.22.0",
|
|
34
34
|
"@atlaskit/platform-feature-flags": "0.3.0",
|
|
35
|
-
"@atlaskit/select": "^
|
|
35
|
+
"@atlaskit/select": "^18.1.0",
|
|
36
36
|
"@atlaskit/theme": "^13.0.0",
|
|
37
37
|
"@atlaskit/tokens": "^2.0.0",
|
|
38
38
|
"@atlaskit/tooltip": "^18.8.0",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"@af/visual-regression": "*",
|
|
50
50
|
"@atlaskit/primitives": "^12.2.0",
|
|
51
51
|
"@atlaskit/visual-regression": "*",
|
|
52
|
+
"@atlassian/a11y-jest-testing": "*",
|
|
52
53
|
"@testing-library/react": "^12.1.5",
|
|
53
54
|
"@testing-library/user-event": "^14.4.3",
|
|
54
55
|
"ast-types": "^0.13.3",
|
|
@@ -80,6 +81,9 @@
|
|
|
80
81
|
},
|
|
81
82
|
"platform-design-system-dsp-20821-color-pickr-focus": {
|
|
82
83
|
"type": "boolean"
|
|
84
|
+
},
|
|
85
|
+
"platform_color_picker-fix-a11y-violations": {
|
|
86
|
+
"type": "boolean"
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
89
|
}
|