@instructure/ui-progress 11.7.3-snapshot-25 → 11.7.3-snapshot-26
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 +5 -2
- package/es/ProgressBar/v1/index.js +55 -55
- package/es/ProgressBar/v1/styles.js +8 -8
- package/es/ProgressBar/v1/theme.js +42 -41
- package/es/ProgressBar/v2/index.js +55 -55
- package/es/ProgressBar/v2/styles.js +8 -8
- package/es/ProgressCircle/v1/index.js +60 -58
- package/es/ProgressCircle/v1/styles.js +10 -8
- package/es/ProgressCircle/v1/theme.js +31 -30
- package/es/ProgressCircle/v2/index.js +60 -58
- package/es/ProgressCircle/v2/styles.js +10 -8
- package/lib/ProgressBar/v1/index.js +55 -55
- package/lib/ProgressBar/v1/styles.js +8 -8
- package/lib/ProgressBar/v1/theme.js +42 -41
- package/lib/ProgressBar/v2/index.js +55 -55
- package/lib/ProgressBar/v2/styles.js +8 -8
- package/lib/ProgressCircle/v1/index.js +60 -58
- package/lib/ProgressCircle/v1/styles.js +10 -8
- package/lib/ProgressCircle/v1/theme.js +31 -30
- package/lib/ProgressCircle/v2/index.js +60 -58
- package/lib/ProgressCircle/v2/styles.js +10 -8
- package/package.json +12 -12
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const _excluded = ["color", "renderValue", "formatScreenReaderValue", "meterColor", "valueNow", "valueMax", "screenReaderLabel", "size", "styles"];
|
|
3
|
-
var _dec, _class, _ProgressCircle;
|
|
1
|
+
var _dec, _class;
|
|
4
2
|
/*
|
|
5
3
|
* The MIT License (MIT)
|
|
6
4
|
*
|
|
@@ -39,29 +37,50 @@ category: components
|
|
|
39
37
|
---
|
|
40
38
|
**/
|
|
41
39
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
42
|
-
let ProgressCircle = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class =
|
|
40
|
+
let ProgressCircle = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class ProgressCircle extends Component {
|
|
41
|
+
static displayName = "ProgressCircle";
|
|
42
|
+
static componentId = 'ProgressCircle';
|
|
43
|
+
static allowedProps = allowedProps;
|
|
44
|
+
static defaultProps = {
|
|
45
|
+
formatScreenReaderValue: ({
|
|
46
|
+
valueNow,
|
|
47
|
+
valueMax
|
|
48
|
+
}) => `${valueNow} / ${valueMax}`,
|
|
49
|
+
size: 'medium',
|
|
50
|
+
valueMax: 100,
|
|
51
|
+
valueNow: 0,
|
|
52
|
+
as: 'div',
|
|
53
|
+
color: 'primary',
|
|
54
|
+
shouldAnimateOnMount: false,
|
|
55
|
+
// default to showing `success` color on completion
|
|
56
|
+
meterColor: ({
|
|
57
|
+
valueNow,
|
|
58
|
+
valueMax
|
|
59
|
+
}) => valueNow / valueMax >= 1 ? 'success' : 'brand'
|
|
60
|
+
};
|
|
61
|
+
_timeouts = [];
|
|
62
|
+
ref = null;
|
|
43
63
|
constructor(props) {
|
|
44
64
|
super(props);
|
|
45
|
-
this._timeouts = [];
|
|
46
|
-
this.ref = null;
|
|
47
|
-
this.handleRef = el => {
|
|
48
|
-
const elementRef = this.props.elementRef;
|
|
49
|
-
this.ref = el;
|
|
50
|
-
if (typeof elementRef === 'function') {
|
|
51
|
-
elementRef(el);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
65
|
this.state = {
|
|
55
66
|
shouldAnimateOnMount: props.shouldAnimateOnMount
|
|
56
67
|
};
|
|
57
68
|
}
|
|
69
|
+
handleRef = el => {
|
|
70
|
+
const {
|
|
71
|
+
elementRef
|
|
72
|
+
} = this.props;
|
|
73
|
+
this.ref = el;
|
|
74
|
+
if (typeof elementRef === 'function') {
|
|
75
|
+
elementRef(el);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
58
78
|
get makeStylesVariables() {
|
|
59
79
|
return {
|
|
60
80
|
shouldAnimateOnMount: this.state.shouldAnimateOnMount
|
|
61
81
|
};
|
|
62
82
|
}
|
|
63
83
|
componentDidMount() {
|
|
64
|
-
var _this$props$makeStyle, _this$props;
|
|
65
84
|
if (this.state.shouldAnimateOnMount) {
|
|
66
85
|
this._timeouts.push(setTimeout(() => {
|
|
67
86
|
this.setState({
|
|
@@ -69,32 +88,31 @@ let ProgressCircle = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
69
88
|
});
|
|
70
89
|
}, this.props.animationDelay || 500));
|
|
71
90
|
}
|
|
72
|
-
|
|
91
|
+
this.props.makeStyles?.(this.makeStylesVariables);
|
|
73
92
|
}
|
|
74
93
|
componentDidUpdate() {
|
|
75
|
-
|
|
76
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStylesVariables);
|
|
94
|
+
this.props.makeStyles?.(this.makeStylesVariables);
|
|
77
95
|
}
|
|
78
96
|
componentWillUnmount() {
|
|
79
97
|
this._timeouts.forEach(timeout => clearTimeout(timeout));
|
|
80
98
|
}
|
|
81
99
|
render() {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
100
|
+
const {
|
|
101
|
+
color,
|
|
102
|
+
renderValue,
|
|
103
|
+
formatScreenReaderValue,
|
|
104
|
+
meterColor,
|
|
105
|
+
valueNow,
|
|
106
|
+
valueMax,
|
|
107
|
+
screenReaderLabel,
|
|
108
|
+
size,
|
|
109
|
+
styles,
|
|
110
|
+
...props
|
|
111
|
+
} = this.props;
|
|
94
112
|
const valueText = typeof formatScreenReaderValue === 'function' ? formatScreenReaderValue({
|
|
95
113
|
valueNow: valueNow,
|
|
96
114
|
valueMax: valueMax
|
|
97
|
-
}) :
|
|
115
|
+
}) : undefined;
|
|
98
116
|
// consolidating the label and aria-valuetext to put in aria-label because
|
|
99
117
|
// NVDA does not read aria-valuetext: https://github.com/nvaccess/nvda/issues/913
|
|
100
118
|
// But leaving aria-valuetext because JAWS ignores aria-label
|
|
@@ -104,13 +122,13 @@ let ProgressCircle = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
104
122
|
valueMax: valueMax
|
|
105
123
|
});
|
|
106
124
|
const style = {
|
|
107
|
-
strokeDashoffset: `${styles
|
|
125
|
+
strokeDashoffset: `${styles?.dashOffset}em`
|
|
108
126
|
};
|
|
109
127
|
return _jsxs(View, {
|
|
110
128
|
...passthroughProps(props),
|
|
111
129
|
as: this.props.as,
|
|
112
130
|
elementRef: this.handleRef,
|
|
113
|
-
css: styles
|
|
131
|
+
css: styles?.progressCircle,
|
|
114
132
|
margin: this.props.margin,
|
|
115
133
|
"data-cid": "ProgressCircle",
|
|
116
134
|
children: [_jsx(ScreenReaderContent, {
|
|
@@ -120,55 +138,39 @@ let ProgressCircle = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
120
138
|
"aria-valuetext": labelAndValueText
|
|
121
139
|
})
|
|
122
140
|
}), value && _jsx("span", {
|
|
123
|
-
css: styles
|
|
141
|
+
css: styles?.center,
|
|
124
142
|
"aria-hidden": "true",
|
|
125
143
|
children: _jsx("span", {
|
|
126
|
-
css: styles
|
|
144
|
+
css: styles?.value,
|
|
127
145
|
children: value
|
|
128
146
|
})
|
|
129
147
|
}), _jsxs("svg", {
|
|
130
|
-
css: styles
|
|
148
|
+
css: styles?.circle,
|
|
131
149
|
role: "presentation",
|
|
132
150
|
focusable: "false",
|
|
133
151
|
children: [_jsx("circle", {
|
|
134
|
-
css: styles
|
|
152
|
+
css: styles?.track,
|
|
135
153
|
role: "presentation",
|
|
136
154
|
cx: "50%",
|
|
137
155
|
cy: "50%",
|
|
138
|
-
r: styles
|
|
156
|
+
r: styles?.radii?.radius
|
|
139
157
|
}), _jsx("circle", {
|
|
140
|
-
css: styles
|
|
158
|
+
css: styles?.border,
|
|
141
159
|
role: "presentation",
|
|
142
160
|
cx: "50%",
|
|
143
161
|
cy: "50%",
|
|
144
|
-
r: styles
|
|
162
|
+
r: styles?.radii?.borderOffsetRadius
|
|
145
163
|
}), _jsx("circle", {
|
|
146
|
-
css: styles
|
|
164
|
+
css: styles?.meter,
|
|
147
165
|
role: "presentation",
|
|
148
166
|
style: style,
|
|
149
167
|
cx: "50%",
|
|
150
168
|
cy: "50%",
|
|
151
|
-
r: styles
|
|
169
|
+
r: styles?.radii?.radius
|
|
152
170
|
})]
|
|
153
171
|
})]
|
|
154
172
|
});
|
|
155
173
|
}
|
|
156
|
-
}
|
|
157
|
-
formatScreenReaderValue: ({
|
|
158
|
-
valueNow,
|
|
159
|
-
valueMax
|
|
160
|
-
}) => `${valueNow} / ${valueMax}`,
|
|
161
|
-
size: 'medium',
|
|
162
|
-
valueMax: 100,
|
|
163
|
-
valueNow: 0,
|
|
164
|
-
as: 'div',
|
|
165
|
-
color: 'primary',
|
|
166
|
-
shouldAnimateOnMount: false,
|
|
167
|
-
// default to showing `success` color on completion
|
|
168
|
-
meterColor: ({
|
|
169
|
-
valueNow,
|
|
170
|
-
valueMax
|
|
171
|
-
}) => valueNow / valueMax >= 1 ? 'success' : 'brand'
|
|
172
|
-
}, _ProgressCircle)) || _class);
|
|
174
|
+
}) || _class);
|
|
173
175
|
export default ProgressCircle;
|
|
174
176
|
export { ProgressCircle };
|
|
@@ -33,14 +33,16 @@
|
|
|
33
33
|
* @return {Object} The final style object, which will be used in the component
|
|
34
34
|
*/
|
|
35
35
|
const generateStyle = (componentTheme, props, state) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
valueNow =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
36
|
+
const {
|
|
37
|
+
size,
|
|
38
|
+
color,
|
|
39
|
+
meterColor,
|
|
40
|
+
valueNow = 0,
|
|
41
|
+
valueMax = 100
|
|
42
|
+
} = props;
|
|
43
|
+
const {
|
|
44
|
+
shouldAnimateOnMount
|
|
45
|
+
} = state;
|
|
44
46
|
const getMeterColorClassName = typeof meterColor === 'function' ? meterColor({
|
|
45
47
|
valueNow,
|
|
46
48
|
valueMax
|
|
@@ -64,28 +64,29 @@ const transform = function (s) {
|
|
|
64
64
|
* @return {Object} The final theme object with the overrides and component variables
|
|
65
65
|
*/
|
|
66
66
|
const generateComponentTheme = theme => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
typography
|
|
70
|
-
themeName
|
|
67
|
+
const {
|
|
68
|
+
colors,
|
|
69
|
+
typography,
|
|
70
|
+
key: themeName
|
|
71
|
+
} = theme;
|
|
71
72
|
const themeSpecificStyle = {
|
|
72
73
|
canvas: {
|
|
73
74
|
color: theme['ic-brand-font-color-dark'],
|
|
74
75
|
meterColorBrand: theme['ic-brand-primary']
|
|
75
76
|
},
|
|
76
77
|
'canvas-high-contrast': {
|
|
77
|
-
meterColorBrandInverse: colors
|
|
78
|
-
meterColorSuccessInverse: colors
|
|
79
|
-
meterColorInfoInverse: colors
|
|
80
|
-
meterColorAlertInverse: colors
|
|
81
|
-
meterColorWarningInverse: colors
|
|
82
|
-
meterColorDangerInverse: colors
|
|
78
|
+
meterColorBrandInverse: colors?.contrasts?.white1010,
|
|
79
|
+
meterColorSuccessInverse: colors?.contrasts?.white1010,
|
|
80
|
+
meterColorInfoInverse: colors?.contrasts?.white1010,
|
|
81
|
+
meterColorAlertInverse: colors?.contrasts?.white1010,
|
|
82
|
+
meterColorWarningInverse: colors?.contrasts?.white1010,
|
|
83
|
+
meterColorDangerInverse: colors?.contrasts?.white1010
|
|
83
84
|
}
|
|
84
85
|
};
|
|
85
86
|
const componentVariables = {
|
|
86
|
-
fontFamily: typography
|
|
87
|
-
fontWeight: typography
|
|
88
|
-
lineHeight: typography
|
|
87
|
+
fontFamily: typography?.fontFamily,
|
|
88
|
+
fontWeight: typography?.fontWeightNormal,
|
|
89
|
+
lineHeight: typography?.lineHeightCondensed,
|
|
89
90
|
xSmallSize: `${size.xSmall}em`,
|
|
90
91
|
xSmallRadius: `${radius.xSmall}em`,
|
|
91
92
|
xSmallCircumference: `${circumference(radius.xSmall)}em`,
|
|
@@ -110,26 +111,26 @@ const generateComponentTheme = theme => {
|
|
|
110
111
|
largeTransform: `${transform(size.large)}em`,
|
|
111
112
|
largeStrokeWidth: `${strokeWidth.large}em`,
|
|
112
113
|
largeBorderOffset: `${borderOffsetRadius.large}em`,
|
|
113
|
-
color: colors
|
|
114
|
-
colorInverse: colors
|
|
115
|
-
trackColor: colors
|
|
114
|
+
color: colors?.contrasts?.grey125125,
|
|
115
|
+
colorInverse: colors?.contrasts?.white1010,
|
|
116
|
+
trackColor: colors?.contrasts?.white1010,
|
|
116
117
|
trackColorInverse: 'transparent',
|
|
117
|
-
trackBorderColor: colors
|
|
118
|
-
trackBorderColorInverse: colors
|
|
118
|
+
trackBorderColor: colors?.contrasts?.grey3045,
|
|
119
|
+
trackBorderColorInverse: colors?.contrasts?.white1010,
|
|
119
120
|
// variables are split out for inverse to allow
|
|
120
121
|
// color value changes for inverse-high-contrast
|
|
121
|
-
meterColorBrand: colors
|
|
122
|
-
meterColorBrandInverse: colors
|
|
123
|
-
meterColorInfo: colors
|
|
124
|
-
meterColorInfoInverse: colors
|
|
125
|
-
meterColorSuccess: colors
|
|
126
|
-
meterColorSuccessInverse: colors
|
|
127
|
-
meterColorDanger: colors
|
|
128
|
-
meterColorDangerInverse: colors
|
|
129
|
-
meterColorAlert: colors
|
|
130
|
-
meterColorAlertInverse: colors
|
|
131
|
-
meterColorWarning: colors
|
|
132
|
-
meterColorWarningInverse: colors
|
|
122
|
+
meterColorBrand: colors?.contrasts?.blue4570,
|
|
123
|
+
meterColorBrandInverse: colors?.contrasts?.blue4570,
|
|
124
|
+
meterColorInfo: colors?.contrasts?.blue4570,
|
|
125
|
+
meterColorInfoInverse: colors?.contrasts?.blue4570,
|
|
126
|
+
meterColorSuccess: colors?.contrasts?.green4570,
|
|
127
|
+
meterColorSuccessInverse: colors?.contrasts?.green4570,
|
|
128
|
+
meterColorDanger: colors?.contrasts?.red4570,
|
|
129
|
+
meterColorDangerInverse: colors?.contrasts?.red4570,
|
|
130
|
+
meterColorAlert: colors?.contrasts?.blue4570,
|
|
131
|
+
meterColorAlertInverse: colors?.contrasts?.blue4570,
|
|
132
|
+
meterColorWarning: colors?.contrasts?.orange4570,
|
|
133
|
+
meterColorWarningInverse: colors?.contrasts?.orange4570
|
|
133
134
|
};
|
|
134
135
|
return {
|
|
135
136
|
...componentVariables,
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const _excluded = ["color", "renderValue", "formatScreenReaderValue", "meterColor", "valueNow", "valueMax", "screenReaderLabel", "size", "styles"];
|
|
3
|
-
var _dec, _class, _ProgressCircle;
|
|
1
|
+
var _dec, _class;
|
|
4
2
|
/*
|
|
5
3
|
* The MIT License (MIT)
|
|
6
4
|
*
|
|
@@ -38,29 +36,50 @@ category: components
|
|
|
38
36
|
---
|
|
39
37
|
**/
|
|
40
38
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
41
|
-
let ProgressCircle = (_dec = withStyle(generateStyle), _dec(_class =
|
|
39
|
+
let ProgressCircle = (_dec = withStyle(generateStyle), _dec(_class = class ProgressCircle extends Component {
|
|
40
|
+
static displayName = "ProgressCircle";
|
|
41
|
+
static componentId = 'ProgressCircle';
|
|
42
|
+
static allowedProps = allowedProps;
|
|
43
|
+
static defaultProps = {
|
|
44
|
+
formatScreenReaderValue: ({
|
|
45
|
+
valueNow,
|
|
46
|
+
valueMax
|
|
47
|
+
}) => `${valueNow} / ${valueMax}`,
|
|
48
|
+
size: 'medium',
|
|
49
|
+
valueMax: 100,
|
|
50
|
+
valueNow: 0,
|
|
51
|
+
as: 'div',
|
|
52
|
+
color: 'primary',
|
|
53
|
+
shouldAnimateOnMount: false,
|
|
54
|
+
// default to showing `success` color on completion
|
|
55
|
+
meterColor: ({
|
|
56
|
+
valueNow,
|
|
57
|
+
valueMax
|
|
58
|
+
}) => valueNow / valueMax >= 1 ? 'success' : 'brand'
|
|
59
|
+
};
|
|
60
|
+
_timeouts = [];
|
|
61
|
+
ref = null;
|
|
42
62
|
constructor(props) {
|
|
43
63
|
super(props);
|
|
44
|
-
this._timeouts = [];
|
|
45
|
-
this.ref = null;
|
|
46
|
-
this.handleRef = el => {
|
|
47
|
-
const elementRef = this.props.elementRef;
|
|
48
|
-
this.ref = el;
|
|
49
|
-
if (typeof elementRef === 'function') {
|
|
50
|
-
elementRef(el);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
64
|
this.state = {
|
|
54
65
|
shouldAnimateOnMount: props.shouldAnimateOnMount
|
|
55
66
|
};
|
|
56
67
|
}
|
|
68
|
+
handleRef = el => {
|
|
69
|
+
const {
|
|
70
|
+
elementRef
|
|
71
|
+
} = this.props;
|
|
72
|
+
this.ref = el;
|
|
73
|
+
if (typeof elementRef === 'function') {
|
|
74
|
+
elementRef(el);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
57
77
|
get makeStylesVariables() {
|
|
58
78
|
return {
|
|
59
79
|
shouldAnimateOnMount: this.state.shouldAnimateOnMount
|
|
60
80
|
};
|
|
61
81
|
}
|
|
62
82
|
componentDidMount() {
|
|
63
|
-
var _this$props$makeStyle, _this$props;
|
|
64
83
|
if (this.state.shouldAnimateOnMount) {
|
|
65
84
|
this._timeouts.push(setTimeout(() => {
|
|
66
85
|
this.setState({
|
|
@@ -68,32 +87,31 @@ let ProgressCircle = (_dec = withStyle(generateStyle), _dec(_class = (_ProgressC
|
|
|
68
87
|
});
|
|
69
88
|
}, this.props.animationDelay || 500));
|
|
70
89
|
}
|
|
71
|
-
|
|
90
|
+
this.props.makeStyles?.(this.makeStylesVariables);
|
|
72
91
|
}
|
|
73
92
|
componentDidUpdate() {
|
|
74
|
-
|
|
75
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStylesVariables);
|
|
93
|
+
this.props.makeStyles?.(this.makeStylesVariables);
|
|
76
94
|
}
|
|
77
95
|
componentWillUnmount() {
|
|
78
96
|
this._timeouts.forEach(timeout => clearTimeout(timeout));
|
|
79
97
|
}
|
|
80
98
|
render() {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
const {
|
|
100
|
+
color,
|
|
101
|
+
renderValue,
|
|
102
|
+
formatScreenReaderValue,
|
|
103
|
+
meterColor,
|
|
104
|
+
valueNow,
|
|
105
|
+
valueMax,
|
|
106
|
+
screenReaderLabel,
|
|
107
|
+
size,
|
|
108
|
+
styles,
|
|
109
|
+
...props
|
|
110
|
+
} = this.props;
|
|
93
111
|
const valueText = typeof formatScreenReaderValue === 'function' ? formatScreenReaderValue({
|
|
94
112
|
valueNow: valueNow,
|
|
95
113
|
valueMax: valueMax
|
|
96
|
-
}) :
|
|
114
|
+
}) : undefined;
|
|
97
115
|
// consolidating the label and aria-valuetext to put in aria-label because
|
|
98
116
|
// NVDA does not read aria-valuetext: https://github.com/nvaccess/nvda/issues/913
|
|
99
117
|
// But leaving aria-valuetext because JAWS ignores aria-label
|
|
@@ -103,13 +121,13 @@ let ProgressCircle = (_dec = withStyle(generateStyle), _dec(_class = (_ProgressC
|
|
|
103
121
|
valueMax: valueMax
|
|
104
122
|
});
|
|
105
123
|
const style = {
|
|
106
|
-
strokeDashoffset: `${styles
|
|
124
|
+
strokeDashoffset: `${styles?.dashOffset}em`
|
|
107
125
|
};
|
|
108
126
|
return _jsxs(View, {
|
|
109
127
|
...passthroughProps(props),
|
|
110
128
|
as: this.props.as,
|
|
111
129
|
elementRef: this.handleRef,
|
|
112
|
-
css: styles
|
|
130
|
+
css: styles?.progressCircle,
|
|
113
131
|
margin: this.props.margin,
|
|
114
132
|
"data-cid": "ProgressCircle",
|
|
115
133
|
children: [_jsx(ScreenReaderContent, {
|
|
@@ -119,55 +137,39 @@ let ProgressCircle = (_dec = withStyle(generateStyle), _dec(_class = (_ProgressC
|
|
|
119
137
|
"aria-valuetext": labelAndValueText
|
|
120
138
|
})
|
|
121
139
|
}), value && _jsx("span", {
|
|
122
|
-
css: styles
|
|
140
|
+
css: styles?.center,
|
|
123
141
|
"aria-hidden": "true",
|
|
124
142
|
children: _jsx("span", {
|
|
125
|
-
css: styles
|
|
143
|
+
css: styles?.value,
|
|
126
144
|
children: value
|
|
127
145
|
})
|
|
128
146
|
}), _jsxs("svg", {
|
|
129
|
-
css: styles
|
|
147
|
+
css: styles?.circle,
|
|
130
148
|
role: "presentation",
|
|
131
149
|
focusable: "false",
|
|
132
150
|
children: [_jsx("circle", {
|
|
133
|
-
css: styles
|
|
151
|
+
css: styles?.track,
|
|
134
152
|
role: "presentation",
|
|
135
153
|
cx: "50%",
|
|
136
154
|
cy: "50%",
|
|
137
|
-
r: styles
|
|
155
|
+
r: styles?.radii?.radius
|
|
138
156
|
}), _jsx("circle", {
|
|
139
|
-
css: styles
|
|
157
|
+
css: styles?.border,
|
|
140
158
|
role: "presentation",
|
|
141
159
|
cx: "50%",
|
|
142
160
|
cy: "50%",
|
|
143
|
-
r: styles
|
|
161
|
+
r: styles?.radii?.borderOffsetRadius
|
|
144
162
|
}), _jsx("circle", {
|
|
145
|
-
css: styles
|
|
163
|
+
css: styles?.meter,
|
|
146
164
|
role: "presentation",
|
|
147
165
|
style: style,
|
|
148
166
|
cx: "50%",
|
|
149
167
|
cy: "50%",
|
|
150
|
-
r: styles
|
|
168
|
+
r: styles?.radii?.radius
|
|
151
169
|
})]
|
|
152
170
|
})]
|
|
153
171
|
});
|
|
154
172
|
}
|
|
155
|
-
}
|
|
156
|
-
formatScreenReaderValue: ({
|
|
157
|
-
valueNow,
|
|
158
|
-
valueMax
|
|
159
|
-
}) => `${valueNow} / ${valueMax}`,
|
|
160
|
-
size: 'medium',
|
|
161
|
-
valueMax: 100,
|
|
162
|
-
valueNow: 0,
|
|
163
|
-
as: 'div',
|
|
164
|
-
color: 'primary',
|
|
165
|
-
shouldAnimateOnMount: false,
|
|
166
|
-
// default to showing `success` color on completion
|
|
167
|
-
meterColor: ({
|
|
168
|
-
valueNow,
|
|
169
|
-
valueMax
|
|
170
|
-
}) => valueNow / valueMax >= 1 ? 'success' : 'brand'
|
|
171
|
-
}, _ProgressCircle)) || _class);
|
|
173
|
+
}) || _class);
|
|
172
174
|
export default ProgressCircle;
|
|
173
175
|
export { ProgressCircle };
|
|
@@ -33,14 +33,16 @@
|
|
|
33
33
|
* @return {Object} The final style object, which will be used in the component
|
|
34
34
|
*/
|
|
35
35
|
const generateStyle = (componentTheme, props, _sharedTokens, state) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
valueNow =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
36
|
+
const {
|
|
37
|
+
size,
|
|
38
|
+
color,
|
|
39
|
+
meterColor,
|
|
40
|
+
valueNow = 0,
|
|
41
|
+
valueMax = 100
|
|
42
|
+
} = props;
|
|
43
|
+
const {
|
|
44
|
+
shouldAnimateOnMount
|
|
45
|
+
} = state;
|
|
44
46
|
const getMeterColorClassName = typeof meterColor === 'function' ? meterColor({
|
|
45
47
|
valueNow,
|
|
46
48
|
valueMax
|