@atlaskit/progress-indicator 13.0.0 → 13.0.1

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,12 @@
1
1
  # @atlaskit/progress-indicator
2
2
 
3
+ ## 13.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`6fa577ac3e5ea`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6fa577ac3e5ea) -
8
+ Add descriptive accessible labels for carousel controls and selectable progress indicators.
9
+
3
10
  ## 13.0.0
4
11
 
5
12
  ### Major Changes
@@ -57,6 +57,7 @@ var ButtonIndicator = exports.ButtonIndicator = function ButtonIndicator(_ref) {
57
57
  var appearance = _ref.appearance,
58
58
  panelId = _ref.panelId,
59
59
  tabId = _ref.tabId,
60
+ label = _ref.label,
60
61
  isSelected = _ref.isSelected,
61
62
  onClick = _ref.onClick,
62
63
  testId = _ref.testId;
@@ -72,5 +73,5 @@ var ButtonIndicator = exports.ButtonIndicator = function ButtonIndicator(_ref) {
72
73
  onClick: onClick,
73
74
  tabIndex: isSelected ? -1 : undefined,
74
75
  testId: testId
75
- }, /*#__PURE__*/React.createElement(_visuallyHidden.default, null, tabId));
76
+ }, /*#__PURE__*/React.createElement(_visuallyHidden.default, null, label));
76
77
  };
@@ -16,7 +16,7 @@ var _buttonIndicator = require("./button-indicator");
16
16
  var _presentationalIndicator = require("./presentational-indicator");
17
17
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
18
18
  var packageName = "@atlaskit/progress-indicator";
19
- var packageVersion = "12.0.20";
19
+ var packageVersion = "13.0.0";
20
20
  var progressIndicatorGapMap = {
21
21
  comfortable: {
22
22
  default: 'space.100',
@@ -50,6 +50,7 @@ var ProgressDots = function ProgressDots(_ref) {
50
50
  ariaControls = _ref$ariaControls === void 0 ? 'panel' : _ref$ariaControls,
51
51
  _ref$ariaLabel = _ref.ariaLabel,
52
52
  ariaLabel = _ref$ariaLabel === void 0 ? 'tab' : _ref$ariaLabel,
53
+ getAriaLabel = _ref.getAriaLabel,
53
54
  _ref$size = _ref.size,
54
55
  size = _ref$size === void 0 ? 'default' : _ref$size,
55
56
  _ref$spacing = _ref.spacing,
@@ -127,6 +128,7 @@ var ProgressDots = function ProgressDots(_ref) {
127
128
  var isSelected = selectedIndex === index;
128
129
  var tabId = "".concat(ariaLabel).concat(index);
129
130
  var panelId = "".concat(ariaControls).concat(index);
131
+ var label = getAriaLabel ? getAriaLabel(index) : tabId;
130
132
  var indicatorTestId = testId && "".concat(testId, "-ind-").concat(index);
131
133
  return onSelect ? /*#__PURE__*/_react.default.createElement(_buttonIndicator.ButtonIndicator, {
132
134
  key: index,
@@ -135,6 +137,7 @@ var ProgressDots = function ProgressDots(_ref) {
135
137
  isSelected: isSelected,
136
138
  tabId: tabId,
137
139
  panelId: panelId,
140
+ label: label,
138
141
  onClick: function onClick(event) {
139
142
  return onSelectWithAnalytics({
140
143
  event: event,
@@ -48,6 +48,7 @@ export const ButtonIndicator = ({
48
48
  appearance,
49
49
  panelId,
50
50
  tabId,
51
+ label,
51
52
  isSelected,
52
53
  onClick,
53
54
  testId
@@ -64,5 +65,5 @@ export const ButtonIndicator = ({
64
65
  onClick: onClick,
65
66
  tabIndex: isSelected ? -1 : undefined,
66
67
  testId: testId
67
- }, /*#__PURE__*/React.createElement(VisuallyHidden, null, tabId));
68
+ }, /*#__PURE__*/React.createElement(VisuallyHidden, null, label));
68
69
  };
@@ -6,7 +6,7 @@ import { Box, Inline } from '@atlaskit/primitives/compiled';
6
6
  import { ButtonIndicator } from './button-indicator';
7
7
  import { PresentationalIndicator } from './presentational-indicator';
8
8
  const packageName = "@atlaskit/progress-indicator";
9
- const packageVersion = "12.0.20";
9
+ const packageVersion = "13.0.0";
10
10
  const progressIndicatorGapMap = {
11
11
  comfortable: {
12
12
  default: 'space.100',
@@ -37,6 +37,7 @@ const ProgressDots = ({
37
37
  appearance = 'default',
38
38
  ariaControls = 'panel',
39
39
  ariaLabel = 'tab',
40
+ getAriaLabel,
40
41
  size = 'default',
41
42
  // NOTE: `spacing` is a reserved HTML attribute and will be added to the
42
43
  // element, replaced with `gutter`.
@@ -119,6 +120,7 @@ const ProgressDots = ({
119
120
  const isSelected = selectedIndex === index;
120
121
  const tabId = `${ariaLabel}${index}`;
121
122
  const panelId = `${ariaControls}${index}`;
123
+ const label = getAriaLabel ? getAriaLabel(index) : tabId;
122
124
  const indicatorTestId = testId && `${testId}-ind-${index}`;
123
125
  return onSelect ? /*#__PURE__*/React.createElement(ButtonIndicator, {
124
126
  key: index,
@@ -127,6 +129,7 @@ const ProgressDots = ({
127
129
  isSelected: isSelected,
128
130
  tabId: tabId,
129
131
  panelId: panelId,
132
+ label: label,
130
133
  onClick: event => onSelectWithAnalytics({
131
134
  event,
132
135
  index
@@ -48,6 +48,7 @@ export var ButtonIndicator = function ButtonIndicator(_ref) {
48
48
  var appearance = _ref.appearance,
49
49
  panelId = _ref.panelId,
50
50
  tabId = _ref.tabId,
51
+ label = _ref.label,
51
52
  isSelected = _ref.isSelected,
52
53
  onClick = _ref.onClick,
53
54
  testId = _ref.testId;
@@ -63,5 +64,5 @@ export var ButtonIndicator = function ButtonIndicator(_ref) {
63
64
  onClick: onClick,
64
65
  tabIndex: isSelected ? -1 : undefined,
65
66
  testId: testId
66
- }, /*#__PURE__*/React.createElement(VisuallyHidden, null, tabId));
67
+ }, /*#__PURE__*/React.createElement(VisuallyHidden, null, label));
67
68
  };
@@ -7,7 +7,7 @@ import { Box, Inline } from '@atlaskit/primitives/compiled';
7
7
  import { ButtonIndicator } from './button-indicator';
8
8
  import { PresentationalIndicator } from './presentational-indicator';
9
9
  var packageName = "@atlaskit/progress-indicator";
10
- var packageVersion = "12.0.20";
10
+ var packageVersion = "13.0.0";
11
11
  var progressIndicatorGapMap = {
12
12
  comfortable: {
13
13
  default: 'space.100',
@@ -41,6 +41,7 @@ var ProgressDots = function ProgressDots(_ref) {
41
41
  ariaControls = _ref$ariaControls === void 0 ? 'panel' : _ref$ariaControls,
42
42
  _ref$ariaLabel = _ref.ariaLabel,
43
43
  ariaLabel = _ref$ariaLabel === void 0 ? 'tab' : _ref$ariaLabel,
44
+ getAriaLabel = _ref.getAriaLabel,
44
45
  _ref$size = _ref.size,
45
46
  size = _ref$size === void 0 ? 'default' : _ref$size,
46
47
  _ref$spacing = _ref.spacing,
@@ -118,6 +119,7 @@ var ProgressDots = function ProgressDots(_ref) {
118
119
  var isSelected = selectedIndex === index;
119
120
  var tabId = "".concat(ariaLabel).concat(index);
120
121
  var panelId = "".concat(ariaControls).concat(index);
122
+ var label = getAriaLabel ? getAriaLabel(index) : tabId;
121
123
  var indicatorTestId = testId && "".concat(testId, "-ind-").concat(index);
122
124
  return onSelect ? /*#__PURE__*/React.createElement(ButtonIndicator, {
123
125
  key: index,
@@ -126,6 +128,7 @@ var ProgressDots = function ProgressDots(_ref) {
126
128
  isSelected: isSelected,
127
129
  tabId: tabId,
128
130
  panelId: panelId,
131
+ label: label,
129
132
  onClick: function onClick(event) {
130
133
  return onSelectWithAnalytics({
131
134
  event: event,
@@ -6,6 +6,7 @@ import type { DotsAppearance } from './types';
6
6
  type ButtonIndicatorProps = {
7
7
  panelId: string;
8
8
  tabId: string;
9
+ label: string;
9
10
  appearance: DotsAppearance;
10
11
  isSelected: boolean;
11
12
  testId?: string;
@@ -30,5 +31,5 @@ export declare const ButtonIndicator: ({
30
31
  * - [Code](https://atlassian.design/components/{packageName}/code)
31
32
  * - [Usage](https://atlassian.design/components/{packageName}/usage)
32
33
  */
33
- appearance, panelId, tabId, isSelected, onClick, testId, }: ButtonIndicatorProps) => JSX.Element;
34
+ appearance, panelId, tabId, label, isSelected, onClick, testId, }: ButtonIndicatorProps) => JSX.Element;
34
35
  export {};
@@ -17,6 +17,10 @@ export interface ProgressDotsProps {
17
17
  * @default 'tab'
18
18
  */
19
19
  ariaLabel?: string;
20
+ /**
21
+ * Returns the accessible label for each selectable indicator.
22
+ */
23
+ getAriaLabel?: (index: number) => string;
20
24
  /**
21
25
  * Function called when an indicator is selected.
22
26
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-indicator",
3
- "version": "13.0.0",
3
+ "version": "13.0.1",
4
4
  "description": "A progress indicator shows the user where they are along the steps of a journey.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -47,11 +47,11 @@
47
47
  "@af/accessibility-testing": "workspace:^",
48
48
  "@af/integration-testing": "workspace:^",
49
49
  "@af/visual-regression": "workspace:^",
50
- "@atlaskit/button": "^24.0.0",
50
+ "@atlaskit/button": "^24.1.0",
51
51
  "@atlaskit/css": "^1.0.0",
52
52
  "@atlaskit/docs": "^12.0.0",
53
53
  "@atlaskit/link": "^4.0.0",
54
- "@atlaskit/section-message": "^9.0.0",
54
+ "@atlaskit/section-message": "^9.1.0",
55
55
  "@atlassian/react-compiler-gating": "workspace:^",
56
56
  "@atlassian/ssr-tests": "workspace:^",
57
57
  "@atlassian/structured-docs-types": "workspace:^",