@atlaskit/color-picker 3.2.15 → 3.2.16

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/color-picker
2
2
 
3
+ ## 3.2.16
4
+
5
+ ### Patch Changes
6
+
7
+ - [#107395](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107395)
8
+ [`9a4ffd1c2458e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9a4ffd1c2458e) -
9
+ added different label for radio item
10
+
3
11
  ## 3.2.15
4
12
 
5
13
  ### Patch Changes
@@ -12,8 +12,10 @@ var _done = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/done"));
12
12
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
13
13
  var _constants = require("../constants");
14
14
  var _react2 = require("@emotion/react");
15
+ var _reactIntlNext = require("react-intl-next");
15
16
  var _colors = require("@atlaskit/theme/colors");
16
17
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
+ var _messages = _interopRequireDefault(require("../messages"));
17
19
  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); }
18
20
  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; }
19
21
  /** @jsx jsx */
@@ -29,6 +31,8 @@ var ColorCard = function ColorCard(props) {
29
31
  onClick = props.onClick,
30
32
  onKeyDown = props.onKeyDown;
31
33
  var ref = (0, _react.useRef)(null);
34
+ var _useIntl = (0, _reactIntlNext.useIntl)(),
35
+ formatMessage = _useIntl.formatMessage;
32
36
  var handleMouseDown = (0, _react.useCallback)(function (event) {
33
37
  event.preventDefault();
34
38
  }, []);
@@ -70,8 +74,8 @@ var ColorCard = function ColorCard(props) {
70
74
  onKeyDown: handleKeyDown,
71
75
  role: "radio",
72
76
  "aria-checked": selected
73
- }, !(0, _platformFeatureFlags.getBooleanFF)('platform.jca11y-1559-dashboard-view-dashboard-remove-duplicate-aria-label_g5i3i') && {
74
- 'aria-label': label
77
+ }, (0, _platformFeatureFlags.getBooleanFF)('platform.jca11y-2997-remove-duplicate-screen-reader-announcements_fz13s') && {
78
+ 'aria-label': formatMessage(_messages.default.colorCardRadioItemLabel)
75
79
  }, {
76
80
  tabIndex: 0,
77
81
  ref: ref
@@ -91,6 +95,7 @@ var ColorCard = function ColorCard(props) {
91
95
  };
92
96
  var _default = exports.default = ColorCard;
93
97
  var colorCardOptionTabbingStyles = (0, _react2.css)({
98
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
94
99
  ':hover, :focus': {
95
100
  borderColor: "var(--ds-border-focused, ".concat(_colors.B75, ")")
96
101
  }
@@ -34,7 +34,7 @@ var ColorPaletteMenuWithoutAnalytics = exports.ColorPaletteMenuWithoutAnalytics
34
34
  attributes: {
35
35
  componentName: 'color-picker',
36
36
  packageName: "@atlaskit/color-picker",
37
- packageVersion: "3.2.15"
37
+ packageVersion: "3.2.16"
38
38
  }
39
39
  })(createAnalyticsEvent);
40
40
  }
@@ -49,13 +49,18 @@ var ColorPaletteMenuWithoutAnalytics = exports.ColorPaletteMenuWithoutAnalytics
49
49
  var fullLabel = "".concat(label, ", ").concat(selectedValue.label, " selected");
50
50
  return (0, _react.jsx)("div", {
51
51
  "aria-label": fullLabel,
52
- role: "radiogroup",
52
+ role: "radiogroup"
53
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
54
+ ,
53
55
  css: [colorPaletteMenuStyles, mode === _types.Mode.Standard && colorPaletteMenuStandardStyles],
54
56
  style: {
57
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
55
58
  width: "".concat((0, _utils.getWidth)(cols, mode), "px")
56
59
  }
57
60
  }, (0, _react.jsx)("div", {
58
- css: [colorPaletteContainerStyles, mode === _types.Mode.Compact && colorPaletteContainerCompactStyles]
61
+ css: [colorPaletteContainerStyles,
62
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
63
+ mode === _types.Mode.Compact && colorPaletteContainerCompactStyles]
59
64
  }, options.map(function (_ref2) {
60
65
  var label = _ref2.label,
61
66
  value = _ref2.value;
@@ -76,7 +81,7 @@ var ColorPaletteMenuWithoutAnalytics = exports.ColorPaletteMenuWithoutAnalytics
76
81
  var _default = exports.default = (0, _analyticsNext.withAnalyticsContext)({
77
82
  componentName: 'color-picker',
78
83
  packageName: "@atlaskit/color-picker",
79
- packageVersion: "3.2.15"
84
+ packageVersion: "3.2.16"
80
85
  })((0, _analyticsNext.withAnalyticsEvents)()(ColorPaletteMenuWithoutAnalytics));
81
86
  var colorCardWrapperStyles = (0, _react.css)({
82
87
  display: 'flex',
@@ -39,7 +39,7 @@ var defaultPopperProps = {
39
39
  placement: 'bottom-start'
40
40
  };
41
41
  var packageName = "@atlaskit/color-picker";
42
- var packageVersion = "3.2.15";
42
+ var packageVersion = "3.2.16";
43
43
  var ColorPickerWithoutAnalyticsBase = /*#__PURE__*/function (_React$Component) {
44
44
  (0, _inherits2.default)(ColorPickerWithoutAnalyticsBase, _React$Component);
45
45
  var _super = _createSuper(ColorPickerWithoutAnalyticsBase);
@@ -73,9 +73,11 @@ var defaultColorContainerSize = (0, _react2.css)({
73
73
  height: "var(--ds-space-400, 32px)"
74
74
  });
75
75
  var colorCardButtonStyles = (0, _react2.css)({
76
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
76
77
  ':hover': {
77
78
  borderColor: "var(--ds-background-neutral-subtle, ".concat(_colors.N0, ")")
78
79
  },
80
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
79
81
  ':not(:focus):hover, :focus': {
80
82
  borderColor: "var(--ds-border-focused, ".concat(_colors.B100, ")"),
81
83
  outline: 'none'
@@ -19,6 +19,7 @@ var MenuList = exports.MenuList = function MenuList(props) {
19
19
  css: colorPaletteContainerStyles,
20
20
  role: "radiogroup",
21
21
  style: {
22
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
22
23
  maxWidth: cols ? (0, _utils.getWidth)(cols) : undefined
23
24
  },
24
25
  ref: innerRef
@@ -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
+ colorCardRadioItemLabel: {
15
+ id: 'jira.color-picker.src.color-card-radio-item-label',
16
+ defaultMessage: 'color option',
17
+ description: 'This text is used as aria-label text in color card component for radio item'
13
18
  }
14
19
  });
@@ -5,8 +5,10 @@ import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
5
5
  import Tooltip from '@atlaskit/tooltip';
6
6
  import { KEY_ENTER, KEY_SPACE } from '../constants';
7
7
  import { css, jsx } from '@emotion/react';
8
+ import { useIntl } from 'react-intl-next';
8
9
  import { N0, DN600A, B75 } from '@atlaskit/theme/colors';
9
10
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
11
+ import messages from '../messages';
10
12
  const ColorCard = props => {
11
13
  const {
12
14
  value,
@@ -19,6 +21,9 @@ const ColorCard = props => {
19
21
  onKeyDown
20
22
  } = props;
21
23
  const ref = useRef(null);
24
+ const {
25
+ formatMessage
26
+ } = useIntl();
22
27
  const handleMouseDown = useCallback(event => {
23
28
  event.preventDefault();
24
29
  }, []);
@@ -62,8 +67,8 @@ const ColorCard = props => {
62
67
  onKeyDown: handleKeyDown,
63
68
  role: "radio",
64
69
  "aria-checked": selected
65
- }, !getBooleanFF('platform.jca11y-1559-dashboard-view-dashboard-remove-duplicate-aria-label_g5i3i') && {
66
- 'aria-label': label
70
+ }, getBooleanFF('platform.jca11y-2997-remove-duplicate-screen-reader-announcements_fz13s') && {
71
+ 'aria-label': formatMessage(messages.colorCardRadioItemLabel)
67
72
  }, {
68
73
  tabIndex: 0,
69
74
  ref: ref
@@ -83,6 +88,7 @@ const ColorCard = props => {
83
88
  };
84
89
  export default ColorCard;
85
90
  const colorCardOptionTabbingStyles = css({
91
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
86
92
  ':hover, :focus': {
87
93
  borderColor: `var(--ds-border-focused, ${B75})`
88
94
  }
@@ -24,7 +24,7 @@ export const ColorPaletteMenuWithoutAnalytics = ({
24
24
  attributes: {
25
25
  componentName: 'color-picker',
26
26
  packageName: "@atlaskit/color-picker",
27
- packageVersion: "3.2.15"
27
+ packageVersion: "3.2.16"
28
28
  }
29
29
  })(createAnalyticsEvent);
30
30
  }
@@ -40,13 +40,18 @@ export const ColorPaletteMenuWithoutAnalytics = ({
40
40
  const fullLabel = `${label}, ${selectedValue.label} selected`;
41
41
  return jsx("div", {
42
42
  "aria-label": fullLabel,
43
- role: "radiogroup",
43
+ role: "radiogroup"
44
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
45
+ ,
44
46
  css: [colorPaletteMenuStyles, mode === Mode.Standard && colorPaletteMenuStandardStyles],
45
47
  style: {
48
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
46
49
  width: `${getWidth(cols, mode)}px`
47
50
  }
48
51
  }, jsx("div", {
49
- css: [colorPaletteContainerStyles, mode === Mode.Compact && colorPaletteContainerCompactStyles]
52
+ css: [colorPaletteContainerStyles,
53
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
54
+ mode === Mode.Compact && colorPaletteContainerCompactStyles]
50
55
  }, options.map(({
51
56
  label,
52
57
  value
@@ -66,7 +71,7 @@ export const ColorPaletteMenuWithoutAnalytics = ({
66
71
  export default withAnalyticsContext({
67
72
  componentName: 'color-picker',
68
73
  packageName: "@atlaskit/color-picker",
69
- packageVersion: "3.2.15"
74
+ packageVersion: "3.2.16"
70
75
  })(withAnalyticsEvents()(ColorPaletteMenuWithoutAnalytics));
71
76
  const colorCardWrapperStyles = css({
72
77
  display: 'flex',
@@ -22,7 +22,7 @@ const defaultPopperProps = {
22
22
  placement: 'bottom-start'
23
23
  };
24
24
  const packageName = "@atlaskit/color-picker";
25
- const packageVersion = "3.2.15";
25
+ const packageVersion = "3.2.16";
26
26
  class ColorPickerWithoutAnalyticsBase extends React.Component {
27
27
  constructor(...args) {
28
28
  super(...args);
@@ -65,9 +65,11 @@ const defaultColorContainerSize = css({
65
65
  height: "var(--ds-space-400, 32px)"
66
66
  });
67
67
  const colorCardButtonStyles = css({
68
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
68
69
  ':hover': {
69
70
  borderColor: `var(--ds-background-neutral-subtle, ${N0})`
70
71
  },
72
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
71
73
  ':not(:focus):hover, :focus': {
72
74
  borderColor: `var(--ds-border-focused, ${B100})`,
73
75
  outline: 'none'
@@ -16,6 +16,7 @@ export const MenuList = props => {
16
16
  css: colorPaletteContainerStyles,
17
17
  role: "radiogroup",
18
18
  style: {
19
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
19
20
  maxWidth: cols ? getWidth(cols) : undefined
20
21
  },
21
22
  ref: innerRef
@@ -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
+ colorCardRadioItemLabel: {
9
+ id: 'jira.color-picker.src.color-card-radio-item-label',
10
+ defaultMessage: 'color option',
11
+ description: 'This text is used as aria-label text in color card component for radio item'
7
12
  }
8
13
  });
@@ -5,8 +5,10 @@ import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
5
5
  import Tooltip from '@atlaskit/tooltip';
6
6
  import { KEY_ENTER, KEY_SPACE } from '../constants';
7
7
  import { css, jsx } from '@emotion/react';
8
+ import { useIntl } from 'react-intl-next';
8
9
  import { N0, DN600A, B75 } from '@atlaskit/theme/colors';
9
10
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
11
+ import messages from '../messages';
10
12
  var ColorCard = function ColorCard(props) {
11
13
  var value = props.value,
12
14
  label = props.label,
@@ -18,6 +20,8 @@ var ColorCard = function ColorCard(props) {
18
20
  onClick = props.onClick,
19
21
  onKeyDown = props.onKeyDown;
20
22
  var ref = useRef(null);
23
+ var _useIntl = useIntl(),
24
+ formatMessage = _useIntl.formatMessage;
21
25
  var handleMouseDown = useCallback(function (event) {
22
26
  event.preventDefault();
23
27
  }, []);
@@ -59,8 +63,8 @@ var ColorCard = function ColorCard(props) {
59
63
  onKeyDown: handleKeyDown,
60
64
  role: "radio",
61
65
  "aria-checked": selected
62
- }, !getBooleanFF('platform.jca11y-1559-dashboard-view-dashboard-remove-duplicate-aria-label_g5i3i') && {
63
- 'aria-label': label
66
+ }, getBooleanFF('platform.jca11y-2997-remove-duplicate-screen-reader-announcements_fz13s') && {
67
+ 'aria-label': formatMessage(messages.colorCardRadioItemLabel)
64
68
  }, {
65
69
  tabIndex: 0,
66
70
  ref: ref
@@ -80,6 +84,7 @@ var ColorCard = function ColorCard(props) {
80
84
  };
81
85
  export default ColorCard;
82
86
  var colorCardOptionTabbingStyles = css({
87
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
83
88
  ':hover, :focus': {
84
89
  borderColor: "var(--ds-border-focused, ".concat(B75, ")")
85
90
  }
@@ -26,7 +26,7 @@ export var ColorPaletteMenuWithoutAnalytics = function ColorPaletteMenuWithoutAn
26
26
  attributes: {
27
27
  componentName: 'color-picker',
28
28
  packageName: "@atlaskit/color-picker",
29
- packageVersion: "3.2.15"
29
+ packageVersion: "3.2.16"
30
30
  }
31
31
  })(createAnalyticsEvent);
32
32
  }
@@ -41,13 +41,18 @@ export var ColorPaletteMenuWithoutAnalytics = function ColorPaletteMenuWithoutAn
41
41
  var fullLabel = "".concat(label, ", ").concat(selectedValue.label, " selected");
42
42
  return jsx("div", {
43
43
  "aria-label": fullLabel,
44
- role: "radiogroup",
44
+ role: "radiogroup"
45
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
46
+ ,
45
47
  css: [colorPaletteMenuStyles, mode === Mode.Standard && colorPaletteMenuStandardStyles],
46
48
  style: {
49
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
47
50
  width: "".concat(getWidth(cols, mode), "px")
48
51
  }
49
52
  }, jsx("div", {
50
- css: [colorPaletteContainerStyles, mode === Mode.Compact && colorPaletteContainerCompactStyles]
53
+ css: [colorPaletteContainerStyles,
54
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
55
+ mode === Mode.Compact && colorPaletteContainerCompactStyles]
51
56
  }, options.map(function (_ref2) {
52
57
  var label = _ref2.label,
53
58
  value = _ref2.value;
@@ -68,7 +73,7 @@ export var ColorPaletteMenuWithoutAnalytics = function ColorPaletteMenuWithoutAn
68
73
  export default withAnalyticsContext({
69
74
  componentName: 'color-picker',
70
75
  packageName: "@atlaskit/color-picker",
71
- packageVersion: "3.2.15"
76
+ packageVersion: "3.2.16"
72
77
  })(withAnalyticsEvents()(ColorPaletteMenuWithoutAnalytics));
73
78
  var colorCardWrapperStyles = css({
74
79
  display: 'flex',
@@ -30,7 +30,7 @@ var defaultPopperProps = {
30
30
  placement: 'bottom-start'
31
31
  };
32
32
  var packageName = "@atlaskit/color-picker";
33
- var packageVersion = "3.2.15";
33
+ var packageVersion = "3.2.16";
34
34
  var ColorPickerWithoutAnalyticsBase = /*#__PURE__*/function (_React$Component) {
35
35
  _inherits(ColorPickerWithoutAnalyticsBase, _React$Component);
36
36
  var _super = _createSuper(ColorPickerWithoutAnalyticsBase);
@@ -65,9 +65,11 @@ var defaultColorContainerSize = css({
65
65
  height: "var(--ds-space-400, 32px)"
66
66
  });
67
67
  var colorCardButtonStyles = css({
68
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
68
69
  ':hover': {
69
70
  borderColor: "var(--ds-background-neutral-subtle, ".concat(N0, ")")
70
71
  },
72
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
71
73
  ':not(:focus):hover, :focus': {
72
74
  borderColor: "var(--ds-border-focused, ".concat(B100, ")"),
73
75
  outline: 'none'
@@ -12,6 +12,7 @@ export var MenuList = function MenuList(props) {
12
12
  css: colorPaletteContainerStyles,
13
13
  role: "radiogroup",
14
14
  style: {
15
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
15
16
  maxWidth: cols ? getWidth(cols) : undefined
16
17
  },
17
18
  ref: innerRef
@@ -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
+ colorCardRadioItemLabel: {
9
+ id: 'jira.color-picker.src.color-card-radio-item-label',
10
+ defaultMessage: 'color option',
11
+ description: 'This text is used as aria-label text in color card component for radio item'
7
12
  }
8
13
  });
@@ -4,5 +4,10 @@ declare const _default: {
4
4
  defaultMessage: string;
5
5
  description: string;
6
6
  };
7
+ colorCardRadioItemLabel: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
7
12
  };
8
13
  export default _default;
@@ -4,5 +4,10 @@ declare const _default: {
4
4
  defaultMessage: string;
5
5
  description: string;
6
6
  };
7
+ colorCardRadioItemLabel: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
7
12
  };
8
13
  export default _default;
package/docs/0-intro.tsx CHANGED
@@ -17,6 +17,7 @@ const marginTopStyles = xcss({
17
17
  marginBottom: 'space.100',
18
18
  });
19
19
 
20
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
20
21
  export default md`
21
22
  ${(
22
23
  <>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/color-picker",
3
- "version": "3.2.15",
3
+ "version": "3.2.16",
4
4
  "description": "Jira Color Picker Component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -77,7 +77,7 @@
77
77
  }
78
78
  },
79
79
  "platform-feature-flags": {
80
- "platform.jca11y-1559-dashboard-view-dashboard-remove-duplicate-aria-label_g5i3i": {
80
+ "platform.jca11y-2997-remove-duplicate-screen-reader-announcements_fz13s": {
81
81
  "type": "boolean"
82
82
  }
83
83
  }