@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
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [11.7.3-snapshot-
|
|
6
|
+
## [11.7.3-snapshot-26](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-26) (2026-05-05)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **many:** update dependencies, remove lots of Babel plugins, remove Webpack 4 support ([f916fca](https://github.com/instructure/instructure-ui/commit/f916fcafdddcb2d7de401f93e8ff92cfdfa47bba))
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const _excluded = ["renderValue", "formatScreenReaderValue", "valueNow", "valueMax", "screenReaderLabel", "size", "color", "meterColor", "renderValueInside", "styles"];
|
|
3
|
-
var _dec, _class, _ProgressBar;
|
|
1
|
+
var _dec, _class;
|
|
4
2
|
/*
|
|
5
3
|
* The MIT License (MIT)
|
|
6
4
|
*
|
|
@@ -38,43 +36,61 @@ category: components
|
|
|
38
36
|
---
|
|
39
37
|
**/
|
|
40
38
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
41
|
-
let ProgressBar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
let ProgressBar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class ProgressBar extends Component {
|
|
40
|
+
static displayName = "ProgressBar";
|
|
41
|
+
static componentId = 'ProgressBar';
|
|
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
|
+
shouldAnimate: false,
|
|
54
|
+
// default to showing `success` color on completion
|
|
55
|
+
meterColor: ({
|
|
56
|
+
valueNow,
|
|
57
|
+
valueMax
|
|
58
|
+
}) => valueNow / valueMax >= 1 ? 'success' : 'brand'
|
|
59
|
+
};
|
|
60
|
+
ref = null;
|
|
53
61
|
componentDidMount() {
|
|
54
|
-
|
|
55
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
62
|
+
this.props.makeStyles?.();
|
|
56
63
|
}
|
|
57
64
|
componentDidUpdate() {
|
|
58
|
-
|
|
59
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
65
|
+
this.props.makeStyles?.();
|
|
60
66
|
}
|
|
67
|
+
handleRef = el => {
|
|
68
|
+
const {
|
|
69
|
+
elementRef
|
|
70
|
+
} = this.props;
|
|
71
|
+
this.ref = el;
|
|
72
|
+
if (typeof elementRef === 'function') {
|
|
73
|
+
elementRef(el);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
61
76
|
render() {
|
|
62
|
-
const
|
|
63
|
-
renderValue
|
|
64
|
-
formatScreenReaderValue
|
|
65
|
-
valueNow
|
|
66
|
-
valueMax
|
|
67
|
-
screenReaderLabel
|
|
68
|
-
size
|
|
69
|
-
color
|
|
70
|
-
meterColor
|
|
71
|
-
renderValueInside
|
|
72
|
-
styles
|
|
73
|
-
props
|
|
77
|
+
const {
|
|
78
|
+
renderValue,
|
|
79
|
+
formatScreenReaderValue,
|
|
80
|
+
valueNow,
|
|
81
|
+
valueMax,
|
|
82
|
+
screenReaderLabel,
|
|
83
|
+
size,
|
|
84
|
+
color,
|
|
85
|
+
meterColor,
|
|
86
|
+
renderValueInside,
|
|
87
|
+
styles,
|
|
88
|
+
...props
|
|
89
|
+
} = this.props;
|
|
74
90
|
const valueText = typeof formatScreenReaderValue === 'function' ? formatScreenReaderValue({
|
|
75
91
|
valueNow: valueNow,
|
|
76
92
|
valueMax: valueMax
|
|
77
|
-
}) :
|
|
93
|
+
}) : undefined;
|
|
78
94
|
const value = callRenderProp(renderValue, {
|
|
79
95
|
valueNow: valueNow,
|
|
80
96
|
valueMax: valueMax
|
|
@@ -82,50 +98,34 @@ let ProgressBar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
|
|
|
82
98
|
return _jsxs(View, {
|
|
83
99
|
...passthroughProps(props),
|
|
84
100
|
as: this.props.as,
|
|
85
|
-
css: styles
|
|
101
|
+
css: styles?.progressBar,
|
|
86
102
|
margin: this.props.margin,
|
|
87
103
|
elementRef: this.handleRef,
|
|
88
104
|
"data-cid": "ProgressBar",
|
|
89
105
|
children: [_jsxs("span", {
|
|
90
|
-
css: styles
|
|
106
|
+
css: styles?.trackLayout,
|
|
91
107
|
children: [_jsx("progress", {
|
|
92
|
-
css: styles
|
|
108
|
+
css: styles?.htmlProgress,
|
|
93
109
|
max: valueMax,
|
|
94
110
|
value: valueNow,
|
|
95
111
|
"aria-valuetext": valueText,
|
|
96
112
|
"aria-label": screenReaderLabel
|
|
97
113
|
}), _jsx("span", {
|
|
98
|
-
css: styles
|
|
114
|
+
css: styles?.track,
|
|
99
115
|
role: "presentation",
|
|
100
116
|
"aria-hidden": "true",
|
|
101
117
|
children: _jsx("span", {
|
|
102
|
-
css: styles
|
|
118
|
+
css: styles?.trackValue,
|
|
103
119
|
children: renderValueInside && value
|
|
104
120
|
})
|
|
105
121
|
})]
|
|
106
122
|
}), value && !renderValueInside && _jsx("span", {
|
|
107
|
-
css: styles
|
|
123
|
+
css: styles?.value,
|
|
108
124
|
"aria-hidden": "true",
|
|
109
125
|
children: value
|
|
110
126
|
})]
|
|
111
127
|
});
|
|
112
128
|
}
|
|
113
|
-
}
|
|
114
|
-
formatScreenReaderValue: ({
|
|
115
|
-
valueNow,
|
|
116
|
-
valueMax
|
|
117
|
-
}) => `${valueNow} / ${valueMax}`,
|
|
118
|
-
size: 'medium',
|
|
119
|
-
valueMax: 100,
|
|
120
|
-
valueNow: 0,
|
|
121
|
-
as: 'div',
|
|
122
|
-
color: 'primary',
|
|
123
|
-
shouldAnimate: false,
|
|
124
|
-
// default to showing `success` color on completion
|
|
125
|
-
meterColor: ({
|
|
126
|
-
valueNow,
|
|
127
|
-
valueMax
|
|
128
|
-
}) => valueNow / valueMax >= 1 ? 'success' : 'brand'
|
|
129
|
-
}, _ProgressBar)) || _class);
|
|
129
|
+
}) || _class);
|
|
130
130
|
export default ProgressBar;
|
|
131
131
|
export { ProgressBar };
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
* @return {Object} The final style object, which will be used in the component
|
|
34
34
|
*/
|
|
35
35
|
const generateStyle = (componentTheme, props) => {
|
|
36
|
-
const
|
|
37
|
-
valueNow =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
const {
|
|
37
|
+
valueNow = 0,
|
|
38
|
+
valueMax = 100,
|
|
39
|
+
size,
|
|
40
|
+
color,
|
|
41
|
+
meterColor,
|
|
42
|
+
shouldAnimate
|
|
43
|
+
} = props;
|
|
44
44
|
const meterColorClassName = typeof meterColor === 'function' ? meterColor({
|
|
45
45
|
valueNow,
|
|
46
46
|
valueMax
|
|
@@ -28,61 +28,62 @@
|
|
|
28
28
|
* @return {Object} The final theme object with the overrides and component variables
|
|
29
29
|
*/
|
|
30
30
|
const generateComponentTheme = theme => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
colors
|
|
34
|
-
spacing
|
|
35
|
-
typography
|
|
36
|
-
themeName
|
|
31
|
+
const {
|
|
32
|
+
borders,
|
|
33
|
+
colors,
|
|
34
|
+
spacing,
|
|
35
|
+
typography,
|
|
36
|
+
key: themeName
|
|
37
|
+
} = theme;
|
|
37
38
|
const themeSpecificStyle = {
|
|
38
39
|
canvas: {
|
|
39
40
|
meterColorBrand: theme['ic-brand-primary']
|
|
40
41
|
},
|
|
41
42
|
'canvas-high-contrast': {
|
|
42
|
-
meterColorBrandInverse: colors
|
|
43
|
-
meterColorSuccessInverse: colors
|
|
44
|
-
meterColorInfoInverse: colors
|
|
45
|
-
meterColorAlertInverse: colors
|
|
46
|
-
meterColorWarningInverse: colors
|
|
47
|
-
meterColorDangerInverse: colors
|
|
43
|
+
meterColorBrandInverse: colors?.contrasts?.white1010,
|
|
44
|
+
meterColorSuccessInverse: colors?.contrasts?.white1010,
|
|
45
|
+
meterColorInfoInverse: colors?.contrasts?.white1010,
|
|
46
|
+
meterColorAlertInverse: colors?.contrasts?.white1010,
|
|
47
|
+
meterColorWarningInverse: colors?.contrasts?.white1010,
|
|
48
|
+
meterColorDangerInverse: colors?.contrasts?.white1010
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
51
|
const componentVariables = {
|
|
51
|
-
fontFamily: typography
|
|
52
|
-
fontWeight: typography
|
|
53
|
-
lineHeight: typography
|
|
54
|
-
fontSize: typography
|
|
55
|
-
xSmallHeight: spacing
|
|
56
|
-
xSmallValueFontSize: typography
|
|
52
|
+
fontFamily: typography?.fontFamily,
|
|
53
|
+
fontWeight: typography?.fontWeightNormal,
|
|
54
|
+
lineHeight: typography?.lineHeightCondensed,
|
|
55
|
+
fontSize: typography?.fontSizeMedium,
|
|
56
|
+
xSmallHeight: spacing?.xSmall,
|
|
57
|
+
xSmallValueFontSize: typography?.fontSizeXSmall,
|
|
57
58
|
smallHeight: '1.125rem',
|
|
58
59
|
// product design wants = 18px
|
|
59
|
-
smallValueFontSize: typography
|
|
60
|
-
mediumHeight: spacing
|
|
61
|
-
mediumValueFontSize: typography
|
|
62
|
-
largeHeight: spacing
|
|
63
|
-
largeValueFontSize: typography
|
|
64
|
-
valuePadding: `${spacing
|
|
60
|
+
smallValueFontSize: typography?.fontSizeXSmall,
|
|
61
|
+
mediumHeight: spacing?.medium,
|
|
62
|
+
mediumValueFontSize: typography?.fontSizeSmall,
|
|
63
|
+
largeHeight: spacing?.large,
|
|
64
|
+
largeValueFontSize: typography?.fontSizeMedium,
|
|
65
|
+
valuePadding: `${spacing?.xxSmall}`,
|
|
65
66
|
// variables are split out for inverse to allow
|
|
66
67
|
// color value changes for inverse-high-constrast
|
|
67
|
-
meterColorBrand: colors
|
|
68
|
-
meterColorBrandInverse: colors
|
|
69
|
-
meterColorInfo: colors
|
|
70
|
-
meterColorInfoInverse: colors
|
|
71
|
-
meterColorSuccess: colors
|
|
72
|
-
meterColorSuccessInverse: colors
|
|
73
|
-
meterColorDanger: colors
|
|
74
|
-
meterColorDangerInverse: colors
|
|
75
|
-
meterColorAlert: colors
|
|
76
|
-
meterColorAlertInverse: colors
|
|
77
|
-
meterColorWarning: colors
|
|
78
|
-
meterColorWarningInverse: colors
|
|
79
|
-
meterBorderWidthInverse: borders
|
|
68
|
+
meterColorBrand: colors?.contrasts?.blue4570,
|
|
69
|
+
meterColorBrandInverse: colors?.contrasts?.blue4570,
|
|
70
|
+
meterColorInfo: colors?.contrasts?.blue4570,
|
|
71
|
+
meterColorInfoInverse: colors?.contrasts?.blue4570,
|
|
72
|
+
meterColorSuccess: colors?.contrasts?.green4570,
|
|
73
|
+
meterColorSuccessInverse: colors?.contrasts?.green4570,
|
|
74
|
+
meterColorDanger: colors?.contrasts?.red4570,
|
|
75
|
+
meterColorDangerInverse: colors?.contrasts?.red4570,
|
|
76
|
+
meterColorAlert: colors?.contrasts?.blue4570,
|
|
77
|
+
meterColorAlertInverse: colors?.contrasts?.blue4570,
|
|
78
|
+
meterColorWarning: colors?.contrasts?.orange4570,
|
|
79
|
+
meterColorWarningInverse: colors?.contrasts?.orange4570,
|
|
80
|
+
meterBorderWidthInverse: borders?.widthSmall,
|
|
80
81
|
meterBorderColorInverse: 'transparent',
|
|
81
|
-
trackColor: colors
|
|
82
|
+
trackColor: colors?.contrasts?.white1010,
|
|
82
83
|
trackColorInverse: 'transparent',
|
|
83
|
-
trackBottomBorderWidth: borders
|
|
84
|
-
trackBottomBorderColor: colors
|
|
85
|
-
trackBottomBorderColorInverse: colors
|
|
84
|
+
trackBottomBorderWidth: borders?.widthSmall,
|
|
85
|
+
trackBottomBorderColor: colors?.contrasts?.grey3045,
|
|
86
|
+
trackBottomBorderColorInverse: colors?.contrasts?.white1010,
|
|
86
87
|
borderRadius: '0px'
|
|
87
88
|
};
|
|
88
89
|
return {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const _excluded = ["renderValue", "formatScreenReaderValue", "valueNow", "valueMax", "screenReaderLabel", "size", "color", "meterColor", "renderValueInside", "styles"];
|
|
3
|
-
var _dec, _class, _ProgressBar;
|
|
1
|
+
var _dec, _class;
|
|
4
2
|
/*
|
|
5
3
|
* The MIT License (MIT)
|
|
6
4
|
*
|
|
@@ -37,43 +35,61 @@ category: components
|
|
|
37
35
|
---
|
|
38
36
|
**/
|
|
39
37
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
40
|
-
let ProgressBar = (_dec = withStyle(generateStyle), _dec(_class =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
let ProgressBar = (_dec = withStyle(generateStyle), _dec(_class = class ProgressBar extends Component {
|
|
39
|
+
static displayName = "ProgressBar";
|
|
40
|
+
static componentId = 'ProgressBar';
|
|
41
|
+
static allowedProps = allowedProps;
|
|
42
|
+
static defaultProps = {
|
|
43
|
+
formatScreenReaderValue: ({
|
|
44
|
+
valueNow,
|
|
45
|
+
valueMax
|
|
46
|
+
}) => `${valueNow} / ${valueMax}`,
|
|
47
|
+
size: 'medium',
|
|
48
|
+
valueMax: 100,
|
|
49
|
+
valueNow: 0,
|
|
50
|
+
as: 'div',
|
|
51
|
+
color: 'primary',
|
|
52
|
+
shouldAnimate: false,
|
|
53
|
+
// default to showing `success` color on completion
|
|
54
|
+
meterColor: ({
|
|
55
|
+
valueNow,
|
|
56
|
+
valueMax
|
|
57
|
+
}) => valueNow / valueMax >= 1 ? 'success' : 'brand'
|
|
58
|
+
};
|
|
59
|
+
ref = null;
|
|
52
60
|
componentDidMount() {
|
|
53
|
-
|
|
54
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
61
|
+
this.props.makeStyles?.();
|
|
55
62
|
}
|
|
56
63
|
componentDidUpdate() {
|
|
57
|
-
|
|
58
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
64
|
+
this.props.makeStyles?.();
|
|
59
65
|
}
|
|
66
|
+
handleRef = el => {
|
|
67
|
+
const {
|
|
68
|
+
elementRef
|
|
69
|
+
} = this.props;
|
|
70
|
+
this.ref = el;
|
|
71
|
+
if (typeof elementRef === 'function') {
|
|
72
|
+
elementRef(el);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
60
75
|
render() {
|
|
61
|
-
const
|
|
62
|
-
renderValue
|
|
63
|
-
formatScreenReaderValue
|
|
64
|
-
valueNow
|
|
65
|
-
valueMax
|
|
66
|
-
screenReaderLabel
|
|
67
|
-
size
|
|
68
|
-
color
|
|
69
|
-
meterColor
|
|
70
|
-
renderValueInside
|
|
71
|
-
styles
|
|
72
|
-
props
|
|
76
|
+
const {
|
|
77
|
+
renderValue,
|
|
78
|
+
formatScreenReaderValue,
|
|
79
|
+
valueNow,
|
|
80
|
+
valueMax,
|
|
81
|
+
screenReaderLabel,
|
|
82
|
+
size,
|
|
83
|
+
color,
|
|
84
|
+
meterColor,
|
|
85
|
+
renderValueInside,
|
|
86
|
+
styles,
|
|
87
|
+
...props
|
|
88
|
+
} = this.props;
|
|
73
89
|
const valueText = typeof formatScreenReaderValue === 'function' ? formatScreenReaderValue({
|
|
74
90
|
valueNow: valueNow,
|
|
75
91
|
valueMax: valueMax
|
|
76
|
-
}) :
|
|
92
|
+
}) : undefined;
|
|
77
93
|
const value = callRenderProp(renderValue, {
|
|
78
94
|
valueNow: valueNow,
|
|
79
95
|
valueMax: valueMax
|
|
@@ -81,50 +97,34 @@ let ProgressBar = (_dec = withStyle(generateStyle), _dec(_class = (_ProgressBar
|
|
|
81
97
|
return _jsxs(View, {
|
|
82
98
|
...passthroughProps(props),
|
|
83
99
|
as: this.props.as,
|
|
84
|
-
css: styles
|
|
100
|
+
css: styles?.progressBar,
|
|
85
101
|
margin: this.props.margin,
|
|
86
102
|
elementRef: this.handleRef,
|
|
87
103
|
"data-cid": "ProgressBar",
|
|
88
104
|
children: [_jsxs("span", {
|
|
89
|
-
css: styles
|
|
105
|
+
css: styles?.trackLayout,
|
|
90
106
|
children: [_jsx("progress", {
|
|
91
|
-
css: styles
|
|
107
|
+
css: styles?.htmlProgress,
|
|
92
108
|
max: valueMax,
|
|
93
109
|
value: valueNow,
|
|
94
110
|
"aria-valuetext": valueText,
|
|
95
111
|
"aria-label": screenReaderLabel
|
|
96
112
|
}), _jsx("span", {
|
|
97
|
-
css: styles
|
|
113
|
+
css: styles?.track,
|
|
98
114
|
role: "presentation",
|
|
99
115
|
"aria-hidden": "true",
|
|
100
116
|
children: _jsx("span", {
|
|
101
|
-
css: styles
|
|
117
|
+
css: styles?.trackValue,
|
|
102
118
|
children: renderValueInside && value
|
|
103
119
|
})
|
|
104
120
|
})]
|
|
105
121
|
}), value && !renderValueInside && _jsx("span", {
|
|
106
|
-
css: styles
|
|
122
|
+
css: styles?.value,
|
|
107
123
|
"aria-hidden": "true",
|
|
108
124
|
children: value
|
|
109
125
|
})]
|
|
110
126
|
});
|
|
111
127
|
}
|
|
112
|
-
}
|
|
113
|
-
formatScreenReaderValue: ({
|
|
114
|
-
valueNow,
|
|
115
|
-
valueMax
|
|
116
|
-
}) => `${valueNow} / ${valueMax}`,
|
|
117
|
-
size: 'medium',
|
|
118
|
-
valueMax: 100,
|
|
119
|
-
valueNow: 0,
|
|
120
|
-
as: 'div',
|
|
121
|
-
color: 'primary',
|
|
122
|
-
shouldAnimate: false,
|
|
123
|
-
// default to showing `success` color on completion
|
|
124
|
-
meterColor: ({
|
|
125
|
-
valueNow,
|
|
126
|
-
valueMax
|
|
127
|
-
}) => valueNow / valueMax >= 1 ? 'success' : 'brand'
|
|
128
|
-
}, _ProgressBar)) || _class);
|
|
128
|
+
}) || _class);
|
|
129
129
|
export default ProgressBar;
|
|
130
130
|
export { ProgressBar };
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
* @return {Object} The final style object, which will be used in the component
|
|
34
34
|
*/
|
|
35
35
|
const generateStyle = (componentTheme, props, _sharedTokens) => {
|
|
36
|
-
const
|
|
37
|
-
valueNow =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
const {
|
|
37
|
+
valueNow = 0,
|
|
38
|
+
valueMax = 100,
|
|
39
|
+
size,
|
|
40
|
+
color,
|
|
41
|
+
meterColor,
|
|
42
|
+
shouldAnimate
|
|
43
|
+
} = props;
|
|
44
44
|
const meterColorClassName = typeof meterColor === 'function' ? meterColor({
|
|
45
45
|
valueNow,
|
|
46
46
|
valueMax
|