@atlaskit/progress-indicator 9.0.4 → 9.1.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 +32 -0
- package/codemods/{9.0.0-import-rename.ts → 9.0.0-import-rename.tsx} +9 -9
- package/codemods/__tests__/{9.0.0-import-rename.ts → 9.0.0-import-rename.tsx} +0 -0
- package/dist/cjs/components/appearances.js +54 -0
- package/dist/cjs/components/constants.js +22 -0
- package/dist/cjs/components/indicator.js +69 -0
- package/dist/cjs/components/progress-dots.js +164 -0
- package/dist/cjs/components/types.js +5 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/types.js +5 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/appearances.js +40 -0
- package/dist/es2019/components/constants.js +12 -0
- package/dist/es2019/components/indicator.js +50 -0
- package/dist/es2019/components/progress-dots.js +135 -0
- package/dist/es2019/components/types.js +1 -0
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/types.js +1 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/appearances.js +42 -0
- package/dist/esm/components/constants.js +12 -0
- package/dist/esm/components/indicator.js +52 -0
- package/dist/esm/components/progress-dots.js +140 -0
- package/dist/esm/components/types.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/types.js +1 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/components/appearances.d.ts +2 -0
- package/dist/types/components/constants.d.ts +12 -0
- package/dist/types/components/indicator.d.ts +14 -0
- package/dist/types/components/progress-dots.d.ts +10 -0
- package/dist/types/components/types.d.ts +3 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/types.d.ts +44 -0
- package/package.json +29 -11
- package/types/package.json +7 -0
- package/dist/cjs/components/Dots.js +0 -197
- package/dist/cjs/styled/Dots.js +0 -174
- package/dist/es2019/components/Dots.js +0 -145
- package/dist/es2019/styled/Dots.js +0 -122
- package/dist/esm/components/Dots.js +0 -178
- package/dist/esm/styled/Dots.js +0 -151
- package/dist/types/components/Dots.d.ts +0 -51
- package/dist/types/styled/Dots.d.ts +0 -12
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React, { useCallback, useEffect, useRef } from 'react';
|
|
3
|
+
import { css, jsx } from '@emotion/core';
|
|
4
|
+
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
5
|
+
import noop from '@atlaskit/ds-lib/noop';
|
|
6
|
+
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
7
|
+
import { getBgColor } from './appearances';
|
|
8
|
+
import { sizes, spacingDivision, varDotsMargin, varDotsSize } from './constants';
|
|
9
|
+
import { ButtonIndicator, PresentationalIndicator } from './indicator';
|
|
10
|
+
const packageName = "@atlaskit/progress-indicator";
|
|
11
|
+
const packageVersion = "9.1.2";
|
|
12
|
+
const containerStyles = css({
|
|
13
|
+
display: 'flex',
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
gap: `var(${varDotsMargin})`
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* __ProgressDots__
|
|
19
|
+
*
|
|
20
|
+
* A progress indicator shows the user where they are along the steps of a journey.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
const ProgressDots = ({
|
|
24
|
+
appearance = 'default',
|
|
25
|
+
ariaControls = 'panel',
|
|
26
|
+
ariaLabel = 'tab',
|
|
27
|
+
size = 'default',
|
|
28
|
+
// NOTE: `spacing` is a reserved HTML attribute and will be added to the
|
|
29
|
+
// element, replaced with `gutter`.
|
|
30
|
+
spacing: gutter = 'comfortable',
|
|
31
|
+
selectedIndex,
|
|
32
|
+
testId,
|
|
33
|
+
values,
|
|
34
|
+
onSelect
|
|
35
|
+
}) => {
|
|
36
|
+
const tablistRef = useRef(null);
|
|
37
|
+
const onSelectWithAnalytics = usePlatformLeafEventHandler({
|
|
38
|
+
fn: onSelect || noop,
|
|
39
|
+
action: 'selected',
|
|
40
|
+
componentName: 'progressIndicator',
|
|
41
|
+
packageName,
|
|
42
|
+
packageVersion
|
|
43
|
+
});
|
|
44
|
+
const handleKeyDown = useCallback(event => {
|
|
45
|
+
const indicators = Array.from(tablistRef.current.children); // bail if the target isn't an indicator
|
|
46
|
+
|
|
47
|
+
if (!indicators.includes(event.target)) {
|
|
48
|
+
return;
|
|
49
|
+
} // bail if not valid arrow key
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
const isLeft = event.key === 'ArrowLeft';
|
|
53
|
+
const isRight = event.key === 'ArrowRight';
|
|
54
|
+
|
|
55
|
+
if (!isLeft && !isRight) {
|
|
56
|
+
return;
|
|
57
|
+
} // bail if at either end of the values
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
const isAlpha = isLeft && selectedIndex === 0;
|
|
61
|
+
const isOmega = isRight && selectedIndex === values.length - 1;
|
|
62
|
+
|
|
63
|
+
if (isAlpha || isOmega) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const index = isLeft ? selectedIndex - 1 : selectedIndex + 1; // call the consumer's select method and focus the applicable indicator
|
|
68
|
+
|
|
69
|
+
if (onSelect) {
|
|
70
|
+
onSelectWithAnalytics({
|
|
71
|
+
event: event,
|
|
72
|
+
index
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (typeof indicators[index].focus === 'function') {
|
|
77
|
+
indicators[index].focus();
|
|
78
|
+
}
|
|
79
|
+
}, [onSelectWithAnalytics, selectedIndex, values, onSelect]);
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (onSelect) {
|
|
82
|
+
document.addEventListener('keydown', handleKeyDown, false);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return () => {
|
|
86
|
+
if (onSelect) {
|
|
87
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}, [onSelect, handleKeyDown]);
|
|
91
|
+
const theme = useGlobalTheme();
|
|
92
|
+
return jsx("div", {
|
|
93
|
+
"data-testid": testId,
|
|
94
|
+
css: containerStyles,
|
|
95
|
+
style: {
|
|
96
|
+
[varDotsSize]: `${sizes[size]}px`,
|
|
97
|
+
[varDotsMargin]: `${sizes[size] / spacingDivision[gutter]}px`
|
|
98
|
+
},
|
|
99
|
+
ref: r => {
|
|
100
|
+
tablistRef.current = r;
|
|
101
|
+
},
|
|
102
|
+
role: "tablist"
|
|
103
|
+
}, values.map((_, index) => {
|
|
104
|
+
const isSelected = selectedIndex === index;
|
|
105
|
+
const tabId = `${ariaLabel}${index}`;
|
|
106
|
+
const panelId = `${ariaControls}${index}`;
|
|
107
|
+
const backgroundColor = getBgColor(appearance, isSelected)({
|
|
108
|
+
theme
|
|
109
|
+
});
|
|
110
|
+
return onSelect ? jsx(ButtonIndicator, {
|
|
111
|
+
key: index,
|
|
112
|
+
style: {
|
|
113
|
+
backgroundColor
|
|
114
|
+
},
|
|
115
|
+
"aria-controls": panelId,
|
|
116
|
+
"aria-label": tabId,
|
|
117
|
+
"aria-selected": isSelected,
|
|
118
|
+
id: tabId,
|
|
119
|
+
onClick: event => onSelectWithAnalytics({
|
|
120
|
+
event,
|
|
121
|
+
index
|
|
122
|
+
}),
|
|
123
|
+
tabIndex: isSelected ? 0 : -1,
|
|
124
|
+
"data-testid": testId && `${testId}-ind-${index}`
|
|
125
|
+
}) : jsx(PresentationalIndicator, {
|
|
126
|
+
"data-testid": testId && `${testId}-ind-${index}`,
|
|
127
|
+
key: index,
|
|
128
|
+
style: {
|
|
129
|
+
backgroundColor
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}));
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export default ProgressDots;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/es2019/index.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
// having a single named export will avoid consumers having to update their
|
|
3
3
|
// imports when there's a feature release.
|
|
4
4
|
// eslint-disable-next-line import/prefer-default-export
|
|
5
|
-
export { default as ProgressIndicator } from './components/
|
|
5
|
+
export { default as ProgressIndicator } from './components/progress-dots';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/es2019/version.json
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
2
|
+
import { B100, B400, B75, DN30, DN300A, DN600, DN70, N0, N50, N900, P300, P400, P75 } from '@atlaskit/theme/colors';
|
|
3
|
+
import { themed } from '@atlaskit/theme/components';
|
|
4
|
+
var colorMap = {
|
|
5
|
+
default: themed({
|
|
6
|
+
light: N50,
|
|
7
|
+
dark: DN70
|
|
8
|
+
}),
|
|
9
|
+
help: themed({
|
|
10
|
+
light: P75,
|
|
11
|
+
dark: DN70
|
|
12
|
+
}),
|
|
13
|
+
inverted: themed({
|
|
14
|
+
light: 'rgba(255, 255, 255, 0.4)',
|
|
15
|
+
dark: DN300A
|
|
16
|
+
}),
|
|
17
|
+
primary: themed({
|
|
18
|
+
light: B75,
|
|
19
|
+
dark: DN70
|
|
20
|
+
})
|
|
21
|
+
};
|
|
22
|
+
var selectedColorMap = {
|
|
23
|
+
default: themed({
|
|
24
|
+
light: N900,
|
|
25
|
+
dark: DN600
|
|
26
|
+
}),
|
|
27
|
+
help: themed({
|
|
28
|
+
light: P400,
|
|
29
|
+
dark: P300
|
|
30
|
+
}),
|
|
31
|
+
inverted: themed({
|
|
32
|
+
light: N0,
|
|
33
|
+
dark: DN30
|
|
34
|
+
}),
|
|
35
|
+
primary: themed({
|
|
36
|
+
light: B400,
|
|
37
|
+
dark: B100
|
|
38
|
+
})
|
|
39
|
+
};
|
|
40
|
+
export var getBgColor = function getBgColor(appearance, isSelected) {
|
|
41
|
+
return isSelected ? selectedColorMap[appearance] : colorMap[appearance];
|
|
42
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { css, jsx } from '@emotion/core';
|
|
5
|
+
import FocusRing from '@atlaskit/focus-ring';
|
|
6
|
+
import { varDotsMargin, varDotsSize } from './constants';
|
|
7
|
+
var commonStyles = css({
|
|
8
|
+
width: "var(".concat(varDotsSize, ")"),
|
|
9
|
+
height: "var(".concat(varDotsSize, ")"),
|
|
10
|
+
position: 'relative',
|
|
11
|
+
borderRadius: '50%',
|
|
12
|
+
'&::before': {
|
|
13
|
+
display: 'block',
|
|
14
|
+
width: "calc(var(".concat(varDotsSize, ") + var(").concat(varDotsMargin, "))"),
|
|
15
|
+
height: "calc(var(".concat(varDotsSize, ") + var(").concat(varDotsMargin, "))"),
|
|
16
|
+
position: 'absolute',
|
|
17
|
+
top: "calc(-1 * var(".concat(varDotsMargin, ") / 2)"),
|
|
18
|
+
left: "calc(-1 * var(".concat(varDotsMargin, ") / 2)"),
|
|
19
|
+
content: '""'
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
var buttonStyles = css({
|
|
23
|
+
padding: 0,
|
|
24
|
+
border: 0,
|
|
25
|
+
cursor: 'pointer',
|
|
26
|
+
outline: 0
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* __Presentational indicator__
|
|
30
|
+
*
|
|
31
|
+
* A presentational indicator with no interactivity
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
export var PresentationalIndicator = function PresentationalIndicator(props) {
|
|
35
|
+
return jsx("div", _extends({}, props, {
|
|
36
|
+
css: commonStyles,
|
|
37
|
+
role: "presentation"
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* __Button indicator__
|
|
42
|
+
*
|
|
43
|
+
* An interactive indicator.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
export var ButtonIndicator = function ButtonIndicator(props) {
|
|
47
|
+
return jsx(FocusRing, null, jsx("button", _extends({}, props, {
|
|
48
|
+
role: "tab",
|
|
49
|
+
type: "button",
|
|
50
|
+
css: [commonStyles, buttonStyles]
|
|
51
|
+
})));
|
|
52
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import React, { useCallback, useEffect, useRef } from 'react';
|
|
5
|
+
import { css, jsx } from '@emotion/core';
|
|
6
|
+
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
7
|
+
import noop from '@atlaskit/ds-lib/noop';
|
|
8
|
+
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
9
|
+
import { getBgColor } from './appearances';
|
|
10
|
+
import { sizes, spacingDivision, varDotsMargin, varDotsSize } from './constants';
|
|
11
|
+
import { ButtonIndicator, PresentationalIndicator } from './indicator';
|
|
12
|
+
var packageName = "@atlaskit/progress-indicator";
|
|
13
|
+
var packageVersion = "9.1.2";
|
|
14
|
+
var containerStyles = css({
|
|
15
|
+
display: 'flex',
|
|
16
|
+
justifyContent: 'center',
|
|
17
|
+
gap: "var(".concat(varDotsMargin, ")")
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* __ProgressDots__
|
|
21
|
+
*
|
|
22
|
+
* A progress indicator shows the user where they are along the steps of a journey.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
var ProgressDots = function ProgressDots(_ref) {
|
|
26
|
+
var _ref2;
|
|
27
|
+
|
|
28
|
+
var _ref$appearance = _ref.appearance,
|
|
29
|
+
appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance,
|
|
30
|
+
_ref$ariaControls = _ref.ariaControls,
|
|
31
|
+
ariaControls = _ref$ariaControls === void 0 ? 'panel' : _ref$ariaControls,
|
|
32
|
+
_ref$ariaLabel = _ref.ariaLabel,
|
|
33
|
+
ariaLabel = _ref$ariaLabel === void 0 ? 'tab' : _ref$ariaLabel,
|
|
34
|
+
_ref$size = _ref.size,
|
|
35
|
+
size = _ref$size === void 0 ? 'default' : _ref$size,
|
|
36
|
+
_ref$spacing = _ref.spacing,
|
|
37
|
+
gutter = _ref$spacing === void 0 ? 'comfortable' : _ref$spacing,
|
|
38
|
+
selectedIndex = _ref.selectedIndex,
|
|
39
|
+
testId = _ref.testId,
|
|
40
|
+
values = _ref.values,
|
|
41
|
+
onSelect = _ref.onSelect;
|
|
42
|
+
var tablistRef = useRef(null);
|
|
43
|
+
var onSelectWithAnalytics = usePlatformLeafEventHandler({
|
|
44
|
+
fn: onSelect || noop,
|
|
45
|
+
action: 'selected',
|
|
46
|
+
componentName: 'progressIndicator',
|
|
47
|
+
packageName: packageName,
|
|
48
|
+
packageVersion: packageVersion
|
|
49
|
+
});
|
|
50
|
+
var handleKeyDown = useCallback(function (event) {
|
|
51
|
+
var indicators = Array.from(tablistRef.current.children); // bail if the target isn't an indicator
|
|
52
|
+
|
|
53
|
+
if (!indicators.includes(event.target)) {
|
|
54
|
+
return;
|
|
55
|
+
} // bail if not valid arrow key
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
var isLeft = event.key === 'ArrowLeft';
|
|
59
|
+
var isRight = event.key === 'ArrowRight';
|
|
60
|
+
|
|
61
|
+
if (!isLeft && !isRight) {
|
|
62
|
+
return;
|
|
63
|
+
} // bail if at either end of the values
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
var isAlpha = isLeft && selectedIndex === 0;
|
|
67
|
+
var isOmega = isRight && selectedIndex === values.length - 1;
|
|
68
|
+
|
|
69
|
+
if (isAlpha || isOmega) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
var index = isLeft ? selectedIndex - 1 : selectedIndex + 1; // call the consumer's select method and focus the applicable indicator
|
|
74
|
+
|
|
75
|
+
if (onSelect) {
|
|
76
|
+
onSelectWithAnalytics({
|
|
77
|
+
event: event,
|
|
78
|
+
index: index
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (typeof indicators[index].focus === 'function') {
|
|
83
|
+
indicators[index].focus();
|
|
84
|
+
}
|
|
85
|
+
}, [onSelectWithAnalytics, selectedIndex, values, onSelect]);
|
|
86
|
+
useEffect(function () {
|
|
87
|
+
if (onSelect) {
|
|
88
|
+
document.addEventListener('keydown', handleKeyDown, false);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return function () {
|
|
92
|
+
if (onSelect) {
|
|
93
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}, [onSelect, handleKeyDown]);
|
|
97
|
+
var theme = useGlobalTheme();
|
|
98
|
+
return jsx("div", {
|
|
99
|
+
"data-testid": testId,
|
|
100
|
+
css: containerStyles,
|
|
101
|
+
style: (_ref2 = {}, _defineProperty(_ref2, varDotsSize, "".concat(sizes[size], "px")), _defineProperty(_ref2, varDotsMargin, "".concat(sizes[size] / spacingDivision[gutter], "px")), _ref2),
|
|
102
|
+
ref: function ref(r) {
|
|
103
|
+
tablistRef.current = r;
|
|
104
|
+
},
|
|
105
|
+
role: "tablist"
|
|
106
|
+
}, values.map(function (_, index) {
|
|
107
|
+
var isSelected = selectedIndex === index;
|
|
108
|
+
var tabId = "".concat(ariaLabel).concat(index);
|
|
109
|
+
var panelId = "".concat(ariaControls).concat(index);
|
|
110
|
+
var backgroundColor = getBgColor(appearance, isSelected)({
|
|
111
|
+
theme: theme
|
|
112
|
+
});
|
|
113
|
+
return onSelect ? jsx(ButtonIndicator, {
|
|
114
|
+
key: index,
|
|
115
|
+
style: {
|
|
116
|
+
backgroundColor: backgroundColor
|
|
117
|
+
},
|
|
118
|
+
"aria-controls": panelId,
|
|
119
|
+
"aria-label": tabId,
|
|
120
|
+
"aria-selected": isSelected,
|
|
121
|
+
id: tabId,
|
|
122
|
+
onClick: function onClick(event) {
|
|
123
|
+
return onSelectWithAnalytics({
|
|
124
|
+
event: event,
|
|
125
|
+
index: index
|
|
126
|
+
});
|
|
127
|
+
},
|
|
128
|
+
tabIndex: isSelected ? 0 : -1,
|
|
129
|
+
"data-testid": testId && "".concat(testId, "-ind-").concat(index)
|
|
130
|
+
}) : jsx(PresentationalIndicator, {
|
|
131
|
+
"data-testid": testId && "".concat(testId, "-ind-").concat(index),
|
|
132
|
+
key: index,
|
|
133
|
+
style: {
|
|
134
|
+
backgroundColor: backgroundColor
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}));
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export default ProgressDots;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/index.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
// having a single named export will avoid consumers having to update their
|
|
3
3
|
// imports when there's a feature release.
|
|
4
4
|
// eslint-disable-next-line import/prefer-default-export
|
|
5
|
-
export { default as ProgressIndicator } from './components/
|
|
5
|
+
export { default as ProgressIndicator } from './components/progress-dots';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const sizes: {
|
|
2
|
+
small: number;
|
|
3
|
+
default: number;
|
|
4
|
+
large: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const spacingDivision: {
|
|
7
|
+
comfortable: number;
|
|
8
|
+
cozy: number;
|
|
9
|
+
compact: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const varDotsSize = "--ds-dots-size";
|
|
12
|
+
export declare const varDotsMargin = "--ds-dots-margin";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import type { HTMLAttributes } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* __Presentational indicator__
|
|
5
|
+
*
|
|
6
|
+
* A presentational indicator with no interactivity
|
|
7
|
+
*/
|
|
8
|
+
export declare const PresentationalIndicator: (props: HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
9
|
+
/**
|
|
10
|
+
* __Button indicator__
|
|
11
|
+
*
|
|
12
|
+
* An interactive indicator.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ButtonIndicator: (props: HTMLAttributes<HTMLButtonElement>) => JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import type { ProgressDotsProps } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* __ProgressDots__
|
|
6
|
+
*
|
|
7
|
+
* A progress indicator shows the user where they are along the steps of a journey.
|
|
8
|
+
*/
|
|
9
|
+
declare const ProgressDots: FC<ProgressDotsProps>;
|
|
10
|
+
export default ProgressDots;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default as ProgressIndicator } from './components/
|
|
1
|
+
export { default as ProgressIndicator } from './components/progress-dots';
|
|
2
|
+
export type { ProgressDotsProps } from './types';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
+
import type { DotsAppearance, Size, Spacing } from './components/types';
|
|
4
|
+
export interface ProgressDotsProps {
|
|
5
|
+
/**
|
|
6
|
+
* The color of the indicators
|
|
7
|
+
*/
|
|
8
|
+
appearance?: DotsAppearance;
|
|
9
|
+
/**
|
|
10
|
+
* The aria-controls text applied to each indicator, appended by the index
|
|
11
|
+
*/
|
|
12
|
+
ariaControls?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The aria-label text applied to each indicator, appended by the index
|
|
15
|
+
*/
|
|
16
|
+
ariaLabel?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Function called when an indicator is selected
|
|
19
|
+
*/
|
|
20
|
+
onSelect?: (eventData: {
|
|
21
|
+
event: React.MouseEvent<HTMLButtonElement>;
|
|
22
|
+
index: number;
|
|
23
|
+
}, analyticsEvent: UIAnalyticsEvent) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Which indicator is currently selected
|
|
26
|
+
*/
|
|
27
|
+
selectedIndex: number;
|
|
28
|
+
/**
|
|
29
|
+
* Corresponds to the width & height of each indicator
|
|
30
|
+
*/
|
|
31
|
+
size?: Size;
|
|
32
|
+
/**
|
|
33
|
+
* How much of a gutter is desired between indicators
|
|
34
|
+
*/
|
|
35
|
+
spacing?: Spacing;
|
|
36
|
+
/**
|
|
37
|
+
* A hook for automated tests.
|
|
38
|
+
*/
|
|
39
|
+
testId?: string;
|
|
40
|
+
/**
|
|
41
|
+
* An array of values mapped over to create the indicators
|
|
42
|
+
*/
|
|
43
|
+
values: any[];
|
|
44
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/progress-indicator",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.1.2",
|
|
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/"
|
|
@@ -13,10 +13,9 @@
|
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
15
|
"sideEffects": false,
|
|
16
|
-
"atlaskit:src": "src/index.
|
|
16
|
+
"atlaskit:src": "src/index.tsx",
|
|
17
17
|
"atlassian": {
|
|
18
18
|
"team": "Design System Team",
|
|
19
|
-
"deprecatedAutoEntryPoints": true,
|
|
20
19
|
"inPublicMirror": true,
|
|
21
20
|
"releaseModel": "scheduled",
|
|
22
21
|
"website": {
|
|
@@ -25,30 +24,49 @@
|
|
|
25
24
|
},
|
|
26
25
|
"dependencies": {
|
|
27
26
|
"@atlaskit/analytics-next": "^8.0.0",
|
|
28
|
-
"@atlaskit/
|
|
29
|
-
"@
|
|
27
|
+
"@atlaskit/ds-lib": "^1.3.0",
|
|
28
|
+
"@atlaskit/focus-ring": "^0.2.4",
|
|
29
|
+
"@atlaskit/theme": "^12.0.0",
|
|
30
|
+
"@babel/runtime": "^7.0.0",
|
|
31
|
+
"@emotion/core": "^10.0.9"
|
|
30
32
|
},
|
|
31
33
|
"peerDependencies": {
|
|
32
|
-
"react": "^16.8.0"
|
|
33
|
-
"styled-components": "^3.2.6"
|
|
34
|
+
"react": "^16.8.0"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@atlaskit/build-utils": "*",
|
|
37
|
-
"@atlaskit/button": "^
|
|
38
|
+
"@atlaskit/button": "^16.0.0",
|
|
38
39
|
"@atlaskit/docs": "*",
|
|
40
|
+
"@atlaskit/section-message": "^6.0.0",
|
|
39
41
|
"@atlaskit/ssr": "*",
|
|
40
42
|
"@atlaskit/visual-regression": "*",
|
|
41
|
-
"@
|
|
43
|
+
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
44
|
+
"@testing-library/react": "^8.0.1",
|
|
45
|
+
"@types/jscodeshift": "^0.11.0",
|
|
42
46
|
"enzyme": "^3.10.0",
|
|
43
|
-
"jscodeshift": "^0.
|
|
47
|
+
"jscodeshift": "^0.13.0",
|
|
44
48
|
"react-dom": "^16.8.0",
|
|
45
49
|
"react-lorem-component": "^0.13.0",
|
|
50
|
+
"styled-components": "^3.2.6",
|
|
46
51
|
"typescript": "3.9.6"
|
|
47
52
|
},
|
|
48
53
|
"techstack": {
|
|
49
54
|
"@atlassian/frontend": {
|
|
50
55
|
"import-structure": "atlassian-conventions"
|
|
56
|
+
},
|
|
57
|
+
"@repo/internal": {
|
|
58
|
+
"ui-components": "lite-mode",
|
|
59
|
+
"design-system": "v1",
|
|
60
|
+
"styling": "emotion",
|
|
61
|
+
"analytics": "analytics-next",
|
|
62
|
+
"theming": "tokens",
|
|
63
|
+
"deprecation": "no-deprecated-imports"
|
|
51
64
|
}
|
|
52
65
|
},
|
|
53
|
-
"
|
|
66
|
+
"af:exports": {
|
|
67
|
+
"./types": "./src/types.tsx",
|
|
68
|
+
".": "./src/index.tsx"
|
|
69
|
+
},
|
|
70
|
+
"homepage": "https://atlassian.design/components/progress-indicator/",
|
|
71
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
54
72
|
}
|