@atlaskit/progress-indicator 9.3.3 → 9.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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/progress-indicator
2
2
 
3
+ ## 9.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c146611a18c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c146611a18c) - [ux] Migrate progress-indicator package to use spacing primitives to control spacing in both component and examples. Spacing values have been slightly updated depending on indicator size and spacing properties
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
3
13
  ## 9.3.3
4
14
 
5
15
  ### Patch Changes
@@ -3,19 +3,31 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.varDotsSize = exports.varDotsMargin = exports.spacingDivision = exports.sizes = void 0;
6
+ exports.varDotsSize = exports.varDotsMargin = exports.sizes = exports.progressIndicatorGapMap = void 0;
7
+ var progressIndicatorGapMap = {
8
+ comfortable: {
9
+ small: ['scale.075', "var(--ds-space-075, 6px)"],
10
+ default: ['scale.100', "var(--ds-space-100, 8px)"],
11
+ large: ['scale.150', "var(--ds-space-150, 12px)"]
12
+ },
13
+ cozy: {
14
+ small: ['scale.050', "var(--ds-space-050, 4px)"],
15
+ default: ['scale.075', "var(--ds-space-075, 6px)"],
16
+ large: ['scale.100', "var(--ds-space-100, 8px)"]
17
+ },
18
+ compact: {
19
+ small: ['scale.025', "var(--ds-space-025, 2px)"],
20
+ default: ['scale.050', "var(--ds-space-050, 4px)"],
21
+ large: ['scale.075', "var(--ds-space-075, 6px)"]
22
+ }
23
+ };
24
+ exports.progressIndicatorGapMap = progressIndicatorGapMap;
7
25
  var sizes = {
8
26
  small: 4,
9
27
  default: 8,
10
28
  large: 12
11
29
  };
12
30
  exports.sizes = sizes;
13
- var spacingDivision = {
14
- comfortable: 1,
15
- cozy: 2,
16
- compact: 4
17
- };
18
- exports.spacingDivision = spacingDivision;
19
31
  var varDotsSize = '--ds-dots-size';
20
32
  exports.varDotsSize = varDotsSize;
21
33
  var varDotsMargin = '--ds-dots-margin';
@@ -15,6 +15,8 @@ var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
15
15
 
16
16
  var _constants = require("./constants");
17
17
 
18
+ /* eslint-disable @repo/internal/react/use-primitives */
19
+
18
20
  /** @jsx jsx */
19
21
  var commonStyles = (0, _react.css)({
20
22
  width: "var(".concat(_constants.varDotsSize, ")"),
@@ -32,7 +34,6 @@ var commonStyles = (0, _react.css)({
32
34
  }
33
35
  });
34
36
  var buttonStyles = (0, _react.css)({
35
- // TODO Delete this comment after verifying spacing token -> previous value `0`
36
37
  padding: "var(--ds-scale-0, 0px)",
37
38
  border: 0,
38
39
  cursor: 'pointer',
@@ -11,6 +11,8 @@ exports.default = void 0;
11
11
 
12
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
13
 
14
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
+
14
16
  var _react = _interopRequireWildcard(require("react"));
15
17
 
16
18
  var _react2 = require("@emotion/react");
@@ -19,6 +21,10 @@ var _bindEventListener = require("bind-event-listener");
19
21
 
20
22
  var _analyticsNext = require("@atlaskit/analytics-next");
21
23
 
24
+ var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
25
+
26
+ var _inline = _interopRequireDefault(require("@atlaskit/ds-explorations/inline"));
27
+
22
28
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
23
29
 
24
30
  var _components = require("@atlaskit/theme/components");
@@ -35,12 +41,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
35
41
 
36
42
  /** @jsx jsx */
37
43
  var packageName = "@atlaskit/progress-indicator";
38
- var packageVersion = "9.3.3";
39
- var containerStyles = (0, _react2.css)({
40
- display: 'flex',
41
- justifyContent: 'center',
42
- gap: "var(".concat(_constants.varDotsMargin, ")")
43
- });
44
+ var packageVersion = "9.4.0";
44
45
  /**
45
46
  * __ProgressDots__
46
47
  *
@@ -72,6 +73,11 @@ var ProgressDots = function ProgressDots(_ref) {
72
73
  packageName: packageName,
73
74
  packageVersion: packageVersion
74
75
  });
76
+
77
+ var _progressIndicatorGap = (0, _slicedToArray2.default)(_constants.progressIndicatorGapMap[gutter][size], 2),
78
+ inlineGapValue = _progressIndicatorGap[0],
79
+ rawGapValue = _progressIndicatorGap[1];
80
+
75
81
  var handleKeyDown = (0, _react.useCallback)(function (event) {
76
82
  var indicators = Array.from(tablistRef.current.children); // bail if the target isn't an indicator
77
83
 
@@ -122,14 +128,16 @@ var ProgressDots = function ProgressDots(_ref) {
122
128
  });
123
129
  }, [onSelect, handleKeyDown]);
124
130
  var theme = (0, _components.useGlobalTheme)();
125
- return (0, _react2.jsx)("div", {
126
- "data-testid": testId,
127
- css: containerStyles,
128
- style: (_ref2 = {}, (0, _defineProperty2.default)(_ref2, _constants.varDotsSize, "".concat(_constants.sizes[size], "px")), (0, _defineProperty2.default)(_ref2, _constants.varDotsMargin, "".concat(_constants.sizes[size] / _constants.spacingDivision[gutter], "px")), _ref2),
131
+ return (0, _react2.jsx)(_box.default, {
132
+ UNSAFE_style: (_ref2 = {}, (0, _defineProperty2.default)(_ref2, _constants.varDotsSize, "".concat(_constants.sizes[size], "px")), (0, _defineProperty2.default)(_ref2, _constants.varDotsMargin, rawGapValue), _ref2),
133
+ role: "tablist"
134
+ }, (0, _react2.jsx)(_inline.default, {
135
+ testId: testId,
129
136
  ref: function ref(r) {
130
137
  tablistRef.current = r;
131
138
  },
132
- role: "tablist"
139
+ justifyContent: "center",
140
+ gap: inlineGapValue
133
141
  }, values.map(function (_, index) {
134
142
  var isSelected = selectedIndex === index;
135
143
  var tabId = "".concat(ariaLabel).concat(index);
@@ -161,7 +169,7 @@ var ProgressDots = function ProgressDots(_ref) {
161
169
  backgroundColor: backgroundColor
162
170
  }
163
171
  });
164
- }));
172
+ })));
165
173
  };
166
174
 
167
175
  var _default = ProgressDots;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-indicator",
3
- "version": "9.3.3",
3
+ "version": "9.4.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,12 +1,24 @@
1
+ export const progressIndicatorGapMap = {
2
+ comfortable: {
3
+ small: ['scale.075', "var(--ds-space-075, 6px)"],
4
+ default: ['scale.100', "var(--ds-space-100, 8px)"],
5
+ large: ['scale.150', "var(--ds-space-150, 12px)"]
6
+ },
7
+ cozy: {
8
+ small: ['scale.050', "var(--ds-space-050, 4px)"],
9
+ default: ['scale.075', "var(--ds-space-075, 6px)"],
10
+ large: ['scale.100', "var(--ds-space-100, 8px)"]
11
+ },
12
+ compact: {
13
+ small: ['scale.025', "var(--ds-space-025, 2px)"],
14
+ default: ['scale.050', "var(--ds-space-050, 4px)"],
15
+ large: ['scale.075', "var(--ds-space-075, 6px)"]
16
+ }
17
+ };
1
18
  export const sizes = {
2
19
  small: 4,
3
20
  default: 8,
4
21
  large: 12
5
22
  };
6
- export const spacingDivision = {
7
- comfortable: 1,
8
- cozy: 2,
9
- compact: 4
10
- };
11
23
  export const varDotsSize = '--ds-dots-size';
12
24
  export const varDotsMargin = '--ds-dots-margin';
@@ -1,5 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
+ /* eslint-disable @repo/internal/react/use-primitives */
4
+
3
5
  /** @jsx jsx */
4
6
  import { css, jsx } from '@emotion/react';
5
7
  import FocusRing from '@atlaskit/focus-ring';
@@ -20,7 +22,6 @@ const commonStyles = css({
20
22
  }
21
23
  });
22
24
  const buttonStyles = css({
23
- // TODO Delete this comment after verifying spacing token -> previous value `0`
24
25
  padding: "var(--ds-scale-0, 0px)",
25
26
  border: 0,
26
27
  cursor: 'pointer',
@@ -1,20 +1,17 @@
1
1
  /** @jsx jsx */
2
2
  import React, { useCallback, useEffect, useRef } from 'react';
3
- import { css, jsx } from '@emotion/react';
3
+ import { jsx } from '@emotion/react';
4
4
  import { bind } from 'bind-event-listener';
5
5
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
6
+ import Box from '@atlaskit/ds-explorations/box';
7
+ import Inline from '@atlaskit/ds-explorations/inline';
6
8
  import noop from '@atlaskit/ds-lib/noop';
7
9
  import { useGlobalTheme } from '@atlaskit/theme/components';
8
10
  import { getBgColor } from './appearances';
9
- import { sizes, spacingDivision, varDotsMargin, varDotsSize } from './constants';
11
+ import { progressIndicatorGapMap, sizes, varDotsMargin, varDotsSize } from './constants';
10
12
  import { ButtonIndicator, PresentationalIndicator } from './indicator';
11
13
  const packageName = "@atlaskit/progress-indicator";
12
- const packageVersion = "9.3.3";
13
- const containerStyles = css({
14
- display: 'flex',
15
- justifyContent: 'center',
16
- gap: `var(${varDotsMargin})`
17
- });
14
+ const packageVersion = "9.4.0";
18
15
  /**
19
16
  * __ProgressDots__
20
17
  *
@@ -42,6 +39,7 @@ const ProgressDots = ({
42
39
  packageName,
43
40
  packageVersion
44
41
  });
42
+ const [inlineGapValue, rawGapValue] = progressIndicatorGapMap[gutter][size];
45
43
  const handleKeyDown = useCallback(event => {
46
44
  const indicators = Array.from(tablistRef.current.children); // bail if the target isn't an indicator
47
45
 
@@ -92,17 +90,19 @@ const ProgressDots = ({
92
90
  });
93
91
  }, [onSelect, handleKeyDown]);
94
92
  const theme = useGlobalTheme();
95
- return jsx("div", {
96
- "data-testid": testId,
97
- css: containerStyles,
98
- style: {
93
+ return jsx(Box, {
94
+ UNSAFE_style: {
99
95
  [varDotsSize]: `${sizes[size]}px`,
100
- [varDotsMargin]: `${sizes[size] / spacingDivision[gutter]}px`
96
+ [varDotsMargin]: rawGapValue
101
97
  },
98
+ role: "tablist"
99
+ }, jsx(Inline, {
100
+ testId: testId,
102
101
  ref: r => {
103
102
  tablistRef.current = r;
104
103
  },
105
- role: "tablist"
104
+ justifyContent: "center",
105
+ gap: inlineGapValue
106
106
  }, values.map((_, index) => {
107
107
  const isSelected = selectedIndex === index;
108
108
  const tabId = `${ariaLabel}${index}`;
@@ -132,7 +132,7 @@ const ProgressDots = ({
132
132
  backgroundColor
133
133
  }
134
134
  });
135
- }));
135
+ })));
136
136
  };
137
137
 
138
138
  export default ProgressDots;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-indicator",
3
- "version": "9.3.3",
3
+ "version": "9.4.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,12 +1,24 @@
1
+ export var progressIndicatorGapMap = {
2
+ comfortable: {
3
+ small: ['scale.075', "var(--ds-space-075, 6px)"],
4
+ default: ['scale.100', "var(--ds-space-100, 8px)"],
5
+ large: ['scale.150', "var(--ds-space-150, 12px)"]
6
+ },
7
+ cozy: {
8
+ small: ['scale.050', "var(--ds-space-050, 4px)"],
9
+ default: ['scale.075', "var(--ds-space-075, 6px)"],
10
+ large: ['scale.100', "var(--ds-space-100, 8px)"]
11
+ },
12
+ compact: {
13
+ small: ['scale.025', "var(--ds-space-025, 2px)"],
14
+ default: ['scale.050', "var(--ds-space-050, 4px)"],
15
+ large: ['scale.075', "var(--ds-space-075, 6px)"]
16
+ }
17
+ };
1
18
  export var sizes = {
2
19
  small: 4,
3
20
  default: 8,
4
21
  large: 12
5
22
  };
6
- export var spacingDivision = {
7
- comfortable: 1,
8
- cozy: 2,
9
- compact: 4
10
- };
11
23
  export var varDotsSize = '--ds-dots-size';
12
24
  export var varDotsMargin = '--ds-dots-margin';
@@ -1,5 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
+ /* eslint-disable @repo/internal/react/use-primitives */
4
+
3
5
  /** @jsx jsx */
4
6
  import { css, jsx } from '@emotion/react';
5
7
  import FocusRing from '@atlaskit/focus-ring';
@@ -20,7 +22,6 @@ var commonStyles = css({
20
22
  }
21
23
  });
22
24
  var buttonStyles = css({
23
- // TODO Delete this comment after verifying spacing token -> previous value `0`
24
25
  padding: "var(--ds-scale-0, 0px)",
25
26
  border: 0,
26
27
  cursor: 'pointer',
@@ -1,22 +1,20 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
3
 
3
4
  /** @jsx jsx */
4
5
  import React, { useCallback, useEffect, useRef } from 'react';
5
- import { css, jsx } from '@emotion/react';
6
+ import { jsx } from '@emotion/react';
6
7
  import { bind } from 'bind-event-listener';
7
8
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
9
+ import Box from '@atlaskit/ds-explorations/box';
10
+ import Inline from '@atlaskit/ds-explorations/inline';
8
11
  import noop from '@atlaskit/ds-lib/noop';
9
12
  import { useGlobalTheme } from '@atlaskit/theme/components';
10
13
  import { getBgColor } from './appearances';
11
- import { sizes, spacingDivision, varDotsMargin, varDotsSize } from './constants';
14
+ import { progressIndicatorGapMap, sizes, varDotsMargin, varDotsSize } from './constants';
12
15
  import { ButtonIndicator, PresentationalIndicator } from './indicator';
13
16
  var packageName = "@atlaskit/progress-indicator";
14
- var packageVersion = "9.3.3";
15
- var containerStyles = css({
16
- display: 'flex',
17
- justifyContent: 'center',
18
- gap: "var(".concat(varDotsMargin, ")")
19
- });
17
+ var packageVersion = "9.4.0";
20
18
  /**
21
19
  * __ProgressDots__
22
20
  *
@@ -48,6 +46,11 @@ var ProgressDots = function ProgressDots(_ref) {
48
46
  packageName: packageName,
49
47
  packageVersion: packageVersion
50
48
  });
49
+
50
+ var _progressIndicatorGap = _slicedToArray(progressIndicatorGapMap[gutter][size], 2),
51
+ inlineGapValue = _progressIndicatorGap[0],
52
+ rawGapValue = _progressIndicatorGap[1];
53
+
51
54
  var handleKeyDown = useCallback(function (event) {
52
55
  var indicators = Array.from(tablistRef.current.children); // bail if the target isn't an indicator
53
56
 
@@ -98,14 +101,16 @@ var ProgressDots = function ProgressDots(_ref) {
98
101
  });
99
102
  }, [onSelect, handleKeyDown]);
100
103
  var theme = useGlobalTheme();
101
- return jsx("div", {
102
- "data-testid": testId,
103
- css: containerStyles,
104
- style: (_ref2 = {}, _defineProperty(_ref2, varDotsSize, "".concat(sizes[size], "px")), _defineProperty(_ref2, varDotsMargin, "".concat(sizes[size] / spacingDivision[gutter], "px")), _ref2),
104
+ return jsx(Box, {
105
+ UNSAFE_style: (_ref2 = {}, _defineProperty(_ref2, varDotsSize, "".concat(sizes[size], "px")), _defineProperty(_ref2, varDotsMargin, rawGapValue), _ref2),
106
+ role: "tablist"
107
+ }, jsx(Inline, {
108
+ testId: testId,
105
109
  ref: function ref(r) {
106
110
  tablistRef.current = r;
107
111
  },
108
- role: "tablist"
112
+ justifyContent: "center",
113
+ gap: inlineGapValue
109
114
  }, values.map(function (_, index) {
110
115
  var isSelected = selectedIndex === index;
111
116
  var tabId = "".concat(ariaLabel).concat(index);
@@ -137,7 +142,7 @@ var ProgressDots = function ProgressDots(_ref) {
137
142
  backgroundColor: backgroundColor
138
143
  }
139
144
  });
140
- }));
145
+ })));
141
146
  };
142
147
 
143
148
  export default ProgressDots;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-indicator",
3
- "version": "9.3.3",
3
+ "version": "9.4.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,12 +1,31 @@
1
+ import type { UNSAFE_InlineProps } from '@atlaskit/ds-explorations';
2
+ import { token } from '@atlaskit/tokens';
3
+ declare type TokenValue = ReturnType<typeof token>;
4
+ declare type ScaleValue = UNSAFE_InlineProps['gap'];
5
+ declare type SpacingTuple = [ScaleValue, TokenValue];
6
+ declare type SpacingPropsToTokensMap = {
7
+ comfortable: {
8
+ small: SpacingTuple;
9
+ default: SpacingTuple;
10
+ large: SpacingTuple;
11
+ };
12
+ cozy: {
13
+ small: SpacingTuple;
14
+ default: SpacingTuple;
15
+ large: SpacingTuple;
16
+ };
17
+ compact: {
18
+ small: SpacingTuple;
19
+ default: SpacingTuple;
20
+ large: SpacingTuple;
21
+ };
22
+ };
23
+ export declare const progressIndicatorGapMap: SpacingPropsToTokensMap;
1
24
  export declare const sizes: {
2
25
  small: number;
3
26
  default: number;
4
27
  large: number;
5
28
  };
6
- export declare const spacingDivision: {
7
- comfortable: number;
8
- cozy: number;
9
- compact: number;
10
- };
11
29
  export declare const varDotsSize = "--ds-dots-size";
12
30
  export declare const varDotsMargin = "--ds-dots-margin";
31
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/progress-indicator",
3
- "version": "9.3.3",
3
+ "version": "9.4.0",
4
4
  "description": "A progress indicator shows the user where they are along the steps of a journey.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -25,6 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@atlaskit/analytics-next": "^8.0.0",
28
+ "@atlaskit/ds-explorations": "^1.5.0",
28
29
  "@atlaskit/ds-lib": "^2.1.0",
29
30
  "@atlaskit/focus-ring": "^1.2.0",
30
31
  "@atlaskit/theme": "^12.2.0",
@@ -58,7 +59,10 @@
58
59
  },
59
60
  "@repo/internal": {
60
61
  "dom-events": "use-bind-event-listener",
61
- "ui-components": "lite-mode",
62
+ "ui-components": [
63
+ "lite-mode",
64
+ "primitives"
65
+ ],
62
66
  "design-system": "v1",
63
67
  "styling": [
64
68
  "static",