@atlaskit/progress-indicator 12.0.20 → 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,38 @@
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
+
10
+ ## 13.0.0
11
+
12
+ ### Major Changes
13
+
14
+ - [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
15
+ Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
16
+
17
+ Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
18
+
19
+ Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
20
+
21
+ ```diff
22
+ - "typesVersions": {
23
+ - ">=4.5 <4.9": {
24
+ - "*": [
25
+ - "dist/types-ts4.5/*",
26
+ - "dist/types-ts4.5/index.d.ts"
27
+ - ]
28
+ - }
29
+ - },
30
+ ```
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies
35
+
3
36
  ## 12.0.20
4
37
 
5
38
  ### Patch 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": "12.0.20",
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/"
@@ -31,11 +31,11 @@
31
31
  }
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/analytics-next": "^11.2.0",
35
- "@atlaskit/ds-lib": "^7.0.0",
36
- "@atlaskit/primitives": "^19.0.0",
37
- "@atlaskit/tokens": "^13.0.0",
38
- "@atlaskit/visually-hidden": "^3.0.0",
34
+ "@atlaskit/analytics-next": "^12.0.0",
35
+ "@atlaskit/ds-lib": "^8.0.0",
36
+ "@atlaskit/primitives": "^20.0.0",
37
+ "@atlaskit/tokens": "^14.0.0",
38
+ "@atlaskit/visually-hidden": "^4.0.0",
39
39
  "@babel/runtime": "^7.0.0",
40
40
  "@compiled/react": "^0.20.0",
41
41
  "bind-event-listener": "^3.0.0"
@@ -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": "^23.11.0",
51
- "@atlaskit/css": "^0.19.0",
52
- "@atlaskit/docs": "^11.7.0",
53
- "@atlaskit/link": "^3.4.0",
54
- "@atlaskit/section-message": "^8.12.0",
50
+ "@atlaskit/button": "^24.1.0",
51
+ "@atlaskit/css": "^1.0.0",
52
+ "@atlaskit/docs": "^12.0.0",
53
+ "@atlaskit/link": "^4.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:^",
@@ -59,6 +59,7 @@
59
59
  "@testing-library/user-event": "^14.4.3",
60
60
  "@types/jscodeshift": "^0.11.0",
61
61
  "jscodeshift": "^17.0.0",
62
+ "react": "^18.2.0",
62
63
  "react-dom": "^18.2.0",
63
64
  "react-lorem-component": "^0.13.0"
64
65
  },
@@ -85,13 +86,5 @@
85
86
  "deprecation": "no-deprecated-imports"
86
87
  }
87
88
  },
88
- "typesVersions": {
89
- ">=4.5 <4.9": {
90
- "*": [
91
- "dist/types-ts4.5/*",
92
- "dist/types-ts4.5/index.d.ts"
93
- ]
94
- }
95
- },
96
89
  "homepage": "https://atlassian.design/components/progress-indicator/"
97
90
  }
@@ -1,47 +1,49 @@
1
1
  import path from 'path';
2
2
 
3
- import type { ComponentStructuredContentSource } from '@atlassian/structured-docs-types';
3
+ import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
4
4
 
5
- const documentation: ComponentStructuredContentSource[] = [
6
- {
7
- name: 'ProgressIndicator',
8
- description: 'A component for displaying progress through steps or completion status.',
9
- status: 'general-availability',
10
- import: {
5
+ const documentation: StructuredContentSource = {
6
+ components: [
7
+ {
11
8
  name: 'ProgressIndicator',
12
- package: '@atlaskit/progress-indicator',
13
- type: 'named',
14
- packagePath: path.resolve(__dirname),
15
- packageJson: require('./package.json'),
16
- },
17
- usageGuidelines: [
18
- 'Use for step-by-step processes',
19
- 'Provide clear progress indicators',
20
- 'Handle progress updates appropriately',
21
- 'Consider progress completion states',
22
- ],
23
- contentGuidelines: [
24
- 'Use clear, descriptive step labels',
25
- 'Provide meaningful progress descriptions',
26
- 'Use appropriate progress terminology',
27
- 'Keep progress information concise',
28
- ],
29
- accessibilityGuidelines: [
30
- 'Ensure progress is announced by screen readers',
31
- 'Use appropriate progress indicators',
32
- 'Provide clear progress context',
33
- 'Consider progress timing and updates',
34
- ],
35
- examples: [
36
- {
37
- name: 'Progress Indicator',
38
- description: 'Progress Indicator example',
39
- source: path.resolve(__dirname, './examples/ai/progress-indicator.tsx'),
9
+ description: 'A component for displaying progress through steps or completion status.',
10
+ status: 'general-availability',
11
+ import: {
12
+ name: 'ProgressIndicator',
13
+ package: '@atlaskit/progress-indicator',
14
+ type: 'named',
15
+ packagePath: path.resolve(__dirname),
16
+ packageJson: require('./package.json'),
40
17
  },
41
- ],
42
- keywords: ['progress', 'indicator', 'steps', 'completion', 'status'],
43
- categories: ['feedback'],
44
- },
45
- ];
18
+ usageGuidelines: [
19
+ 'Use for step-by-step processes',
20
+ 'Provide clear progress indicators',
21
+ 'Handle progress updates appropriately',
22
+ 'Consider progress completion states',
23
+ ],
24
+ contentGuidelines: [
25
+ 'Use clear, descriptive step labels',
26
+ 'Provide meaningful progress descriptions',
27
+ 'Use appropriate progress terminology',
28
+ 'Keep progress information concise',
29
+ ],
30
+ accessibilityGuidelines: [
31
+ 'Ensure progress is announced by screen readers',
32
+ 'Use appropriate progress indicators',
33
+ 'Provide clear progress context',
34
+ 'Consider progress timing and updates',
35
+ ],
36
+ examples: [
37
+ {
38
+ name: 'Progress Indicator',
39
+ description: 'Progress Indicator example',
40
+ source: path.resolve(__dirname, './examples/ai/progress-indicator.tsx'),
41
+ },
42
+ ],
43
+ keywords: ['progress', 'indicator', 'steps', 'completion', 'status'],
44
+ categories: ['feedback'],
45
+ },
46
+ ],
47
+ };
46
48
 
47
49
  export default documentation;
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "**/*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/types.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/types.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/types.d.ts"
17
10
  }
@@ -1,34 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import type { DotsAppearance } from './types';
6
- type ButtonIndicatorProps = {
7
- panelId: string;
8
- tabId: string;
9
- appearance: DotsAppearance;
10
- isSelected: boolean;
11
- testId?: string;
12
- onClick(e: React.MouseEvent<HTMLButtonElement>): void;
13
- };
14
- /**
15
- * __Button indicator__
16
- *
17
- * A button indicator {description}.
18
- *
19
- * - [Examples](https://atlassian.design/components/{packageName}/examples)
20
- * - [Code](https://atlassian.design/components/{packageName}/code)
21
- * - [Usage](https://atlassian.design/components/{packageName}/usage)
22
- */
23
- export declare const ButtonIndicator: ({
24
- /**
25
- * __Button indicator__
26
- *
27
- * A button indicator {description}.
28
- *
29
- * - [Examples](https://atlassian.design/components/{packageName}/examples)
30
- * - [Code](https://atlassian.design/components/{packageName}/code)
31
- * - [Usage](https://atlassian.design/components/{packageName}/usage)
32
- */
33
- appearance, panelId, tabId, isSelected, onClick, testId, }: ButtonIndicatorProps) => JSX.Element;
34
- export {};
@@ -1,12 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import type { DotsAppearance } from './types';
6
- type PresentationalIndicatorProps = {
7
- appearance: DotsAppearance;
8
- isSelected: boolean;
9
- testId?: string;
10
- };
11
- export declare const PresentationalIndicator: ({ appearance, isSelected, testId, }: PresentationalIndicatorProps) => JSX.Element;
12
- export {};
@@ -1,9 +0,0 @@
1
- import { type FC } from 'react';
2
- import type { ProgressDotsProps } from '../types';
3
- /**
4
- * __ProgressDots__
5
- *
6
- * A progress indicator shows the user where they are along the steps of a journey.
7
- */
8
- declare const ProgressDots: FC<ProgressDotsProps>;
9
- export default ProgressDots;
@@ -1,3 +0,0 @@
1
- export type DotsAppearance = 'default' | 'help' | 'inverted' | 'primary';
2
- export type Spacing = 'comfortable' | 'cozy' | 'compact';
3
- export type Size = 'default' | 'large';
@@ -1,2 +0,0 @@
1
- export { default as ProgressIndicator } from './components/progress-dots';
2
- export type { ProgressDotsProps } from './types';
@@ -1,47 +0,0 @@
1
- import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import type { DotsAppearance, Size, Spacing } from './components/types';
3
- export interface ProgressDotsProps {
4
- /**
5
- * Sets the color of the indicators.
6
- */
7
- appearance?: DotsAppearance;
8
- /**
9
- * If interaction is enabled, use `ariaControls` to tell assistive technology what elements are controlled by the progress indicator.
10
- *
11
- * @default 'panel'
12
- */
13
- ariaControls?: string;
14
- /**
15
- * Describes what the indicator represents to assistive technology. The selected index number will be appended to the label.
16
- *
17
- * @default 'tab'
18
- */
19
- ariaLabel?: string;
20
- /**
21
- * Function called when an indicator is selected.
22
- */
23
- onSelect?: (eventData: {
24
- event: React.MouseEvent<HTMLButtonElement>;
25
- index: number;
26
- }, analyticsEvent: UIAnalyticsEvent) => void;
27
- /**
28
- * Which indicator is currently selected.
29
- */
30
- selectedIndex: number;
31
- /**
32
- * Sets the width and height of each indicator.
33
- */
34
- size?: Size;
35
- /**
36
- * Specifies how much of a gutter there is between indicators.
37
- */
38
- spacing?: Spacing;
39
- /**
40
- * A hook for automated tests.
41
- */
42
- testId?: string;
43
- /**
44
- * An array of values mapped over to create the indicators.
45
- */
46
- values: any[];
47
- }
package/offerings.json DELETED
@@ -1,34 +0,0 @@
1
- [
2
- {
3
- "name": "ProgressIndicator",
4
- "package": "@atlaskit/progress-indicator",
5
- "import": {
6
- "name": "ProgressIndicator",
7
- "package": "@atlaskit/progress-indicator",
8
- "type": "named"
9
- },
10
- "keywords": ["progress", "indicator", "steps", "completion", "status"],
11
- "categories": ["feedback"],
12
- "shortDescription": "A component for displaying progress through steps or completion status.",
13
- "status": "general-availability",
14
- "accessibilityGuidelines": [
15
- "Ensure progress is announced by screen readers",
16
- "Use appropriate progress indicators",
17
- "Provide clear progress context",
18
- "Consider progress timing and updates"
19
- ],
20
- "usageGuidelines": [
21
- "Use for step-by-step processes",
22
- "Provide clear progress indicators",
23
- "Handle progress updates appropriately",
24
- "Consider progress completion states"
25
- ],
26
- "contentGuidelines": [
27
- "Use clear, descriptive step labels",
28
- "Provide meaningful progress descriptions",
29
- "Use appropriate progress terminology",
30
- "Keep progress information concise"
31
- ],
32
- "examples": ["./examples/ai/progress-indicator.tsx"]
33
- }
34
- ]