@atlaskit/progress-tracker 8.0.3 → 8.2.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/constants.js +4 -2
  3. package/dist/cjs/index.js +2 -2
  4. package/dist/cjs/internal/bar.js +48 -0
  5. package/dist/cjs/internal/constants.js +38 -0
  6. package/dist/cjs/internal/link.js +35 -0
  7. package/dist/cjs/internal/marker.js +53 -0
  8. package/dist/cjs/internal/stage.js +174 -0
  9. package/dist/cjs/internal/types.js +5 -0
  10. package/dist/cjs/internal/utils.js +65 -0
  11. package/dist/cjs/{ProgressTracker/index.js → progress-tracker.js} +46 -44
  12. package/dist/cjs/version.json +1 -1
  13. package/dist/es2019/constants.js +6 -4
  14. package/dist/es2019/index.js +1 -1
  15. package/dist/es2019/internal/bar.js +35 -0
  16. package/dist/es2019/internal/constants.js +16 -0
  17. package/dist/es2019/internal/link.js +24 -0
  18. package/dist/es2019/internal/marker.js +42 -0
  19. package/dist/es2019/internal/stage.js +130 -0
  20. package/dist/es2019/internal/types.js +1 -0
  21. package/dist/es2019/internal/utils.js +48 -0
  22. package/dist/es2019/{ProgressTracker/index.js → progress-tracker.js} +47 -32
  23. package/dist/es2019/version.json +1 -1
  24. package/dist/esm/constants.js +6 -4
  25. package/dist/esm/index.js +1 -1
  26. package/dist/esm/internal/bar.js +36 -0
  27. package/dist/esm/internal/constants.js +16 -0
  28. package/dist/esm/internal/link.js +25 -0
  29. package/dist/esm/internal/marker.js +43 -0
  30. package/dist/esm/{ProgressTrackerStage/index.js → internal/stage.js} +72 -91
  31. package/dist/esm/internal/types.js +1 -0
  32. package/dist/esm/internal/utils.js +48 -0
  33. package/dist/esm/{ProgressTracker/index.js → progress-tracker.js} +48 -38
  34. package/dist/esm/version.json +1 -1
  35. package/dist/types/constants.d.ts +9 -2
  36. package/dist/types/index.d.ts +2 -2
  37. package/dist/types/internal/bar.d.ts +13 -0
  38. package/dist/types/internal/constants.d.ts +14 -0
  39. package/dist/types/internal/link.d.ts +10 -0
  40. package/dist/types/internal/marker.d.ts +11 -0
  41. package/dist/types/internal/stage.d.ts +17 -0
  42. package/dist/types/internal/types.d.ts +27 -0
  43. package/dist/types/internal/utils.d.ts +4 -0
  44. package/dist/types/{ProgressTracker/index.d.ts → progress-tracker.d.ts} +22 -13
  45. package/dist/types/types.d.ts +11 -4
  46. package/package.json +23 -11
  47. package/dist/cjs/ProgressTracker/styled.js +0 -20
  48. package/dist/cjs/ProgressTrackerLink/index.js +0 -60
  49. package/dist/cjs/ProgressTrackerLink/styled.js +0 -22
  50. package/dist/cjs/ProgressTrackerStage/index.js +0 -199
  51. package/dist/cjs/ProgressTrackerStage/styled.js +0 -133
  52. package/dist/es2019/ProgressTracker/styled.js +0 -13
  53. package/dist/es2019/ProgressTrackerLink/index.js +0 -16
  54. package/dist/es2019/ProgressTrackerLink/styled.js +0 -7
  55. package/dist/es2019/ProgressTrackerStage/index.js +0 -143
  56. package/dist/es2019/ProgressTrackerStage/styled.js +0 -140
  57. package/dist/esm/ProgressTracker/styled.js +0 -7
  58. package/dist/esm/ProgressTrackerLink/index.js +0 -42
  59. package/dist/esm/ProgressTrackerLink/styled.js +0 -8
  60. package/dist/esm/ProgressTrackerStage/styled.js +0 -107
  61. package/dist/types/ProgressTracker/styled.d.ts +0 -3
  62. package/dist/types/ProgressTrackerLink/index.d.ts +0 -10
  63. package/dist/types/ProgressTrackerLink/styled.d.ts +0 -3
  64. package/dist/types/ProgressTrackerStage/index.d.ts +0 -27
  65. package/dist/types/ProgressTrackerStage/styled.d.ts +0 -28
@@ -1,9 +1,11 @@
1
- import { gridSize } from '@atlaskit/theme/constants';
2
- export const defaultGridSize = gridSize();
3
- /** Ideally these are exported by @atlaskit/page */
1
+ import { gridSize as getGridSize } from '@atlaskit/theme/constants';
2
+ export const defaultGridSize = getGridSize();
3
+ /**
4
+ * Ideally these are exported by @atlaskit/page
5
+ */
4
6
 
5
7
  export const spacing = {
6
8
  comfortable: defaultGridSize * 5,
7
9
  cosy: defaultGridSize * 2,
8
- compact: defaultGridSize * 0.5
10
+ compact: defaultGridSize / 2
9
11
  };
@@ -1 +1 @@
1
- export { default as ProgressTracker } from './ProgressTracker';
1
+ export { default as ProgressTracker } from './progress-tracker';
@@ -0,0 +1,35 @@
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/core';
3
+ import { B300 } from '@atlaskit/theme/colors';
4
+ import { spacing } from '../constants';
5
+ import { HALF_GRID_SIZE, LABEL_TOP_SPACING, PROGRESS_BAR_HEIGHT, varSpacing, varTransitionDelay, varTransitionEasing, varTransitionSpeed } from './constants';
6
+ const progressBarStyles = css({
7
+ height: PROGRESS_BAR_HEIGHT,
8
+ position: 'absolute',
9
+ left: '50%',
10
+ backgroundColor: `var(--ds-background-brand-bold, ${B300})`,
11
+ borderBottomRightRadius: PROGRESS_BAR_HEIGHT,
12
+ borderTopRightRadius: PROGRESS_BAR_HEIGHT,
13
+ transform: `translate(0, -${LABEL_TOP_SPACING}px)`,
14
+ transition: `width var(${varTransitionSpeed}) var(${varTransitionEasing})`,
15
+ transitionDelay: `var(${varTransitionDelay})`
16
+ });
17
+ /**
18
+ * __Progress bar__
19
+ *
20
+ * A progress bar describes the horizontal tracking bar that traverses each individual step.
21
+ *
22
+ */
23
+
24
+ const ProgressBar = ({
25
+ percentageComplete,
26
+ testId
27
+ }) => jsx("div", {
28
+ "data-testid": testId,
29
+ style: {
30
+ width: `calc(${percentageComplete}% + ${percentageComplete / 100} * calc(var(${varSpacing}, ${spacing.cosy}px) + ${HALF_GRID_SIZE}px))`
31
+ },
32
+ css: progressBarStyles
33
+ });
34
+
35
+ export default ProgressBar;
@@ -0,0 +1,16 @@
1
+ import { defaultGridSize } from '../constants';
2
+ export const TRANSITION_SPEED = 300;
3
+ export const LINEAR_TRANSITION_SPEED = 50;
4
+ export const ANIMATION_EASE_OUT = 'cubic-bezier(0.15,1,0.3,1)';
5
+ export const varSpacing = '--ds--pt--sp';
6
+ export const varTransitionSpeed = '--ds--pt--ts';
7
+ export const varTransitionDelay = '--ds--pt--td';
8
+ export const varTransitionEasing = '--ds--pt--te';
9
+ export const varMarkerColor = '--ds--pt--mc';
10
+ export const varBackgroundColor = '--ds--pt--bg';
11
+ export const SEMI_BOLD_FONT_WEIGHT = '600';
12
+ export const REGULAR_FONT_WEIGHT = '400';
13
+ export const HALF_GRID_SIZE = defaultGridSize / 2;
14
+ export const PROGRESS_BAR_HEIGHT = defaultGridSize; // Labels sit 20px from bottom of progress bar.
15
+
16
+ export const LABEL_TOP_SPACING = defaultGridSize + 20;
@@ -0,0 +1,24 @@
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/core';
3
+ import { N800 } from '@atlaskit/theme/colors';
4
+ const linkStyles = css({
5
+ color: `var(--ds-text, ${N800})`,
6
+ cursor: 'pointer'
7
+ });
8
+ /**
9
+ * __Progress tracker link__
10
+ */
11
+
12
+ const Link = ({
13
+ href,
14
+ onClick,
15
+ label,
16
+ testId
17
+ }) => jsx("a", {
18
+ css: linkStyles,
19
+ href: href,
20
+ onClick: onClick,
21
+ "data-testid": testId
22
+ }, label);
23
+
24
+ export default Link;
@@ -0,0 +1,42 @@
1
+ /* eslint-disable @repo/internal/styles/no-nested-styles */
2
+
3
+ /** @jsx jsx */
4
+ import { css, jsx } from '@emotion/core';
5
+ import { LABEL_TOP_SPACING, PROGRESS_BAR_HEIGHT, varBackgroundColor, varMarkerColor, varTransitionDelay, varTransitionEasing, varTransitionSpeed } from './constants';
6
+ const progressMarkerStyles = css({
7
+ width: PROGRESS_BAR_HEIGHT,
8
+ height: PROGRESS_BAR_HEIGHT,
9
+ position: 'absolute',
10
+ left: '50%',
11
+ backgroundColor: `var(${varBackgroundColor})`,
12
+ borderRadius: PROGRESS_BAR_HEIGHT,
13
+ transform: `translate(-50%, -${LABEL_TOP_SPACING}px)`,
14
+ transition: `opacity var(${varTransitionSpeed}) var(${varTransitionEasing}), background-color var(${varTransitionSpeed}) var(${varTransitionEasing})`,
15
+ transitionDelay: `var(${varTransitionDelay})`,
16
+ '&.fade-appear': {
17
+ opacity: 0.01
18
+ },
19
+ '&.fade-appear.fade-appear-active': {
20
+ opacity: 1
21
+ },
22
+ '&.fade-enter': {
23
+ backgroundColor: `var(${varMarkerColor})`
24
+ },
25
+ '&.fade-enter.fade-enter-active': {
26
+ backgroundColor: `var(${varBackgroundColor})`
27
+ }
28
+ });
29
+ /**
30
+ * __Progress marker__
31
+ *
32
+ * Similar to `@atlaskit/progress-indicator`, a small visual circle marker
33
+ */
34
+
35
+ const ProgressMarker = ({
36
+ testId
37
+ }) => jsx("div", {
38
+ "data-testid": testId,
39
+ css: progressMarkerStyles
40
+ });
41
+
42
+ export default ProgressMarker;
@@ -0,0 +1,130 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ /* eslint-disable @repo/internal/styles/no-nested-styles */
4
+
5
+ /** @jsx jsx */
6
+ import { PureComponent } from 'react';
7
+ import { css, jsx } from '@emotion/core';
8
+ import { CSSTransition } from 'react-transition-group';
9
+ import { fontSize } from '@atlaskit/theme/constants';
10
+ import ProgressBar from './bar';
11
+ import { LABEL_TOP_SPACING, varBackgroundColor, varMarkerColor, varTransitionDelay, varTransitionEasing, varTransitionSpeed } from './constants';
12
+ import ProgressMarker from './marker';
13
+ import { getFontWeight, getMarkerColor, getTextColor } from './utils';
14
+ const containerStyles = css({
15
+ width: '100%',
16
+ position: 'relative'
17
+ });
18
+ const listItemStyles = css({
19
+ margin: 0,
20
+ overflowWrap: 'break-word'
21
+ });
22
+ const titleStyles = css({
23
+ marginTop: LABEL_TOP_SPACING,
24
+ marginRight: 'auto',
25
+ marginLeft: 'auto',
26
+ fontSize: fontSize(),
27
+ lineHeight: '16px',
28
+ textAlign: 'center',
29
+ '&.fade-appear': {
30
+ opacity: 0.01
31
+ },
32
+ '&.fade-appear.fade-appear-active': {
33
+ opacity: 1,
34
+ transition: `opacity var(${varTransitionSpeed}) cubic-bezier(0.2, 0, 0, 1)`
35
+ }
36
+ });
37
+ export default class ProgressTrackerStage extends PureComponent {
38
+ constructor(props) {
39
+ super(props);
40
+
41
+ _defineProperty(this, "onEntered", () => {
42
+ this.setState({
43
+ transitioning: false,
44
+ oldMarkerColor: getMarkerColor(this.props.item.status),
45
+ oldPercentageComplete: this.props.item.percentageComplete
46
+ });
47
+ });
48
+
49
+ this.state = {
50
+ transitioning: false,
51
+ oldMarkerColor: getMarkerColor(this.props.item.status),
52
+ oldPercentageComplete: 0
53
+ };
54
+ }
55
+
56
+ UNSAFE_componentWillMount() {
57
+ this.setState({ ...this.state,
58
+ transitioning: true
59
+ });
60
+ }
61
+
62
+ UNSAFE_componentWillReceiveProps() {
63
+ this.setState({ ...this.state,
64
+ transitioning: true
65
+ });
66
+ }
67
+
68
+ shouldShowLink() {
69
+ return this.props.item.status === 'visited' && !this.props.item.noLink;
70
+ }
71
+
72
+ render() {
73
+ const {
74
+ item,
75
+ render,
76
+ transitionDelay,
77
+ transitionSpeed,
78
+ transitionEasing,
79
+ testId
80
+ } = this.props;
81
+ const ariaCurrent = item.status === 'current' ? 'step' : 'false';
82
+ return jsx("li", {
83
+ "data-testid": testId,
84
+ style: {
85
+ [varTransitionSpeed]: `${transitionSpeed}ms`,
86
+ [varTransitionDelay]: `${transitionDelay}ms`,
87
+ [varTransitionEasing]: transitionEasing,
88
+ [varMarkerColor]: this.state.oldMarkerColor,
89
+ [varBackgroundColor]: getMarkerColor(item.status)
90
+ },
91
+ css: listItemStyles,
92
+ "aria-current": ariaCurrent
93
+ }, jsx("div", {
94
+ css: containerStyles
95
+ }, jsx(CSSTransition, {
96
+ appear: true,
97
+ in: this.state.transitioning,
98
+ onEntered: this.onEntered,
99
+ timeout: transitionDelay + transitionSpeed,
100
+ classNames: "fade"
101
+ }, jsx(ProgressMarker, {
102
+ testId: testId && `${testId}-marker`
103
+ })), jsx(CSSTransition, {
104
+ appear: true,
105
+ in: this.state.transitioning,
106
+ onEntered: this.onEntered,
107
+ timeout: transitionDelay + transitionSpeed,
108
+ classNames: "fade"
109
+ }, jsx(ProgressBar, {
110
+ testId: testId && `${testId}-bar`,
111
+ percentageComplete: item.percentageComplete
112
+ })), jsx(CSSTransition, {
113
+ appear: true,
114
+ in: this.state.transitioning,
115
+ onEntered: this.onEntered,
116
+ timeout: transitionDelay + transitionSpeed,
117
+ classNames: "fade"
118
+ }, jsx("div", {
119
+ css: titleStyles,
120
+ "data-testid": testId && `${testId}-title`,
121
+ style: {
122
+ color: getTextColor(item.status),
123
+ fontWeight: getFontWeight(item.status)
124
+ }
125
+ }, this.shouldShowLink() ? render.link({
126
+ item
127
+ }) : item.label))));
128
+ }
129
+
130
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,48 @@
1
+ import { B300, N300, N70, N800 } from '@atlaskit/theme/colors';
2
+ import { REGULAR_FONT_WEIGHT, SEMI_BOLD_FONT_WEIGHT } from './constants';
3
+ export const getMarkerColor = status => {
4
+ switch (status) {
5
+ case 'unvisited':
6
+ return `var(--ds-icon-subtle, ${N70})`;
7
+
8
+ case 'current':
9
+ case 'visited':
10
+ case 'disabled':
11
+ return `var(--ds-icon-brand, ${B300})`;
12
+
13
+ default:
14
+ return;
15
+ }
16
+ };
17
+ export const getTextColor = status => {
18
+ switch (status) {
19
+ case 'unvisited':
20
+ return `var(--ds-text-subtlest, ${N300})`;
21
+
22
+ case 'current':
23
+ return `var(--ds-text-brand, ${B300})`;
24
+
25
+ case 'visited':
26
+ return `var(--ds-text, ${N800})`;
27
+
28
+ case 'disabled':
29
+ return `var(--ds-text-disabled, ${N70})`;
30
+
31
+ default:
32
+ return;
33
+ }
34
+ };
35
+ export const getFontWeight = status => {
36
+ switch (status) {
37
+ case 'unvisited':
38
+ return REGULAR_FONT_WEIGHT;
39
+
40
+ case 'current':
41
+ case 'visited':
42
+ case 'disabled':
43
+ return SEMI_BOLD_FONT_WEIGHT;
44
+
45
+ default:
46
+ return undefined;
47
+ }
48
+ };
@@ -1,25 +1,31 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import React, { PureComponent } from 'react';
3
- import { ThemeProvider } from 'styled-components';
4
- import { Grid } from '@atlaskit/page';
5
- import ProgressTrackerLink from '../ProgressTrackerLink';
6
- import ProgressTrackerStage from '../ProgressTrackerStage';
7
- import { ProgressTrackerContainer } from './styled';
8
- const TRANSITION_SPEED = 300;
9
- const LINEAR_TRANSITION_SPEED = 50;
10
- const easeOut = 'cubic-bezier(0.15,1,0.3,1)';
11
- const defaultLabel = 'Progress';
2
+
3
+ /* eslint-disable @repo/internal/styles/no-nested-styles */
4
+
5
+ /** @jsx jsx */
6
+ import { PureComponent } from 'react';
7
+ import { css, jsx } from '@emotion/core';
8
+ import { defaultGridSize, spacing } from './constants';
9
+ import { ANIMATION_EASE_OUT, LINEAR_TRANSITION_SPEED, TRANSITION_SPEED, varSpacing } from './internal/constants';
10
+ import Link from './internal/link';
11
+ import Stage from './internal/stage';
12
+ const containerStyles = css({
13
+ display: 'grid',
14
+ width: '100%',
15
+ margin: '0 auto',
16
+ padding: 0,
17
+ gap: `var(${varSpacing})`,
18
+ listStyleType: 'none',
19
+ '&&': {
20
+ marginTop: 40
21
+ }
22
+ });
12
23
  export default class ProgressTracker extends PureComponent {
13
24
  constructor(...args) {
14
25
  super(...args);
15
26
 
16
- _defineProperty(this, "createTheme", () => ({
17
- spacing: this.props.spacing,
18
- columns: this.props.items.length * 2
19
- }));
20
-
21
27
  _defineProperty(this, "state", {
22
- prevStages: this.props.items.map((stage, index) => ({ ...stage,
28
+ prevStages: this.props.items.map(stage => ({ ...stage,
23
29
  percentageComplete: 0
24
30
  }))
25
31
  });
@@ -48,38 +54,45 @@ export default class ProgressTracker extends PureComponent {
48
54
  const items = this.props.items.map((stage, index) => {
49
55
  let transitionSpeed = 0;
50
56
  let transitionDelay = 0;
51
- const transitionEasing = progressChanges > 1 ? 'linear' : easeOut;
57
+ const transitionEasing = progressChanges > 1 ? 'linear' : ANIMATION_EASE_OUT;
52
58
 
53
59
  if (this.props.animated) {
54
60
  transitionSpeed = progressChanges > 1 ? LINEAR_TRANSITION_SPEED : TRANSITION_SPEED;
55
61
 
56
62
  if (stage.percentageComplete < this.state.prevStages[index].percentageComplete) {
57
- /** load each transition sequentially in reverse */
63
+ /**
64
+ * load each transition sequentially in reverse
65
+ */
58
66
  transitionDelay = (stepsBack - 1) * transitionSpeed;
59
67
  stepsBack -= 1;
60
68
  } else if (stage.percentageComplete > this.state.prevStages[index].percentageComplete) {
61
- /** load each transition sequentially */
69
+ /**
70
+ * load each transition sequentially
71
+ */
62
72
  transitionDelay = (totalStepsForward - stepsForward) * transitionSpeed;
63
73
  stepsForward -= 1;
64
74
  }
65
75
  }
66
76
 
67
- return /*#__PURE__*/React.createElement(ProgressTrackerStage, {
68
- key: stage.id,
69
- item: stage,
70
- render: this.props.render,
77
+ return jsx(Stage, {
71
78
  transitionSpeed: transitionSpeed,
72
79
  transitionDelay: transitionDelay,
73
- transitionEasing: transitionEasing
80
+ transitionEasing: transitionEasing,
81
+ key: stage.id,
82
+ item: stage,
83
+ render: this.props.render
74
84
  });
75
85
  });
76
- return /*#__PURE__*/React.createElement(ThemeProvider, {
77
- theme: this.createTheme()
78
- }, /*#__PURE__*/React.createElement(Grid, {
79
- testId: testId
80
- }, /*#__PURE__*/React.createElement(ProgressTrackerContainer, {
86
+ return jsx("ul", {
87
+ "data-testid": testId,
88
+ style: {
89
+ gridTemplateColumns: `repeat(${items.length}, 1fr)`,
90
+ [varSpacing]: `${spacing[this.props.spacing]}px`,
91
+ maxWidth: defaultGridSize * 10 * items.length * 2
92
+ },
93
+ css: containerStyles,
81
94
  "aria-label": label
82
- }, items)));
95
+ }, items);
83
96
  }
84
97
 
85
98
  }
@@ -88,8 +101,10 @@ _defineProperty(ProgressTracker, "defaultProps", {
88
101
  items: [],
89
102
  spacing: 'cosy',
90
103
  render: {
91
- link: props => /*#__PURE__*/React.createElement(ProgressTrackerLink, props)
104
+ link: ({
105
+ item
106
+ }) => jsx(Link, item)
92
107
  },
93
108
  animated: true,
94
- label: defaultLabel
109
+ label: 'Progress'
95
110
  });
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-tracker",
3
- "version": "8.0.3",
3
+ "version": "8.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,9 +1,11 @@
1
- import { gridSize } from '@atlaskit/theme/constants';
2
- export var defaultGridSize = gridSize();
3
- /** Ideally these are exported by @atlaskit/page */
1
+ import { gridSize as getGridSize } from '@atlaskit/theme/constants';
2
+ export var defaultGridSize = getGridSize();
3
+ /**
4
+ * Ideally these are exported by @atlaskit/page
5
+ */
4
6
 
5
7
  export var spacing = {
6
8
  comfortable: defaultGridSize * 5,
7
9
  cosy: defaultGridSize * 2,
8
- compact: defaultGridSize * 0.5
10
+ compact: defaultGridSize / 2
9
11
  };
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- export { default as ProgressTracker } from './ProgressTracker';
1
+ export { default as ProgressTracker } from './progress-tracker';
@@ -0,0 +1,36 @@
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/core';
3
+ import { B300 } from '@atlaskit/theme/colors';
4
+ import { spacing } from '../constants';
5
+ import { HALF_GRID_SIZE, LABEL_TOP_SPACING, PROGRESS_BAR_HEIGHT, varSpacing, varTransitionDelay, varTransitionEasing, varTransitionSpeed } from './constants';
6
+ var progressBarStyles = css({
7
+ height: PROGRESS_BAR_HEIGHT,
8
+ position: 'absolute',
9
+ left: '50%',
10
+ backgroundColor: "var(--ds-background-brand-bold, ".concat(B300, ")"),
11
+ borderBottomRightRadius: PROGRESS_BAR_HEIGHT,
12
+ borderTopRightRadius: PROGRESS_BAR_HEIGHT,
13
+ transform: "translate(0, -".concat(LABEL_TOP_SPACING, "px)"),
14
+ transition: "width var(".concat(varTransitionSpeed, ") var(").concat(varTransitionEasing, ")"),
15
+ transitionDelay: "var(".concat(varTransitionDelay, ")")
16
+ });
17
+ /**
18
+ * __Progress bar__
19
+ *
20
+ * A progress bar describes the horizontal tracking bar that traverses each individual step.
21
+ *
22
+ */
23
+
24
+ var ProgressBar = function ProgressBar(_ref) {
25
+ var percentageComplete = _ref.percentageComplete,
26
+ testId = _ref.testId;
27
+ return jsx("div", {
28
+ "data-testid": testId,
29
+ style: {
30
+ width: "calc(".concat(percentageComplete, "% + ").concat(percentageComplete / 100, " * calc(var(").concat(varSpacing, ", ").concat(spacing.cosy, "px) + ").concat(HALF_GRID_SIZE, "px))")
31
+ },
32
+ css: progressBarStyles
33
+ });
34
+ };
35
+
36
+ export default ProgressBar;
@@ -0,0 +1,16 @@
1
+ import { defaultGridSize } from '../constants';
2
+ export var TRANSITION_SPEED = 300;
3
+ export var LINEAR_TRANSITION_SPEED = 50;
4
+ export var ANIMATION_EASE_OUT = 'cubic-bezier(0.15,1,0.3,1)';
5
+ export var varSpacing = '--ds--pt--sp';
6
+ export var varTransitionSpeed = '--ds--pt--ts';
7
+ export var varTransitionDelay = '--ds--pt--td';
8
+ export var varTransitionEasing = '--ds--pt--te';
9
+ export var varMarkerColor = '--ds--pt--mc';
10
+ export var varBackgroundColor = '--ds--pt--bg';
11
+ export var SEMI_BOLD_FONT_WEIGHT = '600';
12
+ export var REGULAR_FONT_WEIGHT = '400';
13
+ export var HALF_GRID_SIZE = defaultGridSize / 2;
14
+ export var PROGRESS_BAR_HEIGHT = defaultGridSize; // Labels sit 20px from bottom of progress bar.
15
+
16
+ export var LABEL_TOP_SPACING = defaultGridSize + 20;
@@ -0,0 +1,25 @@
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/core';
3
+ import { N800 } from '@atlaskit/theme/colors';
4
+ var linkStyles = css({
5
+ color: "var(--ds-text, ".concat(N800, ")"),
6
+ cursor: 'pointer'
7
+ });
8
+ /**
9
+ * __Progress tracker link__
10
+ */
11
+
12
+ var Link = function Link(_ref) {
13
+ var href = _ref.href,
14
+ onClick = _ref.onClick,
15
+ label = _ref.label,
16
+ testId = _ref.testId;
17
+ return jsx("a", {
18
+ css: linkStyles,
19
+ href: href,
20
+ onClick: onClick,
21
+ "data-testid": testId
22
+ }, label);
23
+ };
24
+
25
+ export default Link;
@@ -0,0 +1,43 @@
1
+ /* eslint-disable @repo/internal/styles/no-nested-styles */
2
+
3
+ /** @jsx jsx */
4
+ import { css, jsx } from '@emotion/core';
5
+ import { LABEL_TOP_SPACING, PROGRESS_BAR_HEIGHT, varBackgroundColor, varMarkerColor, varTransitionDelay, varTransitionEasing, varTransitionSpeed } from './constants';
6
+ var progressMarkerStyles = css({
7
+ width: PROGRESS_BAR_HEIGHT,
8
+ height: PROGRESS_BAR_HEIGHT,
9
+ position: 'absolute',
10
+ left: '50%',
11
+ backgroundColor: "var(".concat(varBackgroundColor, ")"),
12
+ borderRadius: PROGRESS_BAR_HEIGHT,
13
+ transform: "translate(-50%, -".concat(LABEL_TOP_SPACING, "px)"),
14
+ transition: "opacity var(".concat(varTransitionSpeed, ") var(").concat(varTransitionEasing, "), background-color var(").concat(varTransitionSpeed, ") var(").concat(varTransitionEasing, ")"),
15
+ transitionDelay: "var(".concat(varTransitionDelay, ")"),
16
+ '&.fade-appear': {
17
+ opacity: 0.01
18
+ },
19
+ '&.fade-appear.fade-appear-active': {
20
+ opacity: 1
21
+ },
22
+ '&.fade-enter': {
23
+ backgroundColor: "var(".concat(varMarkerColor, ")")
24
+ },
25
+ '&.fade-enter.fade-enter-active': {
26
+ backgroundColor: "var(".concat(varBackgroundColor, ")")
27
+ }
28
+ });
29
+ /**
30
+ * __Progress marker__
31
+ *
32
+ * Similar to `@atlaskit/progress-indicator`, a small visual circle marker
33
+ */
34
+
35
+ var ProgressMarker = function ProgressMarker(_ref) {
36
+ var testId = _ref.testId;
37
+ return jsx("div", {
38
+ "data-testid": testId,
39
+ css: progressMarkerStyles
40
+ });
41
+ };
42
+
43
+ export default ProgressMarker;