@atlaskit/progress-tracker 8.3.4 → 8.4.0
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 +6 -0
- package/dist/cjs/constants.js +4 -9
- package/dist/cjs/internal/bar.js +10 -8
- package/dist/cjs/internal/constants.js +3 -6
- package/dist/cjs/internal/link.js +8 -6
- package/dist/cjs/internal/marker.js +8 -5
- package/dist/cjs/internal/stage.js +52 -51
- package/dist/cjs/internal/utils.js +4 -4
- package/dist/cjs/progress-tracker.js +14 -13
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/constants.js +3 -6
- package/dist/es2019/internal/bar.js +4 -3
- package/dist/es2019/internal/constants.js +3 -4
- package/dist/es2019/internal/link.js +2 -1
- package/dist/es2019/internal/marker.js +4 -2
- package/dist/es2019/internal/stage.js +54 -54
- package/dist/es2019/internal/utils.js +5 -5
- package/dist/es2019/progress-tracker.js +14 -13
- package/dist/es2019/version.json +1 -1
- package/dist/esm/constants.js +3 -6
- package/dist/esm/internal/bar.js +10 -8
- package/dist/esm/internal/constants.js +3 -4
- package/dist/esm/internal/link.js +8 -6
- package/dist/esm/internal/marker.js +8 -5
- package/dist/esm/internal/stage.js +49 -49
- package/dist/esm/internal/utils.js +5 -5
- package/dist/esm/progress-tracker.js +15 -14
- package/dist/esm/version.json +1 -1
- package/dist/types/constants.d.ts +3 -4
- package/dist/types/internal/bar.d.ts +1 -0
- package/dist/types/internal/constants.d.ts +3 -3
- package/dist/types/internal/utils.d.ts +2 -1
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/progress-tracker
|
|
2
2
|
|
|
3
|
+
## 8.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`eb709e1fde3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/eb709e1fde3) - [ux] Apply spacing tokens and primitive components. Reduce padding between stage labels and progress bar by 4px - overall height of component is therefore also 4px shorter.
|
|
8
|
+
|
|
3
9
|
## 8.3.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/constants.js
CHANGED
|
@@ -3,19 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.spacing =
|
|
6
|
+
exports.spacing = void 0;
|
|
7
7
|
|
|
8
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
9
|
-
|
|
10
|
-
var defaultGridSize = (0, _constants.gridSize)();
|
|
11
8
|
/**
|
|
12
9
|
* Ideally these are exported by @atlaskit/page
|
|
13
10
|
*/
|
|
14
|
-
|
|
15
|
-
exports.defaultGridSize = defaultGridSize;
|
|
16
11
|
var spacing = {
|
|
17
|
-
comfortable:
|
|
18
|
-
cosy:
|
|
19
|
-
compact:
|
|
12
|
+
comfortable: "var(--ds-scale-500, 40px)",
|
|
13
|
+
cosy: "var(--ds-scale-200, 16px)",
|
|
14
|
+
compact: "var(--ds-scale-050, 4px)"
|
|
20
15
|
};
|
|
21
16
|
exports.spacing = spacing;
|
package/dist/cjs/internal/bar.js
CHANGED
|
@@ -21,7 +21,7 @@ var progressBarStyles = (0, _react.css)({
|
|
|
21
21
|
backgroundColor: "var(--ds-background-brand-bold, ".concat(_colors.B300, ")"),
|
|
22
22
|
borderBottomRightRadius: _constants2.PROGRESS_BAR_HEIGHT,
|
|
23
23
|
borderTopRightRadius: _constants2.PROGRESS_BAR_HEIGHT,
|
|
24
|
-
transform: "translate(0, -".concat(_constants2.LABEL_TOP_SPACING, "
|
|
24
|
+
transform: "translate(0, calc(-1 * ".concat(_constants2.LABEL_TOP_SPACING, "))"),
|
|
25
25
|
transition: "width var(".concat(_constants2.varTransitionSpeed, ") var(").concat(_constants2.varTransitionEasing, ")"),
|
|
26
26
|
transitionDelay: "var(".concat(_constants2.varTransitionDelay, ")")
|
|
27
27
|
});
|
|
@@ -35,13 +35,15 @@ var progressBarStyles = (0, _react.css)({
|
|
|
35
35
|
var ProgressBar = function ProgressBar(_ref) {
|
|
36
36
|
var percentageComplete = _ref.percentageComplete,
|
|
37
37
|
testId = _ref.testId;
|
|
38
|
-
return (
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
return (// eslint-disable-next-line @repo/internal/react/use-primitives
|
|
39
|
+
(0, _react.jsx)("div", {
|
|
40
|
+
"data-testid": testId,
|
|
41
|
+
style: {
|
|
42
|
+
width: "calc(".concat(percentageComplete, "% + ").concat(percentageComplete / 100, " * calc(var(").concat(_constants2.varSpacing, ", ").concat(_constants.spacing.cosy, ") + ").concat(_constants2.HALF_GRID_SIZE, "))")
|
|
43
|
+
},
|
|
44
|
+
css: progressBarStyles
|
|
45
|
+
})
|
|
46
|
+
);
|
|
45
47
|
};
|
|
46
48
|
|
|
47
49
|
var _default = ProgressBar;
|
|
@@ -4,9 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.varTransitionSpeed = exports.varTransitionEasing = exports.varTransitionDelay = exports.varSpacing = exports.varMarkerColor = exports.varBackgroundColor = exports.TRANSITION_SPEED = exports.SEMI_BOLD_FONT_WEIGHT = exports.REGULAR_FONT_WEIGHT = exports.PROGRESS_BAR_HEIGHT = exports.LINEAR_TRANSITION_SPEED = exports.LABEL_TOP_SPACING = exports.HALF_GRID_SIZE = exports.ANIMATION_EASE_OUT = void 0;
|
|
7
|
-
|
|
8
|
-
var _constants = require("../constants");
|
|
9
|
-
|
|
10
7
|
var TRANSITION_SPEED = 300;
|
|
11
8
|
exports.TRANSITION_SPEED = TRANSITION_SPEED;
|
|
12
9
|
var LINEAR_TRANSITION_SPEED = 50;
|
|
@@ -29,10 +26,10 @@ var SEMI_BOLD_FONT_WEIGHT = '600';
|
|
|
29
26
|
exports.SEMI_BOLD_FONT_WEIGHT = SEMI_BOLD_FONT_WEIGHT;
|
|
30
27
|
var REGULAR_FONT_WEIGHT = '400';
|
|
31
28
|
exports.REGULAR_FONT_WEIGHT = REGULAR_FONT_WEIGHT;
|
|
32
|
-
var HALF_GRID_SIZE =
|
|
29
|
+
var HALF_GRID_SIZE = "var(--ds-scale-050, 4px)";
|
|
33
30
|
exports.HALF_GRID_SIZE = HALF_GRID_SIZE;
|
|
34
|
-
var PROGRESS_BAR_HEIGHT =
|
|
31
|
+
var PROGRESS_BAR_HEIGHT = "var(--ds-scale-100, 8px)"; // Labels sit 16px from bottom of progress bar i.e. 8 + 16
|
|
35
32
|
|
|
36
33
|
exports.PROGRESS_BAR_HEIGHT = PROGRESS_BAR_HEIGHT;
|
|
37
|
-
var LABEL_TOP_SPACING =
|
|
34
|
+
var LABEL_TOP_SPACING = "var(--ds-scale-300, 24px)";
|
|
38
35
|
exports.LABEL_TOP_SPACING = LABEL_TOP_SPACING;
|
|
@@ -23,12 +23,14 @@ var Link = function Link(_ref) {
|
|
|
23
23
|
onClick = _ref.onClick,
|
|
24
24
|
label = _ref.label,
|
|
25
25
|
testId = _ref.testId;
|
|
26
|
-
return (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
return (// eslint-disable-next-line @repo/internal/react/use-primitives
|
|
27
|
+
(0, _react.jsx)("a", {
|
|
28
|
+
css: linkStyles,
|
|
29
|
+
href: href,
|
|
30
|
+
onClick: onClick,
|
|
31
|
+
"data-testid": testId
|
|
32
|
+
}, label)
|
|
33
|
+
);
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
var _default = Link;
|
|
@@ -19,7 +19,7 @@ var progressMarkerStyles = (0, _react.css)({
|
|
|
19
19
|
left: '50%',
|
|
20
20
|
backgroundColor: "var(".concat(_constants.varBackgroundColor, ")"),
|
|
21
21
|
borderRadius: _constants.PROGRESS_BAR_HEIGHT,
|
|
22
|
-
transform: "translate(-50%, -".concat(_constants.LABEL_TOP_SPACING, "
|
|
22
|
+
transform: "translate(-50%, calc(-1 * ".concat(_constants.LABEL_TOP_SPACING, "))"),
|
|
23
23
|
transition: "opacity var(".concat(_constants.varTransitionSpeed, ") var(").concat(_constants.varTransitionEasing, "), background-color var(").concat(_constants.varTransitionSpeed, ") var(").concat(_constants.varTransitionEasing, ")"),
|
|
24
24
|
transitionDelay: "var(".concat(_constants.varTransitionDelay, ")"),
|
|
25
25
|
'&.fade-appear': {
|
|
@@ -43,10 +43,13 @@ var progressMarkerStyles = (0, _react.css)({
|
|
|
43
43
|
|
|
44
44
|
var ProgressMarker = function ProgressMarker(_ref) {
|
|
45
45
|
var testId = _ref.testId;
|
|
46
|
-
return (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
return (// too many props that would go in UNSAFE_style + css transition prop having issues
|
|
47
|
+
// eslint-disable-next-line @repo/internal/react/use-primitives
|
|
48
|
+
(0, _react.jsx)("div", {
|
|
49
|
+
"data-testid": testId,
|
|
50
|
+
css: progressMarkerStyles
|
|
51
|
+
})
|
|
52
|
+
);
|
|
50
53
|
};
|
|
51
54
|
|
|
52
55
|
var _default = ProgressMarker;
|
|
@@ -27,11 +27,13 @@ var _react2 = require("@emotion/react");
|
|
|
27
27
|
|
|
28
28
|
var _reactTransitionGroup = require("react-transition-group");
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
|
|
31
|
+
|
|
32
|
+
var _text = _interopRequireDefault(require("@atlaskit/ds-explorations/text"));
|
|
31
33
|
|
|
32
34
|
var _bar = _interopRequireDefault(require("./bar"));
|
|
33
35
|
|
|
34
|
-
var
|
|
36
|
+
var _constants = require("./constants");
|
|
35
37
|
|
|
36
38
|
var _marker = _interopRequireDefault(require("./marker"));
|
|
37
39
|
|
|
@@ -45,22 +47,14 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
45
47
|
|
|
46
48
|
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; } }
|
|
47
49
|
|
|
48
|
-
var containerStyles = (0, _react2.css)({
|
|
49
|
-
width: '100%',
|
|
50
|
-
position: 'relative'
|
|
51
|
-
});
|
|
52
50
|
var listItemStyles = (0, _react2.css)({
|
|
53
|
-
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
54
51
|
margin: "var(--ds-scale-0, 0px)",
|
|
55
52
|
overflowWrap: 'break-word'
|
|
56
53
|
});
|
|
57
54
|
var titleStyles = (0, _react2.css)({
|
|
58
|
-
marginTop: _constants2.LABEL_TOP_SPACING,
|
|
59
55
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
60
|
-
|
|
56
|
+
marginTop: _constants.LABEL_TOP_SPACING,
|
|
61
57
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
62
|
-
marginLeft: 'auto',
|
|
63
|
-
fontSize: (0, _constants.fontSize)(),
|
|
64
58
|
lineHeight: '16px',
|
|
65
59
|
textAlign: 'center',
|
|
66
60
|
'&.fade-appear': {
|
|
@@ -68,7 +62,7 @@ var titleStyles = (0, _react2.css)({
|
|
|
68
62
|
},
|
|
69
63
|
'&.fade-appear.fade-appear-active': {
|
|
70
64
|
opacity: 1,
|
|
71
|
-
transition: "opacity var(".concat(
|
|
65
|
+
transition: "opacity var(".concat(_constants.varTransitionSpeed, ") cubic-bezier(0.2, 0, 0, 1)")
|
|
72
66
|
}
|
|
73
67
|
});
|
|
74
68
|
|
|
@@ -119,7 +113,7 @@ var ProgressTrackerStage = /*#__PURE__*/function (_PureComponent) {
|
|
|
119
113
|
}, {
|
|
120
114
|
key: "render",
|
|
121
115
|
value: function render() {
|
|
122
|
-
var
|
|
116
|
+
var _listInlineStyles;
|
|
123
117
|
|
|
124
118
|
var _this$props = this.props,
|
|
125
119
|
item = _this$props.item,
|
|
@@ -129,46 +123,53 @@ var ProgressTrackerStage = /*#__PURE__*/function (_PureComponent) {
|
|
|
129
123
|
transitionEasing = _this$props.transitionEasing,
|
|
130
124
|
testId = _this$props.testId;
|
|
131
125
|
var ariaCurrent = item.status === 'current' ? 'step' : 'false';
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
126
|
+
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
|
|
128
|
+
(0, _react2.jsx)("li", {
|
|
129
|
+
"data-testid": testId,
|
|
130
|
+
style: listInlineStyles,
|
|
131
|
+
css: listItemStyles,
|
|
132
|
+
"aria-current": ariaCurrent
|
|
133
|
+
}, (0, _react2.jsx)(_box.default, {
|
|
134
|
+
display: "block",
|
|
135
|
+
UNSAFE_style: {
|
|
136
|
+
width: '100%'
|
|
137
|
+
}
|
|
138
|
+
}, (0, _react2.jsx)(_reactTransitionGroup.CSSTransition, {
|
|
139
|
+
appear: true,
|
|
140
|
+
in: this.state.transitioning,
|
|
141
|
+
onEntered: this.onEntered,
|
|
142
|
+
timeout: transitionDelay + transitionSpeed,
|
|
143
|
+
classNames: "fade"
|
|
144
|
+
}, (0, _react2.jsx)(_marker.default, {
|
|
145
|
+
testId: testId && "".concat(testId, "-marker")
|
|
146
|
+
})), (0, _react2.jsx)(_reactTransitionGroup.CSSTransition, {
|
|
147
|
+
appear: true,
|
|
148
|
+
in: this.state.transitioning,
|
|
149
|
+
onEntered: this.onEntered,
|
|
150
|
+
timeout: transitionDelay + transitionSpeed,
|
|
151
|
+
classNames: "fade"
|
|
152
|
+
}, (0, _react2.jsx)(_bar.default, {
|
|
153
|
+
testId: testId && "".concat(testId, "-bar"),
|
|
154
|
+
percentageComplete: item.percentageComplete
|
|
155
|
+
})), (0, _react2.jsx)(_reactTransitionGroup.CSSTransition, {
|
|
156
|
+
appear: true,
|
|
157
|
+
in: this.state.transitioning,
|
|
158
|
+
onEntered: this.onEntered,
|
|
159
|
+
timeout: transitionDelay + transitionSpeed,
|
|
160
|
+
classNames: "fade"
|
|
161
|
+
}, (0, _react2.jsx)("div", {
|
|
162
|
+
css: titleStyles
|
|
163
|
+
}, (0, _react2.jsx)(_text.default, {
|
|
164
|
+
fontSize: "14px",
|
|
165
|
+
lineHeight: "16px",
|
|
166
|
+
testId: testId && "".concat(testId, "-title"),
|
|
166
167
|
color: (0, _utils.getTextColor)(item.status),
|
|
167
168
|
fontWeight: (0, _utils.getFontWeight)(item.status)
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
}, this.shouldShowLink() ? render.link({
|
|
170
|
+
item: item
|
|
171
|
+
}) : item.label)))))
|
|
172
|
+
);
|
|
172
173
|
}
|
|
173
174
|
}]);
|
|
174
175
|
return ProgressTrackerStage;
|
|
@@ -29,16 +29,16 @@ exports.getMarkerColor = getMarkerColor;
|
|
|
29
29
|
var getTextColor = function getTextColor(status) {
|
|
30
30
|
switch (status) {
|
|
31
31
|
case 'unvisited':
|
|
32
|
-
return
|
|
32
|
+
return 'subtlest';
|
|
33
33
|
|
|
34
34
|
case 'current':
|
|
35
|
-
return
|
|
35
|
+
return 'brand';
|
|
36
36
|
|
|
37
37
|
case 'visited':
|
|
38
|
-
return
|
|
38
|
+
return 'color.text';
|
|
39
39
|
|
|
40
40
|
case 'disabled':
|
|
41
|
-
return
|
|
41
|
+
return 'disabled';
|
|
42
42
|
|
|
43
43
|
default:
|
|
44
44
|
return;
|
|
@@ -46,13 +46,11 @@ var containerStyles = (0, _react2.css)({
|
|
|
46
46
|
width: '100%',
|
|
47
47
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
48
48
|
margin: '0 auto',
|
|
49
|
-
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
50
49
|
padding: "var(--ds-scale-0, 0px)",
|
|
51
50
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
52
51
|
gap: "var(".concat(_constants2.varSpacing, ")"),
|
|
53
52
|
listStyleType: 'none',
|
|
54
53
|
'&&': {
|
|
55
|
-
// TODO Delete this comment after verifying spacing token -> previous value `40`
|
|
56
54
|
marginTop: "var(--ds-scale-500, 40px)"
|
|
57
55
|
}
|
|
58
56
|
});
|
|
@@ -102,7 +100,7 @@ var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
|
|
|
102
100
|
key: "render",
|
|
103
101
|
value: function render() {
|
|
104
102
|
var _this3 = this,
|
|
105
|
-
|
|
103
|
+
_listInlineStyles;
|
|
106
104
|
|
|
107
105
|
var _this$props = this.props,
|
|
108
106
|
testId = _this$props.testId,
|
|
@@ -150,14 +148,17 @@ var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
|
|
|
150
148
|
render: _this3.props.render
|
|
151
149
|
});
|
|
152
150
|
});
|
|
153
|
-
|
|
154
|
-
"
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
151
|
+
var listInlineStyles = (_listInlineStyles = {
|
|
152
|
+
gridTemplateColumns: "repeat(".concat(items.length, ", 1fr)")
|
|
153
|
+
}, (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
|
|
155
|
+
(0, _react2.jsx)("ul", {
|
|
156
|
+
"data-testid": testId,
|
|
157
|
+
style: listInlineStyles,
|
|
158
|
+
css: containerStyles,
|
|
159
|
+
"aria-label": label
|
|
160
|
+
}, items)
|
|
161
|
+
);
|
|
161
162
|
}
|
|
162
163
|
}]);
|
|
163
164
|
return ProgressTracker;
|
|
@@ -168,8 +169,8 @@ exports.default = ProgressTracker;
|
|
|
168
169
|
items: [],
|
|
169
170
|
spacing: 'cosy',
|
|
170
171
|
render: {
|
|
171
|
-
link: function link(
|
|
172
|
-
var item =
|
|
172
|
+
link: function link(_ref) {
|
|
173
|
+
var item = _ref.item;
|
|
173
174
|
return (0, _react2.jsx)(_link.default, item);
|
|
174
175
|
}
|
|
175
176
|
},
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/constants.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
2
|
-
export const defaultGridSize = getGridSize();
|
|
3
1
|
/**
|
|
4
2
|
* Ideally these are exported by @atlaskit/page
|
|
5
3
|
*/
|
|
6
|
-
|
|
7
4
|
export const spacing = {
|
|
8
|
-
comfortable:
|
|
9
|
-
cosy:
|
|
10
|
-
compact:
|
|
5
|
+
comfortable: "var(--ds-scale-500, 40px)",
|
|
6
|
+
cosy: "var(--ds-scale-200, 16px)",
|
|
7
|
+
compact: "var(--ds-scale-050, 4px)"
|
|
11
8
|
};
|
|
@@ -10,7 +10,7 @@ const progressBarStyles = css({
|
|
|
10
10
|
backgroundColor: `var(--ds-background-brand-bold, ${B300})`,
|
|
11
11
|
borderBottomRightRadius: PROGRESS_BAR_HEIGHT,
|
|
12
12
|
borderTopRightRadius: PROGRESS_BAR_HEIGHT,
|
|
13
|
-
transform: `translate(0,
|
|
13
|
+
transform: `translate(0, calc(-1 * ${LABEL_TOP_SPACING}))`,
|
|
14
14
|
transition: `width var(${varTransitionSpeed}) var(${varTransitionEasing})`,
|
|
15
15
|
transitionDelay: `var(${varTransitionDelay})`
|
|
16
16
|
});
|
|
@@ -24,10 +24,11 @@ const progressBarStyles = css({
|
|
|
24
24
|
const ProgressBar = ({
|
|
25
25
|
percentageComplete,
|
|
26
26
|
testId
|
|
27
|
-
}) =>
|
|
27
|
+
}) => // eslint-disable-next-line @repo/internal/react/use-primitives
|
|
28
|
+
jsx("div", {
|
|
28
29
|
"data-testid": testId,
|
|
29
30
|
style: {
|
|
30
|
-
width: `calc(${percentageComplete}% + ${percentageComplete / 100} * calc(var(${varSpacing}, ${spacing.cosy}
|
|
31
|
+
width: `calc(${percentageComplete}% + ${percentageComplete / 100} * calc(var(${varSpacing}, ${spacing.cosy}) + ${HALF_GRID_SIZE}))`
|
|
31
32
|
},
|
|
32
33
|
css: progressBarStyles
|
|
33
34
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { defaultGridSize } from '../constants';
|
|
2
1
|
export const TRANSITION_SPEED = 300;
|
|
3
2
|
export const LINEAR_TRANSITION_SPEED = 50;
|
|
4
3
|
export const ANIMATION_EASE_OUT = 'cubic-bezier(0.15,1,0.3,1)';
|
|
@@ -10,7 +9,7 @@ export const varMarkerColor = '--ds--pt--mc';
|
|
|
10
9
|
export const varBackgroundColor = '--ds--pt--bg';
|
|
11
10
|
export const SEMI_BOLD_FONT_WEIGHT = '600';
|
|
12
11
|
export const REGULAR_FONT_WEIGHT = '400';
|
|
13
|
-
export const HALF_GRID_SIZE =
|
|
14
|
-
export const PROGRESS_BAR_HEIGHT =
|
|
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
|
|
15
14
|
|
|
16
|
-
export const LABEL_TOP_SPACING =
|
|
15
|
+
export const LABEL_TOP_SPACING = "var(--ds-scale-300, 24px)";
|
|
@@ -10,7 +10,7 @@ const progressMarkerStyles = css({
|
|
|
10
10
|
left: '50%',
|
|
11
11
|
backgroundColor: `var(${varBackgroundColor})`,
|
|
12
12
|
borderRadius: PROGRESS_BAR_HEIGHT,
|
|
13
|
-
transform: `translate(-50%,
|
|
13
|
+
transform: `translate(-50%, calc(-1 * ${LABEL_TOP_SPACING}))`,
|
|
14
14
|
transition: `opacity var(${varTransitionSpeed}) var(${varTransitionEasing}), background-color var(${varTransitionSpeed}) var(${varTransitionEasing})`,
|
|
15
15
|
transitionDelay: `var(${varTransitionDelay})`,
|
|
16
16
|
'&.fade-appear': {
|
|
@@ -34,7 +34,9 @@ const progressMarkerStyles = css({
|
|
|
34
34
|
|
|
35
35
|
const ProgressMarker = ({
|
|
36
36
|
testId
|
|
37
|
-
}) =>
|
|
37
|
+
}) => // too many props that would go in UNSAFE_style + css transition prop having issues
|
|
38
|
+
// eslint-disable-next-line @repo/internal/react/use-primitives
|
|
39
|
+
jsx("div", {
|
|
38
40
|
"data-testid": testId,
|
|
39
41
|
css: progressMarkerStyles
|
|
40
42
|
});
|
|
@@ -6,27 +6,20 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
6
6
|
import { PureComponent } from 'react';
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
8
|
import { CSSTransition } from 'react-transition-group';
|
|
9
|
-
import
|
|
9
|
+
import Box from '@atlaskit/ds-explorations/box';
|
|
10
|
+
import Text from '@atlaskit/ds-explorations/text';
|
|
10
11
|
import ProgressBar from './bar';
|
|
11
12
|
import { LABEL_TOP_SPACING, varBackgroundColor, varMarkerColor, varTransitionDelay, varTransitionEasing, varTransitionSpeed } from './constants';
|
|
12
13
|
import ProgressMarker from './marker';
|
|
13
14
|
import { getFontWeight, getMarkerColor, getTextColor } from './utils';
|
|
14
|
-
const containerStyles = css({
|
|
15
|
-
width: '100%',
|
|
16
|
-
position: 'relative'
|
|
17
|
-
});
|
|
18
15
|
const listItemStyles = css({
|
|
19
|
-
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
20
16
|
margin: "var(--ds-scale-0, 0px)",
|
|
21
17
|
overflowWrap: 'break-word'
|
|
22
18
|
});
|
|
23
19
|
const titleStyles = css({
|
|
24
|
-
marginTop: LABEL_TOP_SPACING,
|
|
25
20
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
26
|
-
|
|
21
|
+
marginTop: LABEL_TOP_SPACING,
|
|
27
22
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
28
|
-
marginLeft: 'auto',
|
|
29
|
-
fontSize: fontSize(),
|
|
30
23
|
lineHeight: '16px',
|
|
31
24
|
textAlign: 'center',
|
|
32
25
|
'&.fade-appear': {
|
|
@@ -82,52 +75,59 @@ export default class ProgressTrackerStage extends PureComponent {
|
|
|
82
75
|
testId
|
|
83
76
|
} = this.props;
|
|
84
77
|
const ariaCurrent = item.status === 'current' ? 'step' : 'false';
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
78
|
+
const listInlineStyles = {
|
|
79
|
+
[varTransitionSpeed]: `${transitionSpeed}ms`,
|
|
80
|
+
[varTransitionDelay]: `${transitionDelay}ms`,
|
|
81
|
+
[varTransitionEasing]: transitionEasing,
|
|
82
|
+
[varMarkerColor]: this.state.oldMarkerColor,
|
|
83
|
+
[varBackgroundColor]: getMarkerColor(item.status)
|
|
84
|
+
};
|
|
85
|
+
return (// eslint-disable-next-line @repo/internal/react/use-primitives
|
|
86
|
+
jsx("li", {
|
|
87
|
+
"data-testid": testId,
|
|
88
|
+
style: listInlineStyles,
|
|
89
|
+
css: listItemStyles,
|
|
90
|
+
"aria-current": ariaCurrent
|
|
91
|
+
}, jsx(Box, {
|
|
92
|
+
display: "block",
|
|
93
|
+
UNSAFE_style: {
|
|
94
|
+
width: '100%'
|
|
95
|
+
}
|
|
96
|
+
}, jsx(CSSTransition, {
|
|
97
|
+
appear: true,
|
|
98
|
+
in: this.state.transitioning,
|
|
99
|
+
onEntered: this.onEntered,
|
|
100
|
+
timeout: transitionDelay + transitionSpeed,
|
|
101
|
+
classNames: "fade"
|
|
102
|
+
}, jsx(ProgressMarker, {
|
|
103
|
+
testId: testId && `${testId}-marker`
|
|
104
|
+
})), jsx(CSSTransition, {
|
|
105
|
+
appear: true,
|
|
106
|
+
in: this.state.transitioning,
|
|
107
|
+
onEntered: this.onEntered,
|
|
108
|
+
timeout: transitionDelay + transitionSpeed,
|
|
109
|
+
classNames: "fade"
|
|
110
|
+
}, jsx(ProgressBar, {
|
|
111
|
+
testId: testId && `${testId}-bar`,
|
|
112
|
+
percentageComplete: item.percentageComplete
|
|
113
|
+
})), jsx(CSSTransition, {
|
|
114
|
+
appear: true,
|
|
115
|
+
in: this.state.transitioning,
|
|
116
|
+
onEntered: this.onEntered,
|
|
117
|
+
timeout: transitionDelay + transitionSpeed,
|
|
118
|
+
classNames: "fade"
|
|
119
|
+
}, jsx("div", {
|
|
120
|
+
css: titleStyles
|
|
121
|
+
}, jsx(Text, {
|
|
122
|
+
fontSize: "14px",
|
|
123
|
+
lineHeight: "16px",
|
|
124
|
+
testId: testId && `${testId}-title`,
|
|
125
125
|
color: getTextColor(item.status),
|
|
126
126
|
fontWeight: getFontWeight(item.status)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
item
|
|
130
|
-
|
|
127
|
+
}, this.shouldShowLink() ? render.link({
|
|
128
|
+
item
|
|
129
|
+
}) : item.label)))))
|
|
130
|
+
);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B300,
|
|
1
|
+
import { B300, N70 } from '@atlaskit/theme/colors';
|
|
2
2
|
import { REGULAR_FONT_WEIGHT, SEMI_BOLD_FONT_WEIGHT } from './constants';
|
|
3
3
|
export const getMarkerColor = status => {
|
|
4
4
|
switch (status) {
|
|
@@ -17,16 +17,16 @@ export const getMarkerColor = status => {
|
|
|
17
17
|
export const getTextColor = status => {
|
|
18
18
|
switch (status) {
|
|
19
19
|
case 'unvisited':
|
|
20
|
-
return
|
|
20
|
+
return 'subtlest';
|
|
21
21
|
|
|
22
22
|
case 'current':
|
|
23
|
-
return
|
|
23
|
+
return 'brand';
|
|
24
24
|
|
|
25
25
|
case 'visited':
|
|
26
|
-
return
|
|
26
|
+
return 'color.text';
|
|
27
27
|
|
|
28
28
|
case 'disabled':
|
|
29
|
-
return
|
|
29
|
+
return 'disabled';
|
|
30
30
|
|
|
31
31
|
default:
|
|
32
32
|
return;
|
|
@@ -5,7 +5,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import { PureComponent } from 'react';
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
|
-
import {
|
|
8
|
+
import { spacing } from './constants';
|
|
9
9
|
import { ANIMATION_EASE_OUT, LINEAR_TRANSITION_SPEED, TRANSITION_SPEED, varSpacing } from './internal/constants';
|
|
10
10
|
import Link from './internal/link';
|
|
11
11
|
import Stage from './internal/stage';
|
|
@@ -14,13 +14,11 @@ const containerStyles = css({
|
|
|
14
14
|
width: '100%',
|
|
15
15
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
16
16
|
margin: '0 auto',
|
|
17
|
-
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
18
17
|
padding: "var(--ds-scale-0, 0px)",
|
|
19
18
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
20
19
|
gap: `var(${varSpacing})`,
|
|
21
20
|
listStyleType: 'none',
|
|
22
21
|
'&&': {
|
|
23
|
-
// TODO Delete this comment after verifying spacing token -> previous value `40`
|
|
24
22
|
marginTop: "var(--ds-scale-500, 40px)"
|
|
25
23
|
}
|
|
26
24
|
});
|
|
@@ -87,16 +85,19 @@ export default class ProgressTracker extends PureComponent {
|
|
|
87
85
|
render: this.props.render
|
|
88
86
|
});
|
|
89
87
|
});
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
88
|
+
const listInlineStyles = {
|
|
89
|
+
gridTemplateColumns: `repeat(${items.length}, 1fr)`,
|
|
90
|
+
[varSpacing]: spacing[this.props.spacing],
|
|
91
|
+
maxWidth: 8 * 10 * items.length * 2
|
|
92
|
+
};
|
|
93
|
+
return (// eslint-disable-next-line @repo/internal/react/use-primitives
|
|
94
|
+
jsx("ul", {
|
|
95
|
+
"data-testid": testId,
|
|
96
|
+
style: listInlineStyles,
|
|
97
|
+
css: containerStyles,
|
|
98
|
+
"aria-label": label
|
|
99
|
+
}, items)
|
|
100
|
+
);
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
}
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/constants.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
2
|
-
export var defaultGridSize = getGridSize();
|
|
3
1
|
/**
|
|
4
2
|
* Ideally these are exported by @atlaskit/page
|
|
5
3
|
*/
|
|
6
|
-
|
|
7
4
|
export var spacing = {
|
|
8
|
-
comfortable:
|
|
9
|
-
cosy:
|
|
10
|
-
compact:
|
|
5
|
+
comfortable: "var(--ds-scale-500, 40px)",
|
|
6
|
+
cosy: "var(--ds-scale-200, 16px)",
|
|
7
|
+
compact: "var(--ds-scale-050, 4px)"
|
|
11
8
|
};
|
package/dist/esm/internal/bar.js
CHANGED
|
@@ -10,7 +10,7 @@ var progressBarStyles = css({
|
|
|
10
10
|
backgroundColor: "var(--ds-background-brand-bold, ".concat(B300, ")"),
|
|
11
11
|
borderBottomRightRadius: PROGRESS_BAR_HEIGHT,
|
|
12
12
|
borderTopRightRadius: PROGRESS_BAR_HEIGHT,
|
|
13
|
-
transform: "translate(0, -".concat(LABEL_TOP_SPACING, "
|
|
13
|
+
transform: "translate(0, calc(-1 * ".concat(LABEL_TOP_SPACING, "))"),
|
|
14
14
|
transition: "width var(".concat(varTransitionSpeed, ") var(").concat(varTransitionEasing, ")"),
|
|
15
15
|
transitionDelay: "var(".concat(varTransitionDelay, ")")
|
|
16
16
|
});
|
|
@@ -24,13 +24,15 @@ var progressBarStyles = css({
|
|
|
24
24
|
var ProgressBar = function ProgressBar(_ref) {
|
|
25
25
|
var percentageComplete = _ref.percentageComplete,
|
|
26
26
|
testId = _ref.testId;
|
|
27
|
-
return
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
return (// eslint-disable-next-line @repo/internal/react/use-primitives
|
|
28
|
+
jsx("div", {
|
|
29
|
+
"data-testid": testId,
|
|
30
|
+
style: {
|
|
31
|
+
width: "calc(".concat(percentageComplete, "% + ").concat(percentageComplete / 100, " * calc(var(").concat(varSpacing, ", ").concat(spacing.cosy, ") + ").concat(HALF_GRID_SIZE, "))")
|
|
32
|
+
},
|
|
33
|
+
css: progressBarStyles
|
|
34
|
+
})
|
|
35
|
+
);
|
|
34
36
|
};
|
|
35
37
|
|
|
36
38
|
export default ProgressBar;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { defaultGridSize } from '../constants';
|
|
2
1
|
export var TRANSITION_SPEED = 300;
|
|
3
2
|
export var LINEAR_TRANSITION_SPEED = 50;
|
|
4
3
|
export var ANIMATION_EASE_OUT = 'cubic-bezier(0.15,1,0.3,1)';
|
|
@@ -10,7 +9,7 @@ export var varMarkerColor = '--ds--pt--mc';
|
|
|
10
9
|
export var varBackgroundColor = '--ds--pt--bg';
|
|
11
10
|
export var SEMI_BOLD_FONT_WEIGHT = '600';
|
|
12
11
|
export var REGULAR_FONT_WEIGHT = '400';
|
|
13
|
-
export var HALF_GRID_SIZE =
|
|
14
|
-
export var PROGRESS_BAR_HEIGHT =
|
|
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
|
|
15
14
|
|
|
16
|
-
export var LABEL_TOP_SPACING =
|
|
15
|
+
export var LABEL_TOP_SPACING = "var(--ds-scale-300, 24px)";
|
|
@@ -14,12 +14,14 @@ var Link = function Link(_ref) {
|
|
|
14
14
|
onClick = _ref.onClick,
|
|
15
15
|
label = _ref.label,
|
|
16
16
|
testId = _ref.testId;
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
return (// eslint-disable-next-line @repo/internal/react/use-primitives
|
|
18
|
+
jsx("a", {
|
|
19
|
+
css: linkStyles,
|
|
20
|
+
href: href,
|
|
21
|
+
onClick: onClick,
|
|
22
|
+
"data-testid": testId
|
|
23
|
+
}, label)
|
|
24
|
+
);
|
|
23
25
|
};
|
|
24
26
|
|
|
25
27
|
export default Link;
|
|
@@ -10,7 +10,7 @@ var progressMarkerStyles = css({
|
|
|
10
10
|
left: '50%',
|
|
11
11
|
backgroundColor: "var(".concat(varBackgroundColor, ")"),
|
|
12
12
|
borderRadius: PROGRESS_BAR_HEIGHT,
|
|
13
|
-
transform: "translate(-50%, -".concat(LABEL_TOP_SPACING, "
|
|
13
|
+
transform: "translate(-50%, calc(-1 * ".concat(LABEL_TOP_SPACING, "))"),
|
|
14
14
|
transition: "opacity var(".concat(varTransitionSpeed, ") var(").concat(varTransitionEasing, "), background-color var(").concat(varTransitionSpeed, ") var(").concat(varTransitionEasing, ")"),
|
|
15
15
|
transitionDelay: "var(".concat(varTransitionDelay, ")"),
|
|
16
16
|
'&.fade-appear': {
|
|
@@ -34,10 +34,13 @@ var progressMarkerStyles = css({
|
|
|
34
34
|
|
|
35
35
|
var ProgressMarker = function ProgressMarker(_ref) {
|
|
36
36
|
var testId = _ref.testId;
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
return (// too many props that would go in UNSAFE_style + css transition prop having issues
|
|
38
|
+
// eslint-disable-next-line @repo/internal/react/use-primitives
|
|
39
|
+
jsx("div", {
|
|
40
|
+
"data-testid": testId,
|
|
41
|
+
css: progressMarkerStyles
|
|
42
|
+
})
|
|
43
|
+
);
|
|
41
44
|
};
|
|
42
45
|
|
|
43
46
|
export default ProgressMarker;
|
|
@@ -20,27 +20,20 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
20
20
|
import { PureComponent } from 'react';
|
|
21
21
|
import { css, jsx } from '@emotion/react';
|
|
22
22
|
import { CSSTransition } from 'react-transition-group';
|
|
23
|
-
import
|
|
23
|
+
import Box from '@atlaskit/ds-explorations/box';
|
|
24
|
+
import Text from '@atlaskit/ds-explorations/text';
|
|
24
25
|
import ProgressBar from './bar';
|
|
25
26
|
import { LABEL_TOP_SPACING, varBackgroundColor, varMarkerColor, varTransitionDelay, varTransitionEasing, varTransitionSpeed } from './constants';
|
|
26
27
|
import ProgressMarker from './marker';
|
|
27
28
|
import { getFontWeight, getMarkerColor, getTextColor } from './utils';
|
|
28
|
-
var containerStyles = css({
|
|
29
|
-
width: '100%',
|
|
30
|
-
position: 'relative'
|
|
31
|
-
});
|
|
32
29
|
var listItemStyles = css({
|
|
33
|
-
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
34
30
|
margin: "var(--ds-scale-0, 0px)",
|
|
35
31
|
overflowWrap: 'break-word'
|
|
36
32
|
});
|
|
37
33
|
var titleStyles = css({
|
|
38
|
-
marginTop: LABEL_TOP_SPACING,
|
|
39
34
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
40
|
-
|
|
35
|
+
marginTop: LABEL_TOP_SPACING,
|
|
41
36
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
42
|
-
marginLeft: 'auto',
|
|
43
|
-
fontSize: fontSize(),
|
|
44
37
|
lineHeight: '16px',
|
|
45
38
|
textAlign: 'center',
|
|
46
39
|
'&.fade-appear': {
|
|
@@ -102,7 +95,7 @@ var ProgressTrackerStage = /*#__PURE__*/function (_PureComponent) {
|
|
|
102
95
|
}, {
|
|
103
96
|
key: "render",
|
|
104
97
|
value: function render() {
|
|
105
|
-
var
|
|
98
|
+
var _listInlineStyles;
|
|
106
99
|
|
|
107
100
|
var _this$props = this.props,
|
|
108
101
|
item = _this$props.item,
|
|
@@ -112,46 +105,53 @@ var ProgressTrackerStage = /*#__PURE__*/function (_PureComponent) {
|
|
|
112
105
|
transitionEasing = _this$props.transitionEasing,
|
|
113
106
|
testId = _this$props.testId;
|
|
114
107
|
var ariaCurrent = item.status === 'current' ? 'step' : 'false';
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
108
|
+
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
|
|
110
|
+
jsx("li", {
|
|
111
|
+
"data-testid": testId,
|
|
112
|
+
style: listInlineStyles,
|
|
113
|
+
css: listItemStyles,
|
|
114
|
+
"aria-current": ariaCurrent
|
|
115
|
+
}, jsx(Box, {
|
|
116
|
+
display: "block",
|
|
117
|
+
UNSAFE_style: {
|
|
118
|
+
width: '100%'
|
|
119
|
+
}
|
|
120
|
+
}, jsx(CSSTransition, {
|
|
121
|
+
appear: true,
|
|
122
|
+
in: this.state.transitioning,
|
|
123
|
+
onEntered: this.onEntered,
|
|
124
|
+
timeout: transitionDelay + transitionSpeed,
|
|
125
|
+
classNames: "fade"
|
|
126
|
+
}, jsx(ProgressMarker, {
|
|
127
|
+
testId: testId && "".concat(testId, "-marker")
|
|
128
|
+
})), jsx(CSSTransition, {
|
|
129
|
+
appear: true,
|
|
130
|
+
in: this.state.transitioning,
|
|
131
|
+
onEntered: this.onEntered,
|
|
132
|
+
timeout: transitionDelay + transitionSpeed,
|
|
133
|
+
classNames: "fade"
|
|
134
|
+
}, jsx(ProgressBar, {
|
|
135
|
+
testId: testId && "".concat(testId, "-bar"),
|
|
136
|
+
percentageComplete: item.percentageComplete
|
|
137
|
+
})), jsx(CSSTransition, {
|
|
138
|
+
appear: true,
|
|
139
|
+
in: this.state.transitioning,
|
|
140
|
+
onEntered: this.onEntered,
|
|
141
|
+
timeout: transitionDelay + transitionSpeed,
|
|
142
|
+
classNames: "fade"
|
|
143
|
+
}, jsx("div", {
|
|
144
|
+
css: titleStyles
|
|
145
|
+
}, jsx(Text, {
|
|
146
|
+
fontSize: "14px",
|
|
147
|
+
lineHeight: "16px",
|
|
148
|
+
testId: testId && "".concat(testId, "-title"),
|
|
149
149
|
color: getTextColor(item.status),
|
|
150
150
|
fontWeight: getFontWeight(item.status)
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
}, this.shouldShowLink() ? render.link({
|
|
152
|
+
item: item
|
|
153
|
+
}) : item.label)))))
|
|
154
|
+
);
|
|
155
155
|
}
|
|
156
156
|
}]);
|
|
157
157
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B300,
|
|
1
|
+
import { B300, N70 } from '@atlaskit/theme/colors';
|
|
2
2
|
import { REGULAR_FONT_WEIGHT, SEMI_BOLD_FONT_WEIGHT } from './constants';
|
|
3
3
|
export var getMarkerColor = function getMarkerColor(status) {
|
|
4
4
|
switch (status) {
|
|
@@ -17,16 +17,16 @@ export var getMarkerColor = function getMarkerColor(status) {
|
|
|
17
17
|
export var getTextColor = function getTextColor(status) {
|
|
18
18
|
switch (status) {
|
|
19
19
|
case 'unvisited':
|
|
20
|
-
return
|
|
20
|
+
return 'subtlest';
|
|
21
21
|
|
|
22
22
|
case 'current':
|
|
23
|
-
return
|
|
23
|
+
return 'brand';
|
|
24
24
|
|
|
25
25
|
case 'visited':
|
|
26
|
-
return
|
|
26
|
+
return 'color.text';
|
|
27
27
|
|
|
28
28
|
case 'disabled':
|
|
29
|
-
return
|
|
29
|
+
return 'disabled';
|
|
30
30
|
|
|
31
31
|
default:
|
|
32
32
|
return;
|
|
@@ -19,7 +19,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
19
19
|
/** @jsx jsx */
|
|
20
20
|
import { PureComponent } from 'react';
|
|
21
21
|
import { css, jsx } from '@emotion/react';
|
|
22
|
-
import {
|
|
22
|
+
import { spacing } from './constants';
|
|
23
23
|
import { ANIMATION_EASE_OUT, LINEAR_TRANSITION_SPEED, TRANSITION_SPEED, varSpacing } from './internal/constants';
|
|
24
24
|
import Link from './internal/link';
|
|
25
25
|
import Stage from './internal/stage';
|
|
@@ -28,13 +28,11 @@ var containerStyles = css({
|
|
|
28
28
|
width: '100%',
|
|
29
29
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
30
30
|
margin: '0 auto',
|
|
31
|
-
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
32
31
|
padding: "var(--ds-scale-0, 0px)",
|
|
33
32
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
34
33
|
gap: "var(".concat(varSpacing, ")"),
|
|
35
34
|
listStyleType: 'none',
|
|
36
35
|
'&&': {
|
|
37
|
-
// TODO Delete this comment after verifying spacing token -> previous value `40`
|
|
38
36
|
marginTop: "var(--ds-scale-500, 40px)"
|
|
39
37
|
}
|
|
40
38
|
});
|
|
@@ -86,7 +84,7 @@ var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
|
|
|
86
84
|
key: "render",
|
|
87
85
|
value: function render() {
|
|
88
86
|
var _this3 = this,
|
|
89
|
-
|
|
87
|
+
_listInlineStyles;
|
|
90
88
|
|
|
91
89
|
var _this$props = this.props,
|
|
92
90
|
testId = _this$props.testId,
|
|
@@ -134,14 +132,17 @@ var ProgressTracker = /*#__PURE__*/function (_PureComponent) {
|
|
|
134
132
|
render: _this3.props.render
|
|
135
133
|
});
|
|
136
134
|
});
|
|
137
|
-
|
|
138
|
-
"
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
135
|
+
var listInlineStyles = (_listInlineStyles = {
|
|
136
|
+
gridTemplateColumns: "repeat(".concat(items.length, ", 1fr)")
|
|
137
|
+
}, _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
|
|
139
|
+
jsx("ul", {
|
|
140
|
+
"data-testid": testId,
|
|
141
|
+
style: listInlineStyles,
|
|
142
|
+
css: containerStyles,
|
|
143
|
+
"aria-label": label
|
|
144
|
+
}, items)
|
|
145
|
+
);
|
|
145
146
|
}
|
|
146
147
|
}]);
|
|
147
148
|
|
|
@@ -152,8 +153,8 @@ _defineProperty(ProgressTracker, "defaultProps", {
|
|
|
152
153
|
items: [],
|
|
153
154
|
spacing: 'cosy',
|
|
154
155
|
render: {
|
|
155
|
-
link: function link(
|
|
156
|
-
var item =
|
|
156
|
+
link: function link(_ref) {
|
|
157
|
+
var item = _ref.item;
|
|
157
158
|
return jsx(Link, item);
|
|
158
159
|
}
|
|
159
160
|
},
|
package/dist/esm/version.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export declare const defaultGridSize: number;
|
|
2
1
|
/**
|
|
3
2
|
* Ideally these are exported by @atlaskit/page
|
|
4
3
|
*/
|
|
5
4
|
export declare const spacing: {
|
|
6
|
-
readonly comfortable:
|
|
7
|
-
readonly cosy:
|
|
8
|
-
readonly compact:
|
|
5
|
+
readonly comfortable: "var(--ds-scale-500)";
|
|
6
|
+
readonly cosy: "var(--ds-scale-200)";
|
|
7
|
+
readonly compact: "var(--ds-scale-050)";
|
|
9
8
|
};
|
|
10
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 = "600";
|
|
11
11
|
export declare const REGULAR_FONT_WEIGHT = "400";
|
|
12
|
-
export declare const HALF_GRID_SIZE:
|
|
13
|
-
export declare const PROGRESS_BAR_HEIGHT:
|
|
14
|
-
export declare const LABEL_TOP_SPACING:
|
|
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)";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { TextColor } from '@atlaskit/ds-explorations/text';
|
|
1
2
|
import type { Status } from '../types';
|
|
2
3
|
export declare const getMarkerColor: (status: Status) => "var(--ds-icon-subtle)" | "var(--ds-icon-brand)" | undefined;
|
|
3
|
-
export declare const getTextColor: (status: Status) =>
|
|
4
|
+
export declare const getTextColor: (status: Status) => TextColor | undefined;
|
|
4
5
|
export declare const getFontWeight: (status: Status) => "600" | "400" | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/progress-tracker",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.4.0",
|
|
4
4
|
"description": "A progress tracker displays the steps and progress through a journey.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
+
"@atlaskit/ds-explorations": "^1.2.0",
|
|
27
28
|
"@atlaskit/theme": "^12.2.0",
|
|
28
29
|
"@atlaskit/tokens": "^0.11.0",
|
|
29
30
|
"@babel/runtime": "^7.0.0",
|
|
@@ -63,7 +64,8 @@
|
|
|
63
64
|
"emotion"
|
|
64
65
|
],
|
|
65
66
|
"analytics": "analytics-next",
|
|
66
|
-
"deprecation": "no-deprecated-imports"
|
|
67
|
+
"deprecation": "no-deprecated-imports",
|
|
68
|
+
"ui-components": "primitives"
|
|
67
69
|
}
|
|
68
70
|
},
|
|
69
71
|
"af:exports": {
|