carbon-react 103.0.0 → 103.1.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.
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export default ProgressTracker;
|
|
2
|
-
declare function ProgressTracker({ size, progress, showDefaultLabels, currentProgressLabel, maxProgressLabel, orientation, direction, labelsPosition, ...rest }: {
|
|
2
|
+
declare function ProgressTracker({ "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, "aria-valuenow": ariaValueNow, "aria-valuemin": ariaValueMin, "aria-valuemax": ariaValueMax, "aria-valuetext": ariaValueText, size, progress, showDefaultLabels, currentProgressLabel, maxProgressLabel, orientation, direction, labelsPosition, ...rest }: {
|
|
3
3
|
[x: string]: any;
|
|
4
|
+
"aria-label"?: string | undefined;
|
|
5
|
+
"aria-describedby": any;
|
|
6
|
+
"aria-valuenow": any;
|
|
7
|
+
"aria-valuemin": any;
|
|
8
|
+
"aria-valuemax": any;
|
|
9
|
+
"aria-valuetext": any;
|
|
4
10
|
size?: string | undefined;
|
|
5
11
|
progress?: number | undefined;
|
|
6
12
|
showDefaultLabels?: boolean | undefined;
|
|
@@ -11,15 +17,40 @@ declare function ProgressTracker({ size, progress, showDefaultLabels, currentPro
|
|
|
11
17
|
labelsPosition: any;
|
|
12
18
|
}): JSX.Element;
|
|
13
19
|
declare namespace ProgressTracker {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const propTypes: {
|
|
21
|
+
/** Specifies an aria label to the component */
|
|
22
|
+
"aria-label": PropTypes.Requireable<string>;
|
|
23
|
+
/** Specifies the aria describedby for the component */
|
|
24
|
+
"aria-describedby": PropTypes.Requireable<string>;
|
|
25
|
+
/** The value of progress to be read out to the user. */
|
|
26
|
+
"aria-valuenow": PropTypes.Requireable<number>;
|
|
27
|
+
/** The minimum value of the progress tracker */
|
|
28
|
+
"aria-valuemin": PropTypes.Requireable<number>;
|
|
29
|
+
/** The maximum value of the progress tracker */
|
|
30
|
+
"aria-valuemax": PropTypes.Requireable<number>;
|
|
31
|
+
/** Prop to define the human readable text alternative of aria-valuenow
|
|
32
|
+
* if aria-valuenow is not a number
|
|
33
|
+
*/
|
|
34
|
+
"aria-valuetext": PropTypes.Requireable<string>;
|
|
35
|
+
/** Size of the progress bar. */
|
|
36
|
+
size: PropTypes.Requireable<string>;
|
|
37
|
+
/** Current progress (percentage). */
|
|
38
|
+
progress: PropTypes.Requireable<number>;
|
|
39
|
+
/** Flag to control whether the default value labels (as percentages) should be rendered. */
|
|
40
|
+
showDefaultLabels: PropTypes.Requireable<boolean>;
|
|
41
|
+
/** Value to display as current progress. */
|
|
42
|
+
currentProgressLabel: PropTypes.Requireable<string>;
|
|
43
|
+
/** Value to display as the maximum progress limit. */
|
|
44
|
+
maxProgressLabel: PropTypes.Requireable<string>;
|
|
45
|
+
/** The orientation of the component. */
|
|
46
|
+
orientation: PropTypes.Requireable<string>;
|
|
47
|
+
/** The direction the bar should move as progress increases, only applies in vertical orientation. */
|
|
48
|
+
direction: PropTypes.Requireable<string>;
|
|
49
|
+
/**
|
|
50
|
+
* The position the value label are rendered in.
|
|
51
|
+
* Top/bottom apply to horizontal and left/right to vertical orientation.
|
|
52
|
+
*/
|
|
53
|
+
labelsPosition: PropTypes.Requireable<string>;
|
|
54
|
+
};
|
|
24
55
|
}
|
|
25
56
|
import PropTypes from "prop-types";
|
|
@@ -24,6 +24,12 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
24
24
|
const marginPropTypes = (0, _utils.filterStyledSystemMarginProps)(_propTypes2.default.space);
|
|
25
25
|
|
|
26
26
|
const ProgressTracker = ({
|
|
27
|
+
"aria-label": ariaLabel = "progress tracker",
|
|
28
|
+
"aria-describedby": ariaDescribedBy,
|
|
29
|
+
"aria-valuenow": ariaValueNow,
|
|
30
|
+
"aria-valuemin": ariaValueMin,
|
|
31
|
+
"aria-valuemax": ariaValueMax,
|
|
32
|
+
"aria-valuetext": ariaValueText,
|
|
27
33
|
size = "medium",
|
|
28
34
|
progress = 0,
|
|
29
35
|
showDefaultLabels = false,
|
|
@@ -63,7 +69,15 @@ const ProgressTracker = ({
|
|
|
63
69
|
return /*#__PURE__*/_react.default.createElement(_progressTracker.StyledProgressTracker, _extends({
|
|
64
70
|
size: size,
|
|
65
71
|
isVertical: isVertical
|
|
66
|
-
}, rest, (0, _tags.default)("progress-bar", rest)
|
|
72
|
+
}, rest, (0, _tags.default)("progress-bar", rest), {
|
|
73
|
+
role: "progressbar",
|
|
74
|
+
"aria-label": ariaLabel,
|
|
75
|
+
"aria-describedby": ariaDescribedBy,
|
|
76
|
+
"aria-valuenow": ariaValueNow,
|
|
77
|
+
"aria-valuemin": ariaValueMin,
|
|
78
|
+
"aria-valuemax": ariaValueMax,
|
|
79
|
+
"aria-valuetext": ariaValueText
|
|
80
|
+
}), prefixLabels && renderValueLabels(), /*#__PURE__*/_react.default.createElement(_progressTracker.StyledProgressBar, {
|
|
67
81
|
direction: isVertical ? direction : undefined,
|
|
68
82
|
isVertical: isVertical,
|
|
69
83
|
size: size
|
|
@@ -76,6 +90,26 @@ const ProgressTracker = ({
|
|
|
76
90
|
|
|
77
91
|
ProgressTracker.propTypes = { ...marginPropTypes,
|
|
78
92
|
|
|
93
|
+
/** Specifies an aria label to the component */
|
|
94
|
+
"aria-label": _propTypes.default.string,
|
|
95
|
+
|
|
96
|
+
/** Specifies the aria describedby for the component */
|
|
97
|
+
"aria-describedby": _propTypes.default.string,
|
|
98
|
+
|
|
99
|
+
/** The value of progress to be read out to the user. */
|
|
100
|
+
"aria-valuenow": _propTypes.default.number,
|
|
101
|
+
|
|
102
|
+
/** The minimum value of the progress tracker */
|
|
103
|
+
"aria-valuemin": _propTypes.default.number,
|
|
104
|
+
|
|
105
|
+
/** The maximum value of the progress tracker */
|
|
106
|
+
"aria-valuemax": _propTypes.default.number,
|
|
107
|
+
|
|
108
|
+
/** Prop to define the human readable text alternative of aria-valuenow
|
|
109
|
+
* if aria-valuenow is not a number
|
|
110
|
+
*/
|
|
111
|
+
"aria-valuetext": _propTypes.default.string,
|
|
112
|
+
|
|
79
113
|
/** Size of the progress bar. */
|
|
80
114
|
size: _propTypes.default.oneOf(["small", "medium", "large"]),
|
|
81
115
|
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { MarginProps } from "styled-system";
|
|
2
2
|
|
|
3
3
|
export interface ProgressBarProps extends MarginProps {
|
|
4
|
+
/** Specifies an aria-label to the component */
|
|
5
|
+
"aria-label"?: string;
|
|
6
|
+
/** Specifies the aria-describedby for the component */
|
|
7
|
+
"aria-describedby"?: string;
|
|
8
|
+
/** The value of progress to be read out to the user. */
|
|
9
|
+
"aria-valuenow"?: number;
|
|
10
|
+
/** The minimum value of the progress tracker */
|
|
11
|
+
"aria-valuemin"?: number;
|
|
12
|
+
/** The maximum value of the progress tracker */
|
|
13
|
+
"aria-valueMax"?: number;
|
|
14
|
+
/** Prop to define the human readable text alternative of aria-valuenow
|
|
15
|
+
* if aria-valuenow is not a number */
|
|
16
|
+
"aria-valuetext"?: string;
|
|
4
17
|
/** Size of the progressBar. */
|
|
5
18
|
size?: "small" | "medium" | "large";
|
|
6
19
|
/** Current progress (percentage). */
|