@atlaskit/progress-tracker 8.3.0 → 8.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/progress-tracker
2
2
 
3
+ ## 8.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9827dcb82b8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9827dcb82b8) - No-op change to introduce spacing tokens to design system components.
8
+
9
+ ## 8.3.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
14
+
3
15
  ## 8.3.0
4
16
 
5
17
  ### Minor Changes
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/constants.js",
5
5
  "module:es2019": "../dist/es2019/constants.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/constants.d.ts"
7
+ "types": "../dist/types/constants.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/constants.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -50,12 +50,15 @@ var containerStyles = (0, _react2.css)({
50
50
  position: 'relative'
51
51
  });
52
52
  var listItemStyles = (0, _react2.css)({
53
- margin: 0,
53
+ // TODO Delete this comment after verifying spacing token -> previous value `0`
54
+ margin: "var(--ds-scale-0, 0px)",
54
55
  overflowWrap: 'break-word'
55
56
  });
56
57
  var titleStyles = (0, _react2.css)({
57
58
  marginTop: _constants2.LABEL_TOP_SPACING,
59
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
58
60
  marginRight: 'auto',
61
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
59
62
  marginLeft: 'auto',
60
63
  fontSize: (0, _constants.fontSize)(),
61
64
  lineHeight: '16px',
@@ -44,8 +44,11 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
44
44
  var containerStyles = (0, _react2.css)({
45
45
  display: 'grid',
46
46
  width: '100%',
47
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
47
48
  margin: '0 auto',
48
- padding: 0,
49
+ // TODO Delete this comment after verifying spacing token -> previous value `0`
50
+ padding: "var(--ds-scale-0, 0px)",
51
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
49
52
  gap: "var(".concat(_constants2.varSpacing, ")"),
50
53
  listStyleType: 'none',
51
54
  '&&': {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-tracker",
3
- "version": "8.3.0",
3
+ "version": "8.3.2",
4
4
  "sideEffects": false
5
5
  }
@@ -16,12 +16,15 @@ const containerStyles = css({
16
16
  position: 'relative'
17
17
  });
18
18
  const listItemStyles = css({
19
- margin: 0,
19
+ // TODO Delete this comment after verifying spacing token -> previous value `0`
20
+ margin: "var(--ds-scale-0, 0px)",
20
21
  overflowWrap: 'break-word'
21
22
  });
22
23
  const titleStyles = css({
23
24
  marginTop: LABEL_TOP_SPACING,
25
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
24
26
  marginRight: 'auto',
27
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
25
28
  marginLeft: 'auto',
26
29
  fontSize: fontSize(),
27
30
  lineHeight: '16px',
@@ -12,8 +12,11 @@ import Stage from './internal/stage';
12
12
  const containerStyles = css({
13
13
  display: 'grid',
14
14
  width: '100%',
15
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
15
16
  margin: '0 auto',
16
- padding: 0,
17
+ // TODO Delete this comment after verifying spacing token -> previous value `0`
18
+ padding: "var(--ds-scale-0, 0px)",
19
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
17
20
  gap: `var(${varSpacing})`,
18
21
  listStyleType: 'none',
19
22
  '&&': {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-tracker",
3
- "version": "8.3.0",
3
+ "version": "8.3.2",
4
4
  "sideEffects": false
5
5
  }
@@ -30,12 +30,15 @@ var containerStyles = css({
30
30
  position: 'relative'
31
31
  });
32
32
  var listItemStyles = css({
33
- margin: 0,
33
+ // TODO Delete this comment after verifying spacing token -> previous value `0`
34
+ margin: "var(--ds-scale-0, 0px)",
34
35
  overflowWrap: 'break-word'
35
36
  });
36
37
  var titleStyles = css({
37
38
  marginTop: LABEL_TOP_SPACING,
39
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
38
40
  marginRight: 'auto',
41
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
39
42
  marginLeft: 'auto',
40
43
  fontSize: fontSize(),
41
44
  lineHeight: '16px',
@@ -26,8 +26,11 @@ import Stage from './internal/stage';
26
26
  var containerStyles = css({
27
27
  display: 'grid',
28
28
  width: '100%',
29
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
29
30
  margin: '0 auto',
30
- padding: 0,
31
+ // TODO Delete this comment after verifying spacing token -> previous value `0`
32
+ padding: "var(--ds-scale-0, 0px)",
33
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
31
34
  gap: "var(".concat(varSpacing, ")"),
32
35
  listStyleType: 'none',
33
36
  '&&': {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-tracker",
3
- "version": "8.3.0",
3
+ "version": "8.3.2",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,10 @@
1
+ export declare const defaultGridSize: number;
2
+ /**
3
+ * Ideally these are exported by @atlaskit/page
4
+ */
5
+ export declare const spacing: {
6
+ readonly comfortable: number;
7
+ readonly cosy: number;
8
+ readonly compact: number;
9
+ };
10
+ export declare type Spacing = keyof typeof spacing;
@@ -0,0 +1,3 @@
1
+ export { default as ProgressTracker } from './progress-tracker';
2
+ export type { ProgressTrackerProps } from './progress-tracker';
3
+ export type { Stages, Stage } from './types';
@@ -0,0 +1,13 @@
1
+ import { jsx } from '@emotion/react';
2
+ interface StageBarProps {
3
+ testId?: string;
4
+ percentageComplete: number;
5
+ }
6
+ /**
7
+ * __Progress bar__
8
+ *
9
+ * A progress bar describes the horizontal tracking bar that traverses each individual step.
10
+ *
11
+ */
12
+ declare const ProgressBar: ({ percentageComplete, testId }: StageBarProps) => jsx.JSX.Element;
13
+ export default ProgressBar;
@@ -0,0 +1,14 @@
1
+ export declare const TRANSITION_SPEED = 300;
2
+ export declare const LINEAR_TRANSITION_SPEED = 50;
3
+ export declare const ANIMATION_EASE_OUT = "cubic-bezier(0.15,1,0.3,1)";
4
+ export declare const varSpacing = "--ds--pt--sp";
5
+ export declare const varTransitionSpeed = "--ds--pt--ts";
6
+ export declare const varTransitionDelay = "--ds--pt--td";
7
+ export declare const varTransitionEasing = "--ds--pt--te";
8
+ export declare const varMarkerColor = "--ds--pt--mc";
9
+ export declare const varBackgroundColor = "--ds--pt--bg";
10
+ export declare const SEMI_BOLD_FONT_WEIGHT = "600";
11
+ export declare const REGULAR_FONT_WEIGHT = "400";
12
+ export declare const HALF_GRID_SIZE: number;
13
+ export declare const PROGRESS_BAR_HEIGHT: number;
14
+ export declare const LABEL_TOP_SPACING: number;
@@ -0,0 +1,10 @@
1
+ /** @jsx jsx */
2
+ import { FC } from 'react';
3
+ import { Stage } from '../types';
4
+ /**
5
+ * __Progress tracker link__
6
+ */
7
+ declare const Link: FC<Stage & {
8
+ testId?: string;
9
+ }>;
10
+ export default Link;
@@ -0,0 +1,11 @@
1
+ /** @jsx jsx */
2
+ import { FC } from 'react';
3
+ /**
4
+ * __Progress marker__
5
+ *
6
+ * Similar to `@atlaskit/progress-indicator`, a small visual circle marker
7
+ */
8
+ declare const ProgressMarker: FC<{
9
+ testId?: string;
10
+ }>;
11
+ export default ProgressMarker;
@@ -0,0 +1,18 @@
1
+ /** @jsx jsx */
2
+ import { PureComponent } from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import type { ProgressTrackerStageProps } from './types';
5
+ interface State {
6
+ transitioning: boolean;
7
+ oldMarkerColor?: string;
8
+ oldPercentageComplete: number;
9
+ }
10
+ export type { ProgressTrackerStageProps };
11
+ export default class ProgressTrackerStage extends PureComponent<ProgressTrackerStageProps, State> {
12
+ constructor(props: ProgressTrackerStageProps);
13
+ UNSAFE_componentWillMount(): void;
14
+ UNSAFE_componentWillReceiveProps(): void;
15
+ shouldShowLink(): boolean;
16
+ onEntered: () => void;
17
+ render(): jsx.JSX.Element;
18
+ }
@@ -0,0 +1,27 @@
1
+ import type { ProgressTrackerStageRenderProp, Stage } from '../types';
2
+ export interface ProgressTrackerStageProps {
3
+ /**
4
+ * stage data passed to each `ProgressTrackerStage` component
5
+ */
6
+ item: Stage;
7
+ /**
8
+ * render prop to specify how to render components
9
+ */
10
+ render: ProgressTrackerStageRenderProp;
11
+ /**
12
+ * An internal hook applied to key elements for automated testing
13
+ */
14
+ testId?: string;
15
+ /**
16
+ * delay before transitioning in ms
17
+ */
18
+ transitionDelay: number;
19
+ /**
20
+ * speed at which to transition in ms
21
+ */
22
+ transitionSpeed: number;
23
+ /**
24
+ * interface of easing for transition
25
+ */
26
+ transitionEasing: string;
27
+ }
@@ -0,0 +1,4 @@
1
+ import type { Status } from '../types';
2
+ export declare const getMarkerColor: (status: Status) => "var(--ds-icon-subtle)" | "var(--ds-icon-brand)" | undefined;
3
+ export declare const getTextColor: (status: Status) => "var(--ds-text)" | "var(--ds-text-subtlest)" | "var(--ds-text-brand)" | "var(--ds-text-disabled)" | undefined;
4
+ export declare const getFontWeight: (status: Status) => "600" | "400" | undefined;
@@ -0,0 +1,58 @@
1
+ /** @jsx jsx */
2
+ import { PureComponent } from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import type { LinkComponentProps, ProgressTrackerStageRenderProp, Spacing, Stages } from './types';
5
+ export interface ProgressTrackerProps {
6
+ /**
7
+ * Ordered list of stage data
8
+ */
9
+ items: Stages;
10
+ /**
11
+ * Margin spacing type between steps
12
+ */
13
+ spacing: Spacing;
14
+ /**
15
+ * Render prop to specify custom implementations of components
16
+ */
17
+ render: ProgressTrackerStageRenderProp;
18
+ /**
19
+ * Turns off transition animations if set to false
20
+ */
21
+ animated: boolean;
22
+ /**
23
+ * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
24
+ */
25
+ testId?: string;
26
+ /**
27
+ * Text to be used as an aria-label of progress tracker
28
+ */
29
+ label?: string;
30
+ }
31
+ interface State {
32
+ prevStages: Stages;
33
+ }
34
+ export default class ProgressTracker extends PureComponent<ProgressTrackerProps, State> {
35
+ static defaultProps: {
36
+ items: never[];
37
+ spacing: string;
38
+ render: {
39
+ link: ({ item }: LinkComponentProps) => jsx.JSX.Element;
40
+ };
41
+ animated: boolean;
42
+ label: string;
43
+ };
44
+ state: {
45
+ prevStages: {
46
+ percentageComplete: number;
47
+ id: string;
48
+ label: string;
49
+ status: import("./types").Status;
50
+ noLink?: boolean | undefined;
51
+ href?: string | undefined;
52
+ onClick?: (() => void) | undefined;
53
+ }[];
54
+ };
55
+ UNSAFE_componentWillReceiveProps(nextProps: ProgressTrackerProps): void;
56
+ render(): jsx.JSX.Element;
57
+ }
58
+ export {};
@@ -0,0 +1,26 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * Ideally these are exported by @atlaskit/page
4
+ */
5
+ export type { Spacing } from './constants';
6
+ export declare type Status = 'unvisited' | 'visited' | 'current' | 'disabled';
7
+ /**
8
+ * @deprecated
9
+ */
10
+ export declare type StatusType = Status;
11
+ export interface Stage {
12
+ id: string;
13
+ label: string;
14
+ percentageComplete: number;
15
+ status: Status;
16
+ noLink?: boolean;
17
+ href?: string;
18
+ onClick?: () => void;
19
+ }
20
+ export declare type Stages = Stage[];
21
+ export interface LinkComponentProps {
22
+ item: Stage;
23
+ }
24
+ export interface ProgressTrackerStageRenderProp {
25
+ link: (props: LinkComponentProps) => JSX.Element;
26
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-tracker",
3
- "version": "8.3.0",
3
+ "version": "8.3.2",
4
4
  "description": "A progress tracker displays the steps and progress through a journey.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,9 +12,18 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
+ "typesVersions": {
16
+ ">=4.0 <4.5": {
17
+ "*": [
18
+ "dist/types-ts4.0/*",
19
+ "dist/types-ts4.0/index.d.ts"
20
+ ]
21
+ }
22
+ },
15
23
  "sideEffects": false,
16
24
  "atlaskit:src": "src/index.tsx",
17
25
  "atlassian": {
26
+ "disableProductCI": true,
18
27
  "team": "Design System Team",
19
28
  "releaseModel": "scheduled",
20
29
  "website": {
@@ -36,17 +45,17 @@
36
45
  "@atlaskit/button": "^16.3.0",
37
46
  "@atlaskit/docs": "*",
38
47
  "@atlaskit/ds-lib": "^2.0.1",
39
- "@atlaskit/icon": "^21.10.0",
40
- "@atlaskit/section-message": "^6.2.0",
48
+ "@atlaskit/icon": "^21.11.0",
49
+ "@atlaskit/section-message": "^6.3.0",
41
50
  "@atlaskit/ssr": "*",
42
51
  "@atlaskit/visual-regression": "*",
43
52
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
44
- "@testing-library/react": "^8.0.1",
53
+ "@testing-library/react": "^12.1.5",
45
54
  "enzyme": "^3.10.0",
46
55
  "react-dom": "^16.8.0",
47
56
  "react-router-dom": "^4.2.2",
48
57
  "react-test-renderer": "^16.8.0",
49
- "typescript": "4.3.5"
58
+ "typescript": "4.5.5"
50
59
  },
51
60
  "techstack": {
52
61
  "@atlassian/frontend": {
@@ -55,6 +64,7 @@
55
64
  "@repo/internal": {
56
65
  "dom-events": "use-bind-event-listener",
57
66
  "design-system": "v1",
67
+ "design-tokens": "spacing",
58
68
  "theming": "tokens",
59
69
  "styling": [
60
70
  "static",
package/report.api.md CHANGED
@@ -1,10 +1,13 @@
1
- ## API Report File for "@atlaskit/progress-tracker"
1
+ ## API Report File for "@atlaskit/progress-tracker".
2
2
 
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
4
6
 
5
7
  ```ts
6
8
  /// <reference types="react" />
7
9
 
10
+ import { jsx } from '@emotion/react';
8
11
  import { PureComponent } from 'react';
9
12
 
10
13
  declare interface LinkComponentProps {
@@ -19,7 +22,7 @@ export declare class ProgressTracker extends PureComponent<
19
22
  items: never[];
20
23
  spacing: string;
21
24
  render: {
22
- link: ({ item }: LinkComponentProps) => JSX.Element;
25
+ link: ({ item }: LinkComponentProps) => jsx.JSX.Element;
23
26
  };
24
27
  animated: boolean;
25
28
  label: string;
@@ -36,7 +39,7 @@ export declare class ProgressTracker extends PureComponent<
36
39
  }[];
37
40
  };
38
41
  UNSAFE_componentWillReceiveProps(nextProps: ProgressTrackerProps): void;
39
- render(): JSX.Element;
42
+ render(): jsx.JSX.Element;
40
43
  }
41
44
 
42
45
  export declare interface ProgressTrackerProps {
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/types.js",
5
5
  "module:es2019": "../dist/es2019/types.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/types.d.ts"
7
+ "types": "../dist/types/types.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/types.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }