@atlaskit/progress-indicator 9.5.18 → 10.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,17 @@
1
1
  # @atlaskit/progress-indicator
2
2
 
3
+ ## 10.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 10.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - [#41812](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41812) [`48b3b440f51`](https://bitbucket.org/atlassian/atlassian-frontend/commits/48b3b440f51) - Removed all remaining legacy theming logic from the Icon and ProgressIndicator components.
14
+
3
15
  ## 9.5.18
4
16
 
5
17
  ### Patch Changes
@@ -5,43 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getBgColor = void 0;
7
7
  var _colors = require("@atlaskit/theme/colors");
8
- var _components = require("@atlaskit/theme/components");
9
8
  // TODO Token usages are not consistent for dots https://product-fabric.atlassian.net/browse/DSP-3180
10
9
  var colorMap = {
11
- default: (0, _components.themed)({
12
- light: "var(--ds-background-neutral, ".concat(_colors.N50, ")"),
13
- dark: "var(--ds-background-neutral, ".concat(_colors.DN70, ")")
14
- }),
15
- help: (0, _components.themed)({
16
- light: "var(--ds-background-neutral, ".concat(_colors.P75, ")"),
17
- dark: "var(--ds-background-neutral, ".concat(_colors.DN70, ")")
18
- }),
19
- inverted: (0, _components.themed)({
20
- light: "var(--ds-icon-subtle, rgba(255, 255, 255, 0.4))",
21
- dark: "var(--ds-icon-subtle, ".concat(_colors.DN300A, ")")
22
- }),
23
- primary: (0, _components.themed)({
24
- light: "var(--ds-background-neutral, ".concat(_colors.B75, ")"),
25
- dark: "var(--ds-background-neutral, ".concat(_colors.DN70, ")")
26
- })
10
+ default: "var(--ds-background-neutral, ".concat(_colors.N50, ")"),
11
+ help: "var(--ds-background-neutral, ".concat(_colors.P75, ")"),
12
+ inverted: "var(--ds-icon-subtle, rgba(255, 255, 255, 0.4))",
13
+ primary: "var(--ds-background-neutral, ".concat(_colors.B75, ")")
27
14
  };
28
15
  var selectedColorMap = {
29
- default: (0, _components.themed)({
30
- light: "var(--ds-icon, ".concat(_colors.N900, ")"),
31
- dark: "var(--ds-icon, ".concat(_colors.DN600, ")")
32
- }),
33
- help: (0, _components.themed)({
34
- light: "var(--ds-icon-discovery, ".concat(_colors.P400, ")"),
35
- dark: "var(--ds-icon-discovery, ".concat(_colors.P300, ")")
36
- }),
37
- inverted: (0, _components.themed)({
38
- light: "var(--ds-icon-inverse, ".concat(_colors.N0, ")"),
39
- dark: "var(--ds-icon-inverse, ".concat(_colors.DN30, ")")
40
- }),
41
- primary: (0, _components.themed)({
42
- light: "var(--ds-icon-brand, ".concat(_colors.B400, ")"),
43
- dark: "var(--ds-icon-brand, ".concat(_colors.B100, ")")
44
- })
16
+ default: "var(--ds-icon, ".concat(_colors.N900, ")"),
17
+ help: "var(--ds-icon-discovery, ".concat(_colors.P400, ")"),
18
+ inverted: "var(--ds-icon-inverse, ".concat(_colors.N0, ")"),
19
+ primary: "var(--ds-icon-brand, ".concat(_colors.B400, ")")
45
20
  };
46
21
  var getBgColor = exports.getBgColor = function getBgColor(appearance, isSelected) {
47
22
  return isSelected ? selectedColorMap[appearance] : colorMap[appearance];
@@ -14,7 +14,6 @@ var _bindEventListener = require("bind-event-listener");
14
14
  var _analyticsNext = require("@atlaskit/analytics-next");
15
15
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
16
16
  var _primitives = require("@atlaskit/primitives");
17
- var _components = require("@atlaskit/theme/components");
18
17
  var _appearances = require("./appearances");
19
18
  var _constants = require("./constants");
20
19
  var _indicator = require("./indicator");
@@ -23,7 +22,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
23
22
  /** @jsx jsx */
24
23
 
25
24
  var packageName = "@atlaskit/progress-indicator";
26
- var packageVersion = "9.5.18";
25
+ var packageVersion = "10.0.1";
27
26
 
28
27
  /**
29
28
  * __ProgressDots__
@@ -103,7 +102,6 @@ var ProgressDots = function ProgressDots(_ref) {
103
102
  }
104
103
  });
105
104
  }, [onSelect, handleKeyDown]);
106
- var theme = (0, _components.useGlobalTheme)();
107
105
  return (0, _react2.jsx)(_primitives.Box, {
108
106
  style: (_ref2 = {}, (0, _defineProperty2.default)(_ref2, _constants.varDotsSize, "".concat(_constants.sizes[size], "px")), (0, _defineProperty2.default)(_ref2, _constants.varDotsMargin, rawGapValue), _ref2),
109
107
  role: onSelect && 'tablist'
@@ -118,9 +116,7 @@ var ProgressDots = function ProgressDots(_ref) {
118
116
  var isSelected = selectedIndex === index;
119
117
  var tabId = "".concat(ariaLabel).concat(index);
120
118
  var panelId = "".concat(ariaControls).concat(index);
121
- var backgroundColor = (0, _appearances.getBgColor)(appearance, isSelected)({
122
- theme: theme
123
- });
119
+ var backgroundColor = (0, _appearances.getBgColor)(appearance, isSelected);
124
120
  return onSelect ? (0, _react2.jsx)(_indicator.ButtonIndicator, {
125
121
  key: index,
126
122
  style: {
@@ -1,40 +1,15 @@
1
- import { B100, B400, B75, DN30, DN300A, DN600, DN70, N0, N50, N900, P300, P400, P75 } from '@atlaskit/theme/colors';
2
- import { themed } from '@atlaskit/theme/components';
1
+ import { B400, B75, N0, N50, N900, P400, P75 } from '@atlaskit/theme/colors';
3
2
  // TODO Token usages are not consistent for dots https://product-fabric.atlassian.net/browse/DSP-3180
4
3
  const colorMap = {
5
- default: themed({
6
- light: `var(--ds-background-neutral, ${N50})`,
7
- dark: `var(--ds-background-neutral, ${DN70})`
8
- }),
9
- help: themed({
10
- light: `var(--ds-background-neutral, ${P75})`,
11
- dark: `var(--ds-background-neutral, ${DN70})`
12
- }),
13
- inverted: themed({
14
- light: "var(--ds-icon-subtle, rgba(255, 255, 255, 0.4))",
15
- dark: `var(--ds-icon-subtle, ${DN300A})`
16
- }),
17
- primary: themed({
18
- light: `var(--ds-background-neutral, ${B75})`,
19
- dark: `var(--ds-background-neutral, ${DN70})`
20
- })
4
+ default: `var(--ds-background-neutral, ${N50})`,
5
+ help: `var(--ds-background-neutral, ${P75})`,
6
+ inverted: "var(--ds-icon-subtle, rgba(255, 255, 255, 0.4))",
7
+ primary: `var(--ds-background-neutral, ${B75})`
21
8
  };
22
9
  const selectedColorMap = {
23
- default: themed({
24
- light: `var(--ds-icon, ${N900})`,
25
- dark: `var(--ds-icon, ${DN600})`
26
- }),
27
- help: themed({
28
- light: `var(--ds-icon-discovery, ${P400})`,
29
- dark: `var(--ds-icon-discovery, ${P300})`
30
- }),
31
- inverted: themed({
32
- light: `var(--ds-icon-inverse, ${N0})`,
33
- dark: `var(--ds-icon-inverse, ${DN30})`
34
- }),
35
- primary: themed({
36
- light: `var(--ds-icon-brand, ${B400})`,
37
- dark: `var(--ds-icon-brand, ${B100})`
38
- })
10
+ default: `var(--ds-icon, ${N900})`,
11
+ help: `var(--ds-icon-discovery, ${P400})`,
12
+ inverted: `var(--ds-icon-inverse, ${N0})`,
13
+ primary: `var(--ds-icon-brand, ${B400})`
39
14
  };
40
15
  export const getBgColor = (appearance, isSelected) => isSelected ? selectedColorMap[appearance] : colorMap[appearance];
@@ -5,12 +5,11 @@ import { bind } from 'bind-event-listener';
5
5
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
6
6
  import noop from '@atlaskit/ds-lib/noop';
7
7
  import { Box, Inline } from '@atlaskit/primitives';
8
- import { useGlobalTheme } from '@atlaskit/theme/components';
9
8
  import { getBgColor } from './appearances';
10
9
  import { progressIndicatorGapMap, sizes, varDotsMargin, varDotsSize } from './constants';
11
10
  import { ButtonIndicator, PresentationalIndicator } from './indicator';
12
11
  const packageName = "@atlaskit/progress-indicator";
13
- const packageVersion = "9.5.18";
12
+ const packageVersion = "10.0.1";
14
13
 
15
14
  /**
16
15
  * __ProgressDots__
@@ -85,7 +84,6 @@ const ProgressDots = ({
85
84
  }
86
85
  });
87
86
  }, [onSelect, handleKeyDown]);
88
- const theme = useGlobalTheme();
89
87
  return jsx(Box, {
90
88
  style: {
91
89
  [varDotsSize]: `${sizes[size]}px`,
@@ -103,9 +101,7 @@ const ProgressDots = ({
103
101
  const isSelected = selectedIndex === index;
104
102
  const tabId = `${ariaLabel}${index}`;
105
103
  const panelId = `${ariaControls}${index}`;
106
- const backgroundColor = getBgColor(appearance, isSelected)({
107
- theme
108
- });
104
+ const backgroundColor = getBgColor(appearance, isSelected);
109
105
  return onSelect ? jsx(ButtonIndicator, {
110
106
  key: index,
111
107
  style: {
@@ -1,41 +1,16 @@
1
- import { B100, B400, B75, DN30, DN300A, DN600, DN70, N0, N50, N900, P300, P400, P75 } from '@atlaskit/theme/colors';
2
- import { themed } from '@atlaskit/theme/components';
1
+ import { B400, B75, N0, N50, N900, P400, P75 } from '@atlaskit/theme/colors';
3
2
  // TODO Token usages are not consistent for dots https://product-fabric.atlassian.net/browse/DSP-3180
4
3
  var colorMap = {
5
- default: themed({
6
- light: "var(--ds-background-neutral, ".concat(N50, ")"),
7
- dark: "var(--ds-background-neutral, ".concat(DN70, ")")
8
- }),
9
- help: themed({
10
- light: "var(--ds-background-neutral, ".concat(P75, ")"),
11
- dark: "var(--ds-background-neutral, ".concat(DN70, ")")
12
- }),
13
- inverted: themed({
14
- light: "var(--ds-icon-subtle, rgba(255, 255, 255, 0.4))",
15
- dark: "var(--ds-icon-subtle, ".concat(DN300A, ")")
16
- }),
17
- primary: themed({
18
- light: "var(--ds-background-neutral, ".concat(B75, ")"),
19
- dark: "var(--ds-background-neutral, ".concat(DN70, ")")
20
- })
4
+ default: "var(--ds-background-neutral, ".concat(N50, ")"),
5
+ help: "var(--ds-background-neutral, ".concat(P75, ")"),
6
+ inverted: "var(--ds-icon-subtle, rgba(255, 255, 255, 0.4))",
7
+ primary: "var(--ds-background-neutral, ".concat(B75, ")")
21
8
  };
22
9
  var selectedColorMap = {
23
- default: themed({
24
- light: "var(--ds-icon, ".concat(N900, ")"),
25
- dark: "var(--ds-icon, ".concat(DN600, ")")
26
- }),
27
- help: themed({
28
- light: "var(--ds-icon-discovery, ".concat(P400, ")"),
29
- dark: "var(--ds-icon-discovery, ".concat(P300, ")")
30
- }),
31
- inverted: themed({
32
- light: "var(--ds-icon-inverse, ".concat(N0, ")"),
33
- dark: "var(--ds-icon-inverse, ".concat(DN30, ")")
34
- }),
35
- primary: themed({
36
- light: "var(--ds-icon-brand, ".concat(B400, ")"),
37
- dark: "var(--ds-icon-brand, ".concat(B100, ")")
38
- })
10
+ default: "var(--ds-icon, ".concat(N900, ")"),
11
+ help: "var(--ds-icon-discovery, ".concat(P400, ")"),
12
+ inverted: "var(--ds-icon-inverse, ".concat(N0, ")"),
13
+ primary: "var(--ds-icon-brand, ".concat(B400, ")")
39
14
  };
40
15
  export var getBgColor = function getBgColor(appearance, isSelected) {
41
16
  return isSelected ? selectedColorMap[appearance] : colorMap[appearance];
@@ -7,12 +7,11 @@ import { bind } from 'bind-event-listener';
7
7
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
8
8
  import noop from '@atlaskit/ds-lib/noop';
9
9
  import { Box, Inline } from '@atlaskit/primitives';
10
- import { useGlobalTheme } from '@atlaskit/theme/components';
11
10
  import { getBgColor } from './appearances';
12
11
  import { progressIndicatorGapMap, sizes, varDotsMargin, varDotsSize } from './constants';
13
12
  import { ButtonIndicator, PresentationalIndicator } from './indicator';
14
13
  var packageName = "@atlaskit/progress-indicator";
15
- var packageVersion = "9.5.18";
14
+ var packageVersion = "10.0.1";
16
15
 
17
16
  /**
18
17
  * __ProgressDots__
@@ -92,7 +91,6 @@ var ProgressDots = function ProgressDots(_ref) {
92
91
  }
93
92
  });
94
93
  }, [onSelect, handleKeyDown]);
95
- var theme = useGlobalTheme();
96
94
  return jsx(Box, {
97
95
  style: (_ref2 = {}, _defineProperty(_ref2, varDotsSize, "".concat(sizes[size], "px")), _defineProperty(_ref2, varDotsMargin, rawGapValue), _ref2),
98
96
  role: onSelect && 'tablist'
@@ -107,9 +105,7 @@ var ProgressDots = function ProgressDots(_ref) {
107
105
  var isSelected = selectedIndex === index;
108
106
  var tabId = "".concat(ariaLabel).concat(index);
109
107
  var panelId = "".concat(ariaControls).concat(index);
110
- var backgroundColor = getBgColor(appearance, isSelected)({
111
- theme: theme
112
- });
108
+ var backgroundColor = getBgColor(appearance, isSelected);
113
109
  return onSelect ? jsx(ButtonIndicator, {
114
110
  key: index,
115
111
  style: {
@@ -1,2 +1,2 @@
1
1
  import type { DotsAppearance } from './types';
2
- export declare const getBgColor: (appearance: DotsAppearance, isSelected: boolean) => import("@atlaskit/theme").ThemedValue<"var(--ds-background-neutral)"> | import("@atlaskit/theme").ThemedValue<"var(--ds-icon-subtle)"> | import("@atlaskit/theme").ThemedValue<"var(--ds-icon)"> | import("@atlaskit/theme").ThemedValue<"var(--ds-icon-discovery)"> | import("@atlaskit/theme").ThemedValue<"var(--ds-icon-inverse)"> | import("@atlaskit/theme").ThemedValue<"var(--ds-icon-brand)">;
2
+ export declare const getBgColor: (appearance: DotsAppearance, isSelected: boolean) => "var(--ds-background-neutral)" | "var(--ds-icon-subtle)" | "var(--ds-icon)" | "var(--ds-icon-discovery)" | "var(--ds-icon-inverse)" | "var(--ds-icon-brand)";
@@ -3,34 +3,34 @@ import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
3
  import type { DotsAppearance, Size, Spacing } from './components/types';
4
4
  export interface ProgressDotsProps {
5
5
  /**
6
- * The color of the indicators
6
+ * Sets the color of the indicators.
7
7
  */
8
8
  appearance?: DotsAppearance;
9
9
  /**
10
- * The aria-controls text applied to each indicator, appended by the index
10
+ * If interaction is enabled, use `ariaControls` to tell assistive technology what elements are controlled by the progress indicator.
11
11
  */
12
12
  ariaControls?: string;
13
13
  /**
14
- * The aria-label text applied to each indicator, appended by the index
14
+ * Describes what the indicator represents to assistive technology. The selected index number will be appended to the label.
15
15
  */
16
16
  ariaLabel?: string;
17
17
  /**
18
- * Function called when an indicator is selected
18
+ * Function called when an indicator is selected.
19
19
  */
20
20
  onSelect?: (eventData: {
21
21
  event: React.MouseEvent<HTMLButtonElement>;
22
22
  index: number;
23
23
  }, analyticsEvent: UIAnalyticsEvent) => void;
24
24
  /**
25
- * Which indicator is currently selected
25
+ * Which indicator is currently selected.
26
26
  */
27
27
  selectedIndex: number;
28
28
  /**
29
- * Corresponds to the width & height of each indicator
29
+ * Sets the width and height of each indicator.
30
30
  */
31
31
  size?: Size;
32
32
  /**
33
- * How much of a gutter is desired between indicators
33
+ * Specifies how much of a gutter there is between indicators.
34
34
  */
35
35
  spacing?: Spacing;
36
36
  /**
@@ -38,7 +38,7 @@ export interface ProgressDotsProps {
38
38
  */
39
39
  testId?: string;
40
40
  /**
41
- * An array of values mapped over to create the indicators
41
+ * An array of values mapped over to create the indicators.
42
42
  */
43
43
  values: any[];
44
44
  }
@@ -1,2 +1,2 @@
1
1
  import type { DotsAppearance } from './types';
2
- export declare const getBgColor: (appearance: DotsAppearance, isSelected: boolean) => import("@atlaskit/theme").ThemedValue<"var(--ds-background-neutral)"> | import("@atlaskit/theme").ThemedValue<"var(--ds-icon-subtle)"> | import("@atlaskit/theme").ThemedValue<"var(--ds-icon)"> | import("@atlaskit/theme").ThemedValue<"var(--ds-icon-discovery)"> | import("@atlaskit/theme").ThemedValue<"var(--ds-icon-inverse)"> | import("@atlaskit/theme").ThemedValue<"var(--ds-icon-brand)">;
2
+ export declare const getBgColor: (appearance: DotsAppearance, isSelected: boolean) => "var(--ds-background-neutral)" | "var(--ds-icon-subtle)" | "var(--ds-icon)" | "var(--ds-icon-discovery)" | "var(--ds-icon-inverse)" | "var(--ds-icon-brand)";
@@ -3,34 +3,34 @@ import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
3
  import type { DotsAppearance, Size, Spacing } from './components/types';
4
4
  export interface ProgressDotsProps {
5
5
  /**
6
- * The color of the indicators
6
+ * Sets the color of the indicators.
7
7
  */
8
8
  appearance?: DotsAppearance;
9
9
  /**
10
- * The aria-controls text applied to each indicator, appended by the index
10
+ * If interaction is enabled, use `ariaControls` to tell assistive technology what elements are controlled by the progress indicator.
11
11
  */
12
12
  ariaControls?: string;
13
13
  /**
14
- * The aria-label text applied to each indicator, appended by the index
14
+ * Describes what the indicator represents to assistive technology. The selected index number will be appended to the label.
15
15
  */
16
16
  ariaLabel?: string;
17
17
  /**
18
- * Function called when an indicator is selected
18
+ * Function called when an indicator is selected.
19
19
  */
20
20
  onSelect?: (eventData: {
21
21
  event: React.MouseEvent<HTMLButtonElement>;
22
22
  index: number;
23
23
  }, analyticsEvent: UIAnalyticsEvent) => void;
24
24
  /**
25
- * Which indicator is currently selected
25
+ * Which indicator is currently selected.
26
26
  */
27
27
  selectedIndex: number;
28
28
  /**
29
- * Corresponds to the width & height of each indicator
29
+ * Sets the width and height of each indicator.
30
30
  */
31
31
  size?: Size;
32
32
  /**
33
- * How much of a gutter is desired between indicators
33
+ * Specifies how much of a gutter there is between indicators.
34
34
  */
35
35
  spacing?: Spacing;
36
36
  /**
@@ -38,7 +38,7 @@ export interface ProgressDotsProps {
38
38
  */
39
39
  testId?: string;
40
40
  /**
41
- * An array of values mapped over to create the indicators
41
+ * An array of values mapped over to create the indicators.
42
42
  */
43
43
  values: any[];
44
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-indicator",
3
- "version": "9.5.18",
3
+ "version": "10.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/"
@@ -29,9 +29,9 @@
29
29
  "@atlaskit/analytics-next": "^9.1.0",
30
30
  "@atlaskit/ds-lib": "^2.2.0",
31
31
  "@atlaskit/focus-ring": "^1.3.0",
32
- "@atlaskit/primitives": "^1.9.0",
32
+ "@atlaskit/primitives": "^2.0.0",
33
33
  "@atlaskit/theme": "^12.6.0",
34
- "@atlaskit/tokens": "^1.28.0",
34
+ "@atlaskit/tokens": "^1.35.0",
35
35
  "@babel/runtime": "^7.0.0",
36
36
  "@emotion/react": "^11.7.1",
37
37
  "bind-event-listener": "^2.1.1"
@@ -42,7 +42,7 @@
42
42
  "devDependencies": {
43
43
  "@af/accessibility-testing": "*",
44
44
  "@af/visual-regression": "*",
45
- "@atlaskit/ds-explorations": "^3.0.0",
45
+ "@atlaskit/ds-explorations": "^3.2.0",
46
46
  "@atlaskit/ssr": "*",
47
47
  "@atlaskit/visual-regression": "*",
48
48
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
@@ -1,42 +0,0 @@
1
- ## API Report File for "@atlaskit/progress-indicator"
2
-
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
-
5
- ```ts
6
-
7
- /// <reference types="react" />
8
-
9
- import { FC } from 'react';
10
- import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
11
-
12
- // @public (undocumented)
13
- type DotsAppearance = 'default' | 'help' | 'inverted' | 'primary';
14
-
15
- // @public (undocumented)
16
- export interface ProgressDotsProps {
17
- appearance?: DotsAppearance;
18
- ariaControls?: string;
19
- ariaLabel?: string;
20
- onSelect?: (eventData: {
21
- event: React.MouseEvent<HTMLButtonElement>;
22
- index: number;
23
- }, analyticsEvent: UIAnalyticsEvent) => void;
24
- selectedIndex: number;
25
- size?: Size;
26
- spacing?: Spacing;
27
- testId?: string;
28
- values: any[];
29
- }
30
-
31
- // @public
32
- export const ProgressIndicator: FC<ProgressDotsProps>;
33
-
34
- // @public (undocumented)
35
- type Size = 'default' | 'large' | 'small';
36
-
37
- // @public (undocumented)
38
- type Spacing = 'comfortable' | 'compact' | 'cozy';
39
-
40
- // (No @packageDocumentation comment for this package)
41
-
42
- ```