@atlaskit/progress-tracker 8.4.4 → 8.4.5

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,11 @@
1
1
  # @atlaskit/progress-tracker
2
2
 
3
+ ## 8.4.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`18aeca8c199`](https://bitbucket.org/atlassian/atlassian-frontend/commits/18aeca8c199) - Internal change to update token references. There is no expected behaviour or visual change.
8
+
3
9
  ## 8.4.4
4
10
 
5
11
  ### Patch Changes
@@ -4,13 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.spacing = void 0;
7
-
8
7
  /**
9
8
  * Ideally these are exported by @atlaskit/page
10
9
  */
11
10
  var spacing = {
12
- comfortable: "var(--ds-scale-500, 40px)",
13
- cosy: "var(--ds-scale-200, 16px)",
14
- compact: "var(--ds-scale-050, 4px)"
11
+ comfortable: "var(--ds-space-500, 40px)",
12
+ cosy: "var(--ds-space-200, 16px)",
13
+ compact: "var(--ds-space-050, 4px)"
15
14
  };
16
15
  exports.spacing = spacing;
package/dist/cjs/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -11,5 +10,4 @@ Object.defineProperty(exports, "ProgressTracker", {
11
10
  return _progressTracker.default;
12
11
  }
13
12
  });
14
-
15
13
  var _progressTracker = _interopRequireDefault(require("./progress-tracker"));
@@ -4,16 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = require("@emotion/react");
9
-
10
8
  var _colors = require("@atlaskit/theme/colors");
11
-
12
9
  var _constants = require("../constants");
13
-
14
10
  var _constants2 = require("./constants");
15
-
16
11
  /** @jsx jsx */
12
+
17
13
  var progressBarStyles = (0, _react.css)({
18
14
  height: _constants2.PROGRESS_BAR_HEIGHT,
19
15
  position: 'absolute',
@@ -25,17 +21,18 @@ var progressBarStyles = (0, _react.css)({
25
21
  transition: "width var(".concat(_constants2.varTransitionSpeed, ") var(").concat(_constants2.varTransitionEasing, ")"),
26
22
  transitionDelay: "var(".concat(_constants2.varTransitionDelay, ")")
27
23
  });
24
+
28
25
  /**
29
26
  * __Progress bar__
30
27
  *
31
28
  * A progress bar describes the horizontal tracking bar that traverses each individual step.
32
29
  *
33
30
  */
34
-
35
31
  var ProgressBar = function ProgressBar(_ref) {
36
32
  var percentageComplete = _ref.percentageComplete,
37
- testId = _ref.testId;
38
- return (// eslint-disable-next-line @repo/internal/react/use-primitives
33
+ testId = _ref.testId;
34
+ return (
35
+ // eslint-disable-next-line @repo/internal/react/use-primitives
39
36
  (0, _react.jsx)("div", {
40
37
  "data-testid": testId,
41
38
  style: {
@@ -45,6 +42,5 @@ var ProgressBar = function ProgressBar(_ref) {
45
42
  })
46
43
  );
47
44
  };
48
-
49
45
  var _default = ProgressBar;
50
46
  exports.default = _default;
@@ -26,10 +26,11 @@ var SEMI_BOLD_FONT_WEIGHT = 'semibold';
26
26
  exports.SEMI_BOLD_FONT_WEIGHT = SEMI_BOLD_FONT_WEIGHT;
27
27
  var REGULAR_FONT_WEIGHT = 'regular';
28
28
  exports.REGULAR_FONT_WEIGHT = REGULAR_FONT_WEIGHT;
29
- var HALF_GRID_SIZE = "var(--ds-scale-050, 4px)";
29
+ var HALF_GRID_SIZE = "var(--ds-space-050, 4px)";
30
30
  exports.HALF_GRID_SIZE = HALF_GRID_SIZE;
31
- var PROGRESS_BAR_HEIGHT = "var(--ds-scale-100, 8px)"; // Labels sit 16px from bottom of progress bar i.e. 8 + 16
31
+ var PROGRESS_BAR_HEIGHT = "var(--ds-space-100, 8px)";
32
32
 
33
+ // Labels sit 16px from bottom of progress bar i.e. 8 + 16
33
34
  exports.PROGRESS_BAR_HEIGHT = PROGRESS_BAR_HEIGHT;
34
- var LABEL_TOP_SPACING = "var(--ds-scale-300, 24px)";
35
+ var LABEL_TOP_SPACING = "var(--ds-space-300, 24px)";
35
36
  exports.LABEL_TOP_SPACING = LABEL_TOP_SPACING;
@@ -4,26 +4,25 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = require("@emotion/react");
9
-
10
8
  var _colors = require("@atlaskit/theme/colors");
11
-
12
9
  /** @jsx jsx */
10
+
13
11
  var linkStyles = (0, _react.css)({
14
12
  color: "var(--ds-text, ".concat(_colors.N800, ")"),
15
13
  cursor: 'pointer'
16
14
  });
15
+
17
16
  /**
18
17
  * __Progress tracker link__
19
18
  */
20
-
21
19
  var Link = function Link(_ref) {
22
20
  var href = _ref.href,
23
- onClick = _ref.onClick,
24
- label = _ref.label,
25
- testId = _ref.testId;
26
- return (// eslint-disable-next-line @repo/internal/react/use-primitives
21
+ onClick = _ref.onClick,
22
+ label = _ref.label,
23
+ testId = _ref.testId;
24
+ return (
25
+ // eslint-disable-next-line @repo/internal/react/use-primitives
27
26
  (0, _react.jsx)("a", {
28
27
  css: linkStyles,
29
28
  href: href,
@@ -32,6 +31,5 @@ var Link = function Link(_ref) {
32
31
  }, label)
33
32
  );
34
33
  };
35
-
36
34
  var _default = Link;
37
35
  exports.default = _default;
@@ -4,14 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = require("@emotion/react");
9
-
10
8
  var _constants = require("./constants");
11
-
12
9
  /* eslint-disable @repo/internal/styles/no-nested-styles */
13
-
14
10
  /** @jsx jsx */
11
+
15
12
  var progressMarkerStyles = (0, _react.css)({
16
13
  width: _constants.PROGRESS_BAR_HEIGHT,
17
14
  height: _constants.PROGRESS_BAR_HEIGHT,
@@ -35,15 +32,16 @@ var progressMarkerStyles = (0, _react.css)({
35
32
  backgroundColor: "var(".concat(_constants.varBackgroundColor, ")")
36
33
  }
37
34
  });
35
+
38
36
  /**
39
37
  * __Progress marker__
40
38
  *
41
39
  * Similar to `@atlaskit/progress-indicator`, a small visual circle marker
42
40
  */
43
-
44
41
  var ProgressMarker = function ProgressMarker(_ref) {
45
42
  var testId = _ref.testId;
46
- return (// too many props that would go in UNSAFE_style + css transition prop having issues
43
+ return (
44
+ // too many props that would go in UNSAFE_style + css transition prop having issues
47
45
  // eslint-disable-next-line @repo/internal/react/use-primitives
48
46
  (0, _react.jsx)("div", {
49
47
  "data-testid": testId,
@@ -51,6 +49,5 @@ var ProgressMarker = function ProgressMarker(_ref) {
51
49
  })
52
50
  );
53
51
  };
54
-
55
52
  var _default = ProgressMarker;
56
53
  exports.default = _default;
@@ -1,54 +1,32 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
10
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
15
-
16
11
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
-
18
12
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
-
20
13
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
-
22
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
-
24
15
  var _react = require("react");
25
-
26
16
  var _react2 = require("@emotion/react");
27
-
28
17
  var _reactTransitionGroup = require("react-transition-group");
29
-
30
18
  var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
31
-
32
19
  var _text = _interopRequireDefault(require("@atlaskit/ds-explorations/text"));
33
-
34
20
  var _bar = _interopRequireDefault(require("./bar"));
35
-
36
21
  var _constants = require("./constants");
37
-
38
22
  var _marker = _interopRequireDefault(require("./marker"));
39
-
40
23
  var _utils = require("./utils");
41
-
42
24
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
43
-
44
25
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
45
-
46
26
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
47
-
48
27
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
49
-
50
28
  var listItemStyles = (0, _react2.css)({
51
- margin: "var(--ds-scale-0, 0px)",
29
+ margin: "var(--ds-space-0, 0px)",
52
30
  overflowWrap: 'break-word'
53
31
  });
54
32
  var titleStyles = (0, _react2.css)({
@@ -65,15 +43,11 @@ var titleStyles = (0, _react2.css)({
65
43
  transition: "opacity var(".concat(_constants.varTransitionSpeed, ") cubic-bezier(0.2, 0, 0, 1)")
66
44
  }
67
45
  });
68
-
69
46
  var ProgressTrackerStage = /*#__PURE__*/function (_PureComponent) {
70
47
  (0, _inherits2.default)(ProgressTrackerStage, _PureComponent);
71
-
72
48
  var _super = _createSuper(ProgressTrackerStage);
73
-
74
49
  function ProgressTrackerStage(props) {
75
50
  var _this;
76
-
77
51
  (0, _classCallCheck2.default)(this, ProgressTrackerStage);
78
52
  _this = _super.call(this, props);
79
53
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onEntered", function () {
@@ -90,7 +64,6 @@ var ProgressTrackerStage = /*#__PURE__*/function (_PureComponent) {
90
64
  };
91
65
  return _this;
92
66
  }
93
-
94
67
  (0, _createClass2.default)(ProgressTrackerStage, [{
95
68
  key: "UNSAFE_componentWillMount",
96
69
  value: function UNSAFE_componentWillMount() {
@@ -114,17 +87,17 @@ var ProgressTrackerStage = /*#__PURE__*/function (_PureComponent) {
114
87
  key: "render",
115
88
  value: function render() {
116
89
  var _listInlineStyles;
117
-
118
90
  var _this$props = this.props,
119
- item = _this$props.item,
120
- render = _this$props.render,
121
- transitionDelay = _this$props.transitionDelay,
122
- transitionSpeed = _this$props.transitionSpeed,
123
- transitionEasing = _this$props.transitionEasing,
124
- testId = _this$props.testId;
91
+ item = _this$props.item,
92
+ render = _this$props.render,
93
+ transitionDelay = _this$props.transitionDelay,
94
+ transitionSpeed = _this$props.transitionSpeed,
95
+ transitionEasing = _this$props.transitionEasing,
96
+ testId = _this$props.testId;
125
97
  var ariaCurrent = item.status === 'current' ? 'step' : 'false';
126
98
  var listInlineStyles = (_listInlineStyles = {}, (0, _defineProperty2.default)(_listInlineStyles, _constants.varTransitionSpeed, "".concat(transitionSpeed, "ms")), (0, _defineProperty2.default)(_listInlineStyles, _constants.varTransitionDelay, "".concat(transitionDelay, "ms")), (0, _defineProperty2.default)(_listInlineStyles, _constants.varTransitionEasing, transitionEasing), (0, _defineProperty2.default)(_listInlineStyles, _constants.varMarkerColor, this.state.oldMarkerColor), (0, _defineProperty2.default)(_listInlineStyles, _constants.varBackgroundColor, (0, _utils.getMarkerColor)(item.status)), _listInlineStyles);
127
- return (// eslint-disable-next-line @repo/internal/react/use-primitives
99
+ return (
100
+ // eslint-disable-next-line @repo/internal/react/use-primitives
128
101
  (0, _react2.jsx)("li", {
129
102
  "data-testid": testId,
130
103
  style: listInlineStyles,
@@ -174,5 +147,4 @@ var ProgressTrackerStage = /*#__PURE__*/function (_PureComponent) {
174
147
  }]);
175
148
  return ProgressTrackerStage;
176
149
  }(_react.PureComponent);
177
-
178
150
  exports.default = ProgressTrackerStage;
@@ -4,62 +4,46 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getTextColor = exports.getMarkerColor = exports.getFontWeight = void 0;
7
-
8
7
  var _colors = require("@atlaskit/theme/colors");
9
-
10
8
  var _constants = require("./constants");
11
-
12
9
  var getMarkerColor = function getMarkerColor(status) {
13
10
  switch (status) {
14
11
  case 'unvisited':
15
12
  return "var(--ds-icon-subtle, ".concat(_colors.N70, ")");
16
-
17
13
  case 'current':
18
14
  case 'visited':
19
15
  case 'disabled':
20
16
  return "var(--ds-icon-brand, ".concat(_colors.B300, ")");
21
-
22
17
  default:
23
18
  return;
24
19
  }
25
20
  };
26
-
27
21
  exports.getMarkerColor = getMarkerColor;
28
-
29
22
  var getTextColor = function getTextColor(status) {
30
23
  switch (status) {
31
24
  case 'unvisited':
32
25
  return 'subtlest';
33
-
34
26
  case 'current':
35
27
  return 'brand';
36
-
37
28
  case 'visited':
38
29
  return 'color.text';
39
-
40
30
  case 'disabled':
41
31
  return 'disabled';
42
-
43
32
  default:
44
33
  return;
45
34
  }
46
35
  };
47
-
48
36
  exports.getTextColor = getTextColor;
49
-
50
37
  var getFontWeight = function getFontWeight(status) {
51
38
  switch (status) {
52
39
  case 'unvisited':
53
40
  return _constants.REGULAR_FONT_WEIGHT;
54
-
55
41
  case 'current':
56
42
  case 'visited':
57
43
  case 'disabled':
58
44
  return _constants.SEMI_BOLD_FONT_WEIGHT;
59
-
60
45
  default:
61
46
  return undefined;
62
47
  }
63
48
  };
64
-
65
49
  exports.getFontWeight = getFontWeight;
@@ -1,74 +1,49 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
10
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
15
-
16
11
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
-
18
12
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
-
20
13
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
-
22
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
-
24
15
  var _react = require("react");
25
-
26
16
  var _react2 = require("@emotion/react");
27
-
28
17
  var _constants = require("./constants");
29
-
30
18
  var _constants2 = require("./internal/constants");
31
-
32
19
  var _link = _interopRequireDefault(require("./internal/link"));
33
-
34
20
  var _stage = _interopRequireDefault(require("./internal/stage"));
35
-
36
21
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
37
-
38
22
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
39
-
40
23
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
41
-
42
24
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
43
-
44
25
  var containerStyles = (0, _react2.css)({
45
26
  display: 'grid',
46
27
  width: '100%',
47
28
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
48
29
  margin: '0 auto',
49
- padding: "var(--ds-scale-0, 0px)",
30
+ padding: "var(--ds-space-0, 0px)",
50
31
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
51
32
  gap: "var(".concat(_constants2.varSpacing, ")"),
52
33
  listStyleType: 'none',
53
34
  '&&': {
54
- marginTop: "var(--ds-scale-500, 40px)"
35
+ marginTop: "var(--ds-space-500, 40px)"
55
36
  }
56
37
  });
57
-
58
38
  var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
59
39
  (0, _inherits2.default)(ProgressTracker, _PureComponent);
60
-
61
40
  var _super = _createSuper(ProgressTracker);
62
-
63
41
  function ProgressTracker() {
64
42
  var _this;
65
-
66
43
  (0, _classCallCheck2.default)(this, ProgressTracker);
67
-
68
44
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
69
45
  args[_key] = arguments[_key];
70
46
  }
71
-
72
47
  _this = _super.call.apply(_super, [this].concat(args));
73
48
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
74
49
  prevStages: _this.props.items.map(function (stage) {
@@ -79,17 +54,14 @@ var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
79
54
  });
80
55
  return _this;
81
56
  }
82
-
83
57
  (0, _createClass2.default)(ProgressTracker, [{
84
58
  key: "UNSAFE_componentWillReceiveProps",
85
59
  value: function UNSAFE_componentWillReceiveProps(nextProps) {
86
60
  var _this2 = this;
87
-
88
61
  var prevStages = nextProps.items.map(function (stage) {
89
62
  var oldStage = _this2.props.items.find(function (st) {
90
63
  return st.id === stage.id;
91
64
  });
92
-
93
65
  return oldStage !== undefined ? oldStage : stage;
94
66
  });
95
67
  this.setState({
@@ -100,11 +72,10 @@ var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
100
72
  key: "render",
101
73
  value: function render() {
102
74
  var _this3 = this,
103
- _listInlineStyles;
104
-
75
+ _listInlineStyles;
105
76
  var _this$props = this.props,
106
- testId = _this$props.testId,
107
- label = _this$props.label;
77
+ testId = _this$props.testId,
78
+ label = _this$props.label;
108
79
  var progressChanges = this.props.items.filter(function (stage, index) {
109
80
  return stage.percentageComplete !== _this3.state.prevStages[index].percentageComplete;
110
81
  }).length;
@@ -120,10 +91,8 @@ var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
120
91
  var transitionSpeed = 0;
121
92
  var transitionDelay = 0;
122
93
  var transitionEasing = progressChanges > 1 ? 'linear' : _constants2.ANIMATION_EASE_OUT;
123
-
124
94
  if (_this3.props.animated) {
125
95
  transitionSpeed = progressChanges > 1 ? _constants2.LINEAR_TRANSITION_SPEED : _constants2.TRANSITION_SPEED;
126
-
127
96
  if (stage.percentageComplete < _this3.state.prevStages[index].percentageComplete) {
128
97
  /**
129
98
  * load each transition sequentially in reverse
@@ -138,7 +107,6 @@ var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
138
107
  stepsForward -= 1;
139
108
  }
140
109
  }
141
-
142
110
  return (0, _react2.jsx)(_stage.default, {
143
111
  transitionSpeed: transitionSpeed,
144
112
  transitionDelay: transitionDelay,
@@ -151,7 +119,8 @@ var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
151
119
  var listInlineStyles = (_listInlineStyles = {
152
120
  gridTemplateColumns: "repeat(".concat(items.length, ", 1fr)")
153
121
  }, (0, _defineProperty2.default)(_listInlineStyles, _constants2.varSpacing, _constants.spacing[this.props.spacing]), (0, _defineProperty2.default)(_listInlineStyles, "maxWidth", 8 * 10 * items.length * 2), _listInlineStyles);
154
- return (// eslint-disable-next-line @repo/internal/react/use-primitives
122
+ return (
123
+ // eslint-disable-next-line @repo/internal/react/use-primitives
155
124
  (0, _react2.jsx)("ul", {
156
125
  "data-testid": testId,
157
126
  style: listInlineStyles,
@@ -163,7 +132,6 @@ var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
163
132
  }]);
164
133
  return ProgressTracker;
165
134
  }(_react.PureComponent);
166
-
167
135
  exports.default = ProgressTracker;
168
136
  (0, _defineProperty2.default)(ProgressTracker, "defaultProps", {
169
137
  items: [],
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-tracker",
3
- "version": "8.4.4",
3
+ "version": "8.4.5",
4
4
  "sideEffects": false
5
5
  }
@@ -2,7 +2,7 @@
2
2
  * Ideally these are exported by @atlaskit/page
3
3
  */
4
4
  export const spacing = {
5
- comfortable: "var(--ds-scale-500, 40px)",
6
- cosy: "var(--ds-scale-200, 16px)",
7
- compact: "var(--ds-scale-050, 4px)"
5
+ comfortable: "var(--ds-space-500, 40px)",
6
+ cosy: "var(--ds-space-200, 16px)",
7
+ compact: "var(--ds-space-050, 4px)"
8
8
  };
@@ -14,17 +14,18 @@ const progressBarStyles = css({
14
14
  transition: `width var(${varTransitionSpeed}) var(${varTransitionEasing})`,
15
15
  transitionDelay: `var(${varTransitionDelay})`
16
16
  });
17
+
17
18
  /**
18
19
  * __Progress bar__
19
20
  *
20
21
  * A progress bar describes the horizontal tracking bar that traverses each individual step.
21
22
  *
22
23
  */
23
-
24
24
  const ProgressBar = ({
25
25
  percentageComplete,
26
26
  testId
27
- }) => // eslint-disable-next-line @repo/internal/react/use-primitives
27
+ }) =>
28
+ // eslint-disable-next-line @repo/internal/react/use-primitives
28
29
  jsx("div", {
29
30
  "data-testid": testId,
30
31
  style: {
@@ -32,5 +33,4 @@ jsx("div", {
32
33
  },
33
34
  css: progressBarStyles
34
35
  });
35
-
36
36
  export default ProgressBar;
@@ -9,7 +9,8 @@ export const varMarkerColor = '--ds--pt--mc';
9
9
  export const varBackgroundColor = '--ds--pt--bg';
10
10
  export const SEMI_BOLD_FONT_WEIGHT = 'semibold';
11
11
  export const REGULAR_FONT_WEIGHT = 'regular';
12
- export const HALF_GRID_SIZE = "var(--ds-scale-050, 4px)";
13
- export const PROGRESS_BAR_HEIGHT = "var(--ds-scale-100, 8px)"; // Labels sit 16px from bottom of progress bar i.e. 8 + 16
12
+ export const HALF_GRID_SIZE = "var(--ds-space-050, 4px)";
13
+ export const PROGRESS_BAR_HEIGHT = "var(--ds-space-100, 8px)";
14
14
 
15
- export const LABEL_TOP_SPACING = "var(--ds-scale-300, 24px)";
15
+ // Labels sit 16px from bottom of progress bar i.e. 8 + 16
16
+ export const LABEL_TOP_SPACING = "var(--ds-space-300, 24px)";
@@ -1,25 +1,26 @@
1
1
  /** @jsx jsx */
2
+
2
3
  import { css, jsx } from '@emotion/react';
3
4
  import { N800 } from '@atlaskit/theme/colors';
4
5
  const linkStyles = css({
5
6
  color: `var(--ds-text, ${N800})`,
6
7
  cursor: 'pointer'
7
8
  });
9
+
8
10
  /**
9
11
  * __Progress tracker link__
10
12
  */
11
-
12
13
  const Link = ({
13
14
  href,
14
15
  onClick,
15
16
  label,
16
17
  testId
17
- }) => // eslint-disable-next-line @repo/internal/react/use-primitives
18
+ }) =>
19
+ // eslint-disable-next-line @repo/internal/react/use-primitives
18
20
  jsx("a", {
19
21
  css: linkStyles,
20
22
  href: href,
21
23
  onClick: onClick,
22
24
  "data-testid": testId
23
25
  }, label);
24
-
25
26
  export default Link;
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @repo/internal/styles/no-nested-styles */
2
-
3
2
  /** @jsx jsx */
3
+
4
4
  import { css, jsx } from '@emotion/react';
5
5
  import { LABEL_TOP_SPACING, PROGRESS_BAR_HEIGHT, varBackgroundColor, varMarkerColor, varTransitionDelay, varTransitionEasing, varTransitionSpeed } from './constants';
6
6
  const progressMarkerStyles = css({
@@ -26,19 +26,19 @@ const progressMarkerStyles = css({
26
26
  backgroundColor: `var(${varBackgroundColor})`
27
27
  }
28
28
  });
29
+
29
30
  /**
30
31
  * __Progress marker__
31
32
  *
32
33
  * Similar to `@atlaskit/progress-indicator`, a small visual circle marker
33
34
  */
34
-
35
35
  const ProgressMarker = ({
36
36
  testId
37
- }) => // too many props that would go in UNSAFE_style + css transition prop having issues
37
+ }) =>
38
+ // too many props that would go in UNSAFE_style + css transition prop having issues
38
39
  // eslint-disable-next-line @repo/internal/react/use-primitives
39
40
  jsx("div", {
40
41
  "data-testid": testId,
41
42
  css: progressMarkerStyles
42
43
  });
43
-
44
44
  export default ProgressMarker;
@@ -1,7 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
-
3
2
  /* eslint-disable @repo/internal/styles/no-nested-styles */
4
-
5
3
  /** @jsx jsx */
6
4
  import { PureComponent } from 'react';
7
5
  import { css, jsx } from '@emotion/react';
@@ -13,7 +11,7 @@ import { LABEL_TOP_SPACING, varBackgroundColor, varMarkerColor, varTransitionDel
13
11
  import ProgressMarker from './marker';
14
12
  import { getFontWeight, getMarkerColor, getTextColor } from './utils';
15
13
  const listItemStyles = css({
16
- margin: "var(--ds-scale-0, 0px)",
14
+ margin: "var(--ds-space-0, 0px)",
17
15
  overflowWrap: 'break-word'
18
16
  });
19
17
  const titleStyles = css({
@@ -33,7 +31,6 @@ const titleStyles = css({
33
31
  export default class ProgressTrackerStage extends PureComponent {
34
32
  constructor(props) {
35
33
  super(props);
36
-
37
34
  _defineProperty(this, "onEntered", () => {
38
35
  this.setState({
39
36
  transitioning: false,
@@ -41,30 +38,27 @@ export default class ProgressTrackerStage extends PureComponent {
41
38
  oldPercentageComplete: this.props.item.percentageComplete
42
39
  });
43
40
  });
44
-
45
41
  this.state = {
46
42
  transitioning: false,
47
43
  oldMarkerColor: getMarkerColor(this.props.item.status),
48
44
  oldPercentageComplete: 0
49
45
  };
50
46
  }
51
-
52
47
  UNSAFE_componentWillMount() {
53
- this.setState({ ...this.state,
48
+ this.setState({
49
+ ...this.state,
54
50
  transitioning: true
55
51
  });
56
52
  }
57
-
58
53
  UNSAFE_componentWillReceiveProps() {
59
- this.setState({ ...this.state,
54
+ this.setState({
55
+ ...this.state,
60
56
  transitioning: true
61
57
  });
62
58
  }
63
-
64
59
  shouldShowLink() {
65
60
  return this.props.item.status === 'visited' && !this.props.item.noLink;
66
61
  }
67
-
68
62
  render() {
69
63
  const {
70
64
  item,
@@ -82,7 +76,8 @@ export default class ProgressTrackerStage extends PureComponent {
82
76
  [varMarkerColor]: this.state.oldMarkerColor,
83
77
  [varBackgroundColor]: getMarkerColor(item.status)
84
78
  };
85
- return (// eslint-disable-next-line @repo/internal/react/use-primitives
79
+ return (
80
+ // eslint-disable-next-line @repo/internal/react/use-primitives
86
81
  jsx("li", {
87
82
  "data-testid": testId,
88
83
  style: listInlineStyles,
@@ -129,5 +124,4 @@ export default class ProgressTrackerStage extends PureComponent {
129
124
  }) : item.label)))))
130
125
  );
131
126
  }
132
-
133
127
  }
@@ -4,12 +4,10 @@ export const getMarkerColor = status => {
4
4
  switch (status) {
5
5
  case 'unvisited':
6
6
  return `var(--ds-icon-subtle, ${N70})`;
7
-
8
7
  case 'current':
9
8
  case 'visited':
10
9
  case 'disabled':
11
10
  return `var(--ds-icon-brand, ${B300})`;
12
-
13
11
  default:
14
12
  return;
15
13
  }
@@ -18,16 +16,12 @@ export const getTextColor = status => {
18
16
  switch (status) {
19
17
  case 'unvisited':
20
18
  return 'subtlest';
21
-
22
19
  case 'current':
23
20
  return 'brand';
24
-
25
21
  case 'visited':
26
22
  return 'color.text';
27
-
28
23
  case 'disabled':
29
24
  return 'disabled';
30
-
31
25
  default:
32
26
  return;
33
27
  }
@@ -36,12 +30,10 @@ export const getFontWeight = status => {
36
30
  switch (status) {
37
31
  case 'unvisited':
38
32
  return REGULAR_FONT_WEIGHT;
39
-
40
33
  case 'current':
41
34
  case 'visited':
42
35
  case 'disabled':
43
36
  return SEMI_BOLD_FONT_WEIGHT;
44
-
45
37
  default:
46
38
  return undefined;
47
39
  }
@@ -1,7 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
-
3
2
  /* eslint-disable @repo/internal/styles/no-nested-styles */
4
-
5
3
  /** @jsx jsx */
6
4
  import { PureComponent } from 'react';
7
5
  import { css, jsx } from '@emotion/react';
@@ -14,25 +12,24 @@ const containerStyles = css({
14
12
  width: '100%',
15
13
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
16
14
  margin: '0 auto',
17
- padding: "var(--ds-scale-0, 0px)",
15
+ padding: "var(--ds-space-0, 0px)",
18
16
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
19
17
  gap: `var(${varSpacing})`,
20
18
  listStyleType: 'none',
21
19
  '&&': {
22
- marginTop: "var(--ds-scale-500, 40px)"
20
+ marginTop: "var(--ds-space-500, 40px)"
23
21
  }
24
22
  });
25
23
  export default class ProgressTracker extends PureComponent {
26
24
  constructor(...args) {
27
25
  super(...args);
28
-
29
26
  _defineProperty(this, "state", {
30
- prevStages: this.props.items.map(stage => ({ ...stage,
27
+ prevStages: this.props.items.map(stage => ({
28
+ ...stage,
31
29
  percentageComplete: 0
32
30
  }))
33
31
  });
34
32
  }
35
-
36
33
  UNSAFE_componentWillReceiveProps(nextProps) {
37
34
  const prevStages = nextProps.items.map(stage => {
38
35
  const oldStage = this.props.items.find(st => st.id === stage.id);
@@ -42,7 +39,6 @@ export default class ProgressTracker extends PureComponent {
42
39
  prevStages
43
40
  });
44
41
  }
45
-
46
42
  render() {
47
43
  const {
48
44
  testId,
@@ -57,10 +53,8 @@ export default class ProgressTracker extends PureComponent {
57
53
  let transitionSpeed = 0;
58
54
  let transitionDelay = 0;
59
55
  const transitionEasing = progressChanges > 1 ? 'linear' : ANIMATION_EASE_OUT;
60
-
61
56
  if (this.props.animated) {
62
57
  transitionSpeed = progressChanges > 1 ? LINEAR_TRANSITION_SPEED : TRANSITION_SPEED;
63
-
64
58
  if (stage.percentageComplete < this.state.prevStages[index].percentageComplete) {
65
59
  /**
66
60
  * load each transition sequentially in reverse
@@ -75,7 +69,6 @@ export default class ProgressTracker extends PureComponent {
75
69
  stepsForward -= 1;
76
70
  }
77
71
  }
78
-
79
72
  return jsx(Stage, {
80
73
  transitionSpeed: transitionSpeed,
81
74
  transitionDelay: transitionDelay,
@@ -90,7 +83,8 @@ export default class ProgressTracker extends PureComponent {
90
83
  [varSpacing]: spacing[this.props.spacing],
91
84
  maxWidth: 8 * 10 * items.length * 2
92
85
  };
93
- return (// eslint-disable-next-line @repo/internal/react/use-primitives
86
+ return (
87
+ // eslint-disable-next-line @repo/internal/react/use-primitives
94
88
  jsx("ul", {
95
89
  "data-testid": testId,
96
90
  style: listInlineStyles,
@@ -99,9 +93,7 @@ export default class ProgressTracker extends PureComponent {
99
93
  }, items)
100
94
  );
101
95
  }
102
-
103
96
  }
104
-
105
97
  _defineProperty(ProgressTracker, "defaultProps", {
106
98
  items: [],
107
99
  spacing: 'cosy',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-tracker",
3
- "version": "8.4.4",
3
+ "version": "8.4.5",
4
4
  "sideEffects": false
5
5
  }
@@ -2,7 +2,7 @@
2
2
  * Ideally these are exported by @atlaskit/page
3
3
  */
4
4
  export var spacing = {
5
- comfortable: "var(--ds-scale-500, 40px)",
6
- cosy: "var(--ds-scale-200, 16px)",
7
- compact: "var(--ds-scale-050, 4px)"
5
+ comfortable: "var(--ds-space-500, 40px)",
6
+ cosy: "var(--ds-space-200, 16px)",
7
+ compact: "var(--ds-space-050, 4px)"
8
8
  };
@@ -14,17 +14,18 @@ var progressBarStyles = css({
14
14
  transition: "width var(".concat(varTransitionSpeed, ") var(").concat(varTransitionEasing, ")"),
15
15
  transitionDelay: "var(".concat(varTransitionDelay, ")")
16
16
  });
17
+
17
18
  /**
18
19
  * __Progress bar__
19
20
  *
20
21
  * A progress bar describes the horizontal tracking bar that traverses each individual step.
21
22
  *
22
23
  */
23
-
24
24
  var ProgressBar = function ProgressBar(_ref) {
25
25
  var percentageComplete = _ref.percentageComplete,
26
- testId = _ref.testId;
27
- return (// eslint-disable-next-line @repo/internal/react/use-primitives
26
+ testId = _ref.testId;
27
+ return (
28
+ // eslint-disable-next-line @repo/internal/react/use-primitives
28
29
  jsx("div", {
29
30
  "data-testid": testId,
30
31
  style: {
@@ -34,5 +35,4 @@ var ProgressBar = function ProgressBar(_ref) {
34
35
  })
35
36
  );
36
37
  };
37
-
38
38
  export default ProgressBar;
@@ -9,7 +9,8 @@ export var varMarkerColor = '--ds--pt--mc';
9
9
  export var varBackgroundColor = '--ds--pt--bg';
10
10
  export var SEMI_BOLD_FONT_WEIGHT = 'semibold';
11
11
  export var REGULAR_FONT_WEIGHT = 'regular';
12
- export var HALF_GRID_SIZE = "var(--ds-scale-050, 4px)";
13
- export var PROGRESS_BAR_HEIGHT = "var(--ds-scale-100, 8px)"; // Labels sit 16px from bottom of progress bar i.e. 8 + 16
12
+ export var HALF_GRID_SIZE = "var(--ds-space-050, 4px)";
13
+ export var PROGRESS_BAR_HEIGHT = "var(--ds-space-100, 8px)";
14
14
 
15
- export var LABEL_TOP_SPACING = "var(--ds-scale-300, 24px)";
15
+ // Labels sit 16px from bottom of progress bar i.e. 8 + 16
16
+ export var LABEL_TOP_SPACING = "var(--ds-space-300, 24px)";
@@ -1,20 +1,22 @@
1
1
  /** @jsx jsx */
2
+
2
3
  import { css, jsx } from '@emotion/react';
3
4
  import { N800 } from '@atlaskit/theme/colors';
4
5
  var linkStyles = css({
5
6
  color: "var(--ds-text, ".concat(N800, ")"),
6
7
  cursor: 'pointer'
7
8
  });
9
+
8
10
  /**
9
11
  * __Progress tracker link__
10
12
  */
11
-
12
13
  var Link = function Link(_ref) {
13
14
  var href = _ref.href,
14
- onClick = _ref.onClick,
15
- label = _ref.label,
16
- testId = _ref.testId;
17
- return (// eslint-disable-next-line @repo/internal/react/use-primitives
15
+ onClick = _ref.onClick,
16
+ label = _ref.label,
17
+ testId = _ref.testId;
18
+ return (
19
+ // eslint-disable-next-line @repo/internal/react/use-primitives
18
20
  jsx("a", {
19
21
  css: linkStyles,
20
22
  href: href,
@@ -23,5 +25,4 @@ var Link = function Link(_ref) {
23
25
  }, label)
24
26
  );
25
27
  };
26
-
27
28
  export default Link;
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @repo/internal/styles/no-nested-styles */
2
-
3
2
  /** @jsx jsx */
3
+
4
4
  import { css, jsx } from '@emotion/react';
5
5
  import { LABEL_TOP_SPACING, PROGRESS_BAR_HEIGHT, varBackgroundColor, varMarkerColor, varTransitionDelay, varTransitionEasing, varTransitionSpeed } from './constants';
6
6
  var progressMarkerStyles = css({
@@ -26,15 +26,16 @@ var progressMarkerStyles = css({
26
26
  backgroundColor: "var(".concat(varBackgroundColor, ")")
27
27
  }
28
28
  });
29
+
29
30
  /**
30
31
  * __Progress marker__
31
32
  *
32
33
  * Similar to `@atlaskit/progress-indicator`, a small visual circle marker
33
34
  */
34
-
35
35
  var ProgressMarker = function ProgressMarker(_ref) {
36
36
  var testId = _ref.testId;
37
- return (// too many props that would go in UNSAFE_style + css transition prop having issues
37
+ return (
38
+ // too many props that would go in UNSAFE_style + css transition prop having issues
38
39
  // eslint-disable-next-line @repo/internal/react/use-primitives
39
40
  jsx("div", {
40
41
  "data-testid": testId,
@@ -42,5 +43,4 @@ var ProgressMarker = function ProgressMarker(_ref) {
42
43
  })
43
44
  );
44
45
  };
45
-
46
46
  export default ProgressMarker;
@@ -5,17 +5,11 @@ import _inherits from "@babel/runtime/helpers/inherits";
5
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
-
9
8
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
-
11
9
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
12
-
13
10
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
-
15
11
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
16
-
17
12
  /* eslint-disable @repo/internal/styles/no-nested-styles */
18
-
19
13
  /** @jsx jsx */
20
14
  import { PureComponent } from 'react';
21
15
  import { css, jsx } from '@emotion/react';
@@ -27,7 +21,7 @@ import { LABEL_TOP_SPACING, varBackgroundColor, varMarkerColor, varTransitionDel
27
21
  import ProgressMarker from './marker';
28
22
  import { getFontWeight, getMarkerColor, getTextColor } from './utils';
29
23
  var listItemStyles = css({
30
- margin: "var(--ds-scale-0, 0px)",
24
+ margin: "var(--ds-space-0, 0px)",
31
25
  overflowWrap: 'break-word'
32
26
  });
33
27
  var titleStyles = css({
@@ -44,19 +38,13 @@ var titleStyles = css({
44
38
  transition: "opacity var(".concat(varTransitionSpeed, ") cubic-bezier(0.2, 0, 0, 1)")
45
39
  }
46
40
  });
47
-
48
41
  var ProgressTrackerStage = /*#__PURE__*/function (_PureComponent) {
49
42
  _inherits(ProgressTrackerStage, _PureComponent);
50
-
51
43
  var _super = _createSuper(ProgressTrackerStage);
52
-
53
44
  function ProgressTrackerStage(props) {
54
45
  var _this;
55
-
56
46
  _classCallCheck(this, ProgressTrackerStage);
57
-
58
47
  _this = _super.call(this, props);
59
-
60
48
  _defineProperty(_assertThisInitialized(_this), "onEntered", function () {
61
49
  _this.setState({
62
50
  transitioning: false,
@@ -64,7 +52,6 @@ var ProgressTrackerStage = /*#__PURE__*/function (_PureComponent) {
64
52
  oldPercentageComplete: _this.props.item.percentageComplete
65
53
  });
66
54
  });
67
-
68
55
  _this.state = {
69
56
  transitioning: false,
70
57
  oldMarkerColor: getMarkerColor(_this.props.item.status),
@@ -72,7 +59,6 @@ var ProgressTrackerStage = /*#__PURE__*/function (_PureComponent) {
72
59
  };
73
60
  return _this;
74
61
  }
75
-
76
62
  _createClass(ProgressTrackerStage, [{
77
63
  key: "UNSAFE_componentWillMount",
78
64
  value: function UNSAFE_componentWillMount() {
@@ -96,17 +82,17 @@ var ProgressTrackerStage = /*#__PURE__*/function (_PureComponent) {
96
82
  key: "render",
97
83
  value: function render() {
98
84
  var _listInlineStyles;
99
-
100
85
  var _this$props = this.props,
101
- item = _this$props.item,
102
- render = _this$props.render,
103
- transitionDelay = _this$props.transitionDelay,
104
- transitionSpeed = _this$props.transitionSpeed,
105
- transitionEasing = _this$props.transitionEasing,
106
- testId = _this$props.testId;
86
+ item = _this$props.item,
87
+ render = _this$props.render,
88
+ transitionDelay = _this$props.transitionDelay,
89
+ transitionSpeed = _this$props.transitionSpeed,
90
+ transitionEasing = _this$props.transitionEasing,
91
+ testId = _this$props.testId;
107
92
  var ariaCurrent = item.status === 'current' ? 'step' : 'false';
108
93
  var listInlineStyles = (_listInlineStyles = {}, _defineProperty(_listInlineStyles, varTransitionSpeed, "".concat(transitionSpeed, "ms")), _defineProperty(_listInlineStyles, varTransitionDelay, "".concat(transitionDelay, "ms")), _defineProperty(_listInlineStyles, varTransitionEasing, transitionEasing), _defineProperty(_listInlineStyles, varMarkerColor, this.state.oldMarkerColor), _defineProperty(_listInlineStyles, varBackgroundColor, getMarkerColor(item.status)), _listInlineStyles);
109
- return (// eslint-disable-next-line @repo/internal/react/use-primitives
94
+ return (
95
+ // eslint-disable-next-line @repo/internal/react/use-primitives
110
96
  jsx("li", {
111
97
  "data-testid": testId,
112
98
  style: listInlineStyles,
@@ -154,8 +140,6 @@ var ProgressTrackerStage = /*#__PURE__*/function (_PureComponent) {
154
140
  );
155
141
  }
156
142
  }]);
157
-
158
143
  return ProgressTrackerStage;
159
144
  }(PureComponent);
160
-
161
145
  export { ProgressTrackerStage as default };
@@ -4,12 +4,10 @@ export var getMarkerColor = function getMarkerColor(status) {
4
4
  switch (status) {
5
5
  case 'unvisited':
6
6
  return "var(--ds-icon-subtle, ".concat(N70, ")");
7
-
8
7
  case 'current':
9
8
  case 'visited':
10
9
  case 'disabled':
11
10
  return "var(--ds-icon-brand, ".concat(B300, ")");
12
-
13
11
  default:
14
12
  return;
15
13
  }
@@ -18,16 +16,12 @@ export var getTextColor = function getTextColor(status) {
18
16
  switch (status) {
19
17
  case 'unvisited':
20
18
  return 'subtlest';
21
-
22
19
  case 'current':
23
20
  return 'brand';
24
-
25
21
  case 'visited':
26
22
  return 'color.text';
27
-
28
23
  case 'disabled':
29
24
  return 'disabled';
30
-
31
25
  default:
32
26
  return;
33
27
  }
@@ -36,12 +30,10 @@ export var getFontWeight = function getFontWeight(status) {
36
30
  switch (status) {
37
31
  case 'unvisited':
38
32
  return REGULAR_FONT_WEIGHT;
39
-
40
33
  case 'current':
41
34
  case 'visited':
42
35
  case 'disabled':
43
36
  return SEMI_BOLD_FONT_WEIGHT;
44
-
45
37
  default:
46
38
  return undefined;
47
39
  }
@@ -5,17 +5,11 @@ import _inherits from "@babel/runtime/helpers/inherits";
5
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
-
9
8
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
-
11
9
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
12
-
13
10
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
-
15
11
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
16
-
17
12
  /* eslint-disable @repo/internal/styles/no-nested-styles */
18
-
19
13
  /** @jsx jsx */
20
14
  import { PureComponent } from 'react';
21
15
  import { css, jsx } from '@emotion/react';
@@ -28,31 +22,24 @@ var containerStyles = css({
28
22
  width: '100%',
29
23
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
30
24
  margin: '0 auto',
31
- padding: "var(--ds-scale-0, 0px)",
25
+ padding: "var(--ds-space-0, 0px)",
32
26
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
33
27
  gap: "var(".concat(varSpacing, ")"),
34
28
  listStyleType: 'none',
35
29
  '&&': {
36
- marginTop: "var(--ds-scale-500, 40px)"
30
+ marginTop: "var(--ds-space-500, 40px)"
37
31
  }
38
32
  });
39
-
40
33
  var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
41
34
  _inherits(ProgressTracker, _PureComponent);
42
-
43
35
  var _super = _createSuper(ProgressTracker);
44
-
45
36
  function ProgressTracker() {
46
37
  var _this;
47
-
48
38
  _classCallCheck(this, ProgressTracker);
49
-
50
39
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
51
40
  args[_key] = arguments[_key];
52
41
  }
53
-
54
42
  _this = _super.call.apply(_super, [this].concat(args));
55
-
56
43
  _defineProperty(_assertThisInitialized(_this), "state", {
57
44
  prevStages: _this.props.items.map(function (stage) {
58
45
  return _objectSpread(_objectSpread({}, stage), {}, {
@@ -60,20 +47,16 @@ var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
60
47
  });
61
48
  })
62
49
  });
63
-
64
50
  return _this;
65
51
  }
66
-
67
52
  _createClass(ProgressTracker, [{
68
53
  key: "UNSAFE_componentWillReceiveProps",
69
54
  value: function UNSAFE_componentWillReceiveProps(nextProps) {
70
55
  var _this2 = this;
71
-
72
56
  var prevStages = nextProps.items.map(function (stage) {
73
57
  var oldStage = _this2.props.items.find(function (st) {
74
58
  return st.id === stage.id;
75
59
  });
76
-
77
60
  return oldStage !== undefined ? oldStage : stage;
78
61
  });
79
62
  this.setState({
@@ -84,11 +67,10 @@ var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
84
67
  key: "render",
85
68
  value: function render() {
86
69
  var _this3 = this,
87
- _listInlineStyles;
88
-
70
+ _listInlineStyles;
89
71
  var _this$props = this.props,
90
- testId = _this$props.testId,
91
- label = _this$props.label;
72
+ testId = _this$props.testId,
73
+ label = _this$props.label;
92
74
  var progressChanges = this.props.items.filter(function (stage, index) {
93
75
  return stage.percentageComplete !== _this3.state.prevStages[index].percentageComplete;
94
76
  }).length;
@@ -104,10 +86,8 @@ var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
104
86
  var transitionSpeed = 0;
105
87
  var transitionDelay = 0;
106
88
  var transitionEasing = progressChanges > 1 ? 'linear' : ANIMATION_EASE_OUT;
107
-
108
89
  if (_this3.props.animated) {
109
90
  transitionSpeed = progressChanges > 1 ? LINEAR_TRANSITION_SPEED : TRANSITION_SPEED;
110
-
111
91
  if (stage.percentageComplete < _this3.state.prevStages[index].percentageComplete) {
112
92
  /**
113
93
  * load each transition sequentially in reverse
@@ -122,7 +102,6 @@ var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
122
102
  stepsForward -= 1;
123
103
  }
124
104
  }
125
-
126
105
  return jsx(Stage, {
127
106
  transitionSpeed: transitionSpeed,
128
107
  transitionDelay: transitionDelay,
@@ -135,7 +114,8 @@ var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
135
114
  var listInlineStyles = (_listInlineStyles = {
136
115
  gridTemplateColumns: "repeat(".concat(items.length, ", 1fr)")
137
116
  }, _defineProperty(_listInlineStyles, varSpacing, spacing[this.props.spacing]), _defineProperty(_listInlineStyles, "maxWidth", 8 * 10 * items.length * 2), _listInlineStyles);
138
- return (// eslint-disable-next-line @repo/internal/react/use-primitives
117
+ return (
118
+ // eslint-disable-next-line @repo/internal/react/use-primitives
139
119
  jsx("ul", {
140
120
  "data-testid": testId,
141
121
  style: listInlineStyles,
@@ -145,10 +125,8 @@ var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
145
125
  );
146
126
  }
147
127
  }]);
148
-
149
128
  return ProgressTracker;
150
129
  }(PureComponent);
151
-
152
130
  _defineProperty(ProgressTracker, "defaultProps", {
153
131
  items: [],
154
132
  spacing: 'cosy',
@@ -161,5 +139,4 @@ _defineProperty(ProgressTracker, "defaultProps", {
161
139
  animated: true,
162
140
  label: 'Progress'
163
141
  });
164
-
165
142
  export { ProgressTracker as default };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-tracker",
3
- "version": "8.4.4",
3
+ "version": "8.4.5",
4
4
  "sideEffects": false
5
5
  }
@@ -2,8 +2,8 @@
2
2
  * Ideally these are exported by @atlaskit/page
3
3
  */
4
4
  export declare const spacing: {
5
- readonly comfortable: "var(--ds-scale-500)";
6
- readonly cosy: "var(--ds-scale-200)";
7
- readonly compact: "var(--ds-scale-050)";
5
+ readonly comfortable: "var(--ds-space-500)";
6
+ readonly cosy: "var(--ds-space-200)";
7
+ readonly compact: "var(--ds-space-050)";
8
8
  };
9
9
  export declare type Spacing = keyof typeof spacing;
@@ -9,6 +9,6 @@ export declare const varMarkerColor = "--ds--pt--mc";
9
9
  export declare const varBackgroundColor = "--ds--pt--bg";
10
10
  export declare const SEMI_BOLD_FONT_WEIGHT = "semibold";
11
11
  export declare const REGULAR_FONT_WEIGHT = "regular";
12
- export declare const HALF_GRID_SIZE: "var(--ds-scale-050)";
13
- export declare const PROGRESS_BAR_HEIGHT: "var(--ds-scale-100)";
14
- export declare const LABEL_TOP_SPACING: "var(--ds-scale-300)";
12
+ export declare const HALF_GRID_SIZE: "var(--ds-space-050)";
13
+ export declare const PROGRESS_BAR_HEIGHT: "var(--ds-space-100)";
14
+ export declare const LABEL_TOP_SPACING: "var(--ds-space-300)";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-tracker",
3
- "version": "8.4.4",
3
+ "version": "8.4.5",
4
4
  "description": "A progress tracker displays the steps and progress through a journey.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"