@instructure/ui-progress 11.7.3-snapshot-7 → 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
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.ProgressBar = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
8
|
var _react = require("react");
|
|
10
9
|
var _v11_ = require("@instructure/ui-view/v11_6");
|
|
11
10
|
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
@@ -15,8 +14,7 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
15
14
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
16
15
|
var _props = require("./props");
|
|
17
16
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
18
|
-
|
|
19
|
-
var _dec, _class, _ProgressBar;
|
|
17
|
+
var _dec, _class;
|
|
20
18
|
/*
|
|
21
19
|
* The MIT License (MIT)
|
|
22
20
|
*
|
|
@@ -45,43 +43,61 @@ var _dec, _class, _ProgressBar;
|
|
|
45
43
|
category: components
|
|
46
44
|
---
|
|
47
45
|
**/
|
|
48
|
-
let ProgressBar = exports.ProgressBar = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
let ProgressBar = exports.ProgressBar = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class ProgressBar extends _react.Component {
|
|
47
|
+
static displayName = "ProgressBar";
|
|
48
|
+
static componentId = 'ProgressBar';
|
|
49
|
+
static allowedProps = _props.allowedProps;
|
|
50
|
+
static defaultProps = {
|
|
51
|
+
formatScreenReaderValue: ({
|
|
52
|
+
valueNow,
|
|
53
|
+
valueMax
|
|
54
|
+
}) => `${valueNow} / ${valueMax}`,
|
|
55
|
+
size: 'medium',
|
|
56
|
+
valueMax: 100,
|
|
57
|
+
valueNow: 0,
|
|
58
|
+
as: 'div',
|
|
59
|
+
color: 'primary',
|
|
60
|
+
shouldAnimate: false,
|
|
61
|
+
// default to showing `success` color on completion
|
|
62
|
+
meterColor: ({
|
|
63
|
+
valueNow,
|
|
64
|
+
valueMax
|
|
65
|
+
}) => valueNow / valueMax >= 1 ? 'success' : 'brand'
|
|
66
|
+
};
|
|
67
|
+
ref = null;
|
|
60
68
|
componentDidMount() {
|
|
61
|
-
|
|
62
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
69
|
+
this.props.makeStyles?.();
|
|
63
70
|
}
|
|
64
71
|
componentDidUpdate() {
|
|
65
|
-
|
|
66
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
72
|
+
this.props.makeStyles?.();
|
|
67
73
|
}
|
|
74
|
+
handleRef = el => {
|
|
75
|
+
const {
|
|
76
|
+
elementRef
|
|
77
|
+
} = this.props;
|
|
78
|
+
this.ref = el;
|
|
79
|
+
if (typeof elementRef === 'function') {
|
|
80
|
+
elementRef(el);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
68
83
|
render() {
|
|
69
|
-
const
|
|
70
|
-
renderValue
|
|
71
|
-
formatScreenReaderValue
|
|
72
|
-
valueNow
|
|
73
|
-
valueMax
|
|
74
|
-
screenReaderLabel
|
|
75
|
-
size
|
|
76
|
-
color
|
|
77
|
-
meterColor
|
|
78
|
-
renderValueInside
|
|
79
|
-
styles
|
|
80
|
-
props
|
|
84
|
+
const {
|
|
85
|
+
renderValue,
|
|
86
|
+
formatScreenReaderValue,
|
|
87
|
+
valueNow,
|
|
88
|
+
valueMax,
|
|
89
|
+
screenReaderLabel,
|
|
90
|
+
size,
|
|
91
|
+
color,
|
|
92
|
+
meterColor,
|
|
93
|
+
renderValueInside,
|
|
94
|
+
styles,
|
|
95
|
+
...props
|
|
96
|
+
} = this.props;
|
|
81
97
|
const valueText = typeof formatScreenReaderValue === 'function' ? formatScreenReaderValue({
|
|
82
98
|
valueNow: valueNow,
|
|
83
99
|
valueMax: valueMax
|
|
84
|
-
}) :
|
|
100
|
+
}) : undefined;
|
|
85
101
|
const value = (0, _callRenderProp.callRenderProp)(renderValue, {
|
|
86
102
|
valueNow: valueNow,
|
|
87
103
|
valueMax: valueMax
|
|
@@ -89,49 +105,33 @@ let ProgressBar = exports.ProgressBar = (_dec = (0, _emotion.withStyleLegacy)(_s
|
|
|
89
105
|
return (0, _jsxRuntime.jsxs)(_v11_.View, {
|
|
90
106
|
...(0, _passthroughProps.passthroughProps)(props),
|
|
91
107
|
as: this.props.as,
|
|
92
|
-
css: styles
|
|
108
|
+
css: styles?.progressBar,
|
|
93
109
|
margin: this.props.margin,
|
|
94
110
|
elementRef: this.handleRef,
|
|
95
111
|
"data-cid": "ProgressBar",
|
|
96
112
|
children: [(0, _jsxRuntime.jsxs)("span", {
|
|
97
|
-
css: styles
|
|
113
|
+
css: styles?.trackLayout,
|
|
98
114
|
children: [(0, _jsxRuntime.jsx)("progress", {
|
|
99
|
-
css: styles
|
|
115
|
+
css: styles?.htmlProgress,
|
|
100
116
|
max: valueMax,
|
|
101
117
|
value: valueNow,
|
|
102
118
|
"aria-valuetext": valueText,
|
|
103
119
|
"aria-label": screenReaderLabel
|
|
104
120
|
}), (0, _jsxRuntime.jsx)("span", {
|
|
105
|
-
css: styles
|
|
121
|
+
css: styles?.track,
|
|
106
122
|
role: "presentation",
|
|
107
123
|
"aria-hidden": "true",
|
|
108
124
|
children: (0, _jsxRuntime.jsx)("span", {
|
|
109
|
-
css: styles
|
|
125
|
+
css: styles?.trackValue,
|
|
110
126
|
children: renderValueInside && value
|
|
111
127
|
})
|
|
112
128
|
})]
|
|
113
129
|
}), value && !renderValueInside && (0, _jsxRuntime.jsx)("span", {
|
|
114
|
-
css: styles
|
|
130
|
+
css: styles?.value,
|
|
115
131
|
"aria-hidden": "true",
|
|
116
132
|
children: value
|
|
117
133
|
})]
|
|
118
134
|
});
|
|
119
135
|
}
|
|
120
|
-
}
|
|
121
|
-
formatScreenReaderValue: ({
|
|
122
|
-
valueNow,
|
|
123
|
-
valueMax
|
|
124
|
-
}) => `${valueNow} / ${valueMax}`,
|
|
125
|
-
size: 'medium',
|
|
126
|
-
valueMax: 100,
|
|
127
|
-
valueNow: 0,
|
|
128
|
-
as: 'div',
|
|
129
|
-
color: 'primary',
|
|
130
|
-
shouldAnimate: false,
|
|
131
|
-
// default to showing `success` color on completion
|
|
132
|
-
meterColor: ({
|
|
133
|
-
valueNow,
|
|
134
|
-
valueMax
|
|
135
|
-
}) => valueNow / valueMax >= 1 ? 'success' : 'brand'
|
|
136
|
-
}, _ProgressBar)) || _class);
|
|
136
|
+
}) || _class);
|
|
137
137
|
var _default = exports.default = ProgressBar;
|
|
@@ -39,14 +39,14 @@ exports.default = void 0;
|
|
|
39
39
|
* @return {Object} The final style object, which will be used in the component
|
|
40
40
|
*/
|
|
41
41
|
const generateStyle = (componentTheme, props) => {
|
|
42
|
-
const
|
|
43
|
-
valueNow =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
const {
|
|
43
|
+
valueNow = 0,
|
|
44
|
+
valueMax = 100,
|
|
45
|
+
size,
|
|
46
|
+
color,
|
|
47
|
+
meterColor,
|
|
48
|
+
shouldAnimate
|
|
49
|
+
} = props;
|
|
50
50
|
const meterColorClassName = typeof meterColor === 'function' ? meterColor({
|
|
51
51
|
valueNow,
|
|
52
52
|
valueMax
|
|
@@ -34,61 +34,62 @@ exports.default = void 0;
|
|
|
34
34
|
* @return {Object} The final theme object with the overrides and component variables
|
|
35
35
|
*/
|
|
36
36
|
const generateComponentTheme = theme => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
colors
|
|
40
|
-
spacing
|
|
41
|
-
typography
|
|
42
|
-
themeName
|
|
37
|
+
const {
|
|
38
|
+
borders,
|
|
39
|
+
colors,
|
|
40
|
+
spacing,
|
|
41
|
+
typography,
|
|
42
|
+
key: themeName
|
|
43
|
+
} = theme;
|
|
43
44
|
const themeSpecificStyle = {
|
|
44
45
|
canvas: {
|
|
45
46
|
meterColorBrand: theme['ic-brand-primary']
|
|
46
47
|
},
|
|
47
48
|
'canvas-high-contrast': {
|
|
48
|
-
meterColorBrandInverse: colors
|
|
49
|
-
meterColorSuccessInverse: colors
|
|
50
|
-
meterColorInfoInverse: colors
|
|
51
|
-
meterColorAlertInverse: colors
|
|
52
|
-
meterColorWarningInverse: colors
|
|
53
|
-
meterColorDangerInverse: colors
|
|
49
|
+
meterColorBrandInverse: colors?.contrasts?.white1010,
|
|
50
|
+
meterColorSuccessInverse: colors?.contrasts?.white1010,
|
|
51
|
+
meterColorInfoInverse: colors?.contrasts?.white1010,
|
|
52
|
+
meterColorAlertInverse: colors?.contrasts?.white1010,
|
|
53
|
+
meterColorWarningInverse: colors?.contrasts?.white1010,
|
|
54
|
+
meterColorDangerInverse: colors?.contrasts?.white1010
|
|
54
55
|
}
|
|
55
56
|
};
|
|
56
57
|
const componentVariables = {
|
|
57
|
-
fontFamily: typography
|
|
58
|
-
fontWeight: typography
|
|
59
|
-
lineHeight: typography
|
|
60
|
-
fontSize: typography
|
|
61
|
-
xSmallHeight: spacing
|
|
62
|
-
xSmallValueFontSize: typography
|
|
58
|
+
fontFamily: typography?.fontFamily,
|
|
59
|
+
fontWeight: typography?.fontWeightNormal,
|
|
60
|
+
lineHeight: typography?.lineHeightCondensed,
|
|
61
|
+
fontSize: typography?.fontSizeMedium,
|
|
62
|
+
xSmallHeight: spacing?.xSmall,
|
|
63
|
+
xSmallValueFontSize: typography?.fontSizeXSmall,
|
|
63
64
|
smallHeight: '1.125rem',
|
|
64
65
|
// product design wants = 18px
|
|
65
|
-
smallValueFontSize: typography
|
|
66
|
-
mediumHeight: spacing
|
|
67
|
-
mediumValueFontSize: typography
|
|
68
|
-
largeHeight: spacing
|
|
69
|
-
largeValueFontSize: typography
|
|
70
|
-
valuePadding: `${spacing
|
|
66
|
+
smallValueFontSize: typography?.fontSizeXSmall,
|
|
67
|
+
mediumHeight: spacing?.medium,
|
|
68
|
+
mediumValueFontSize: typography?.fontSizeSmall,
|
|
69
|
+
largeHeight: spacing?.large,
|
|
70
|
+
largeValueFontSize: typography?.fontSizeMedium,
|
|
71
|
+
valuePadding: `${spacing?.xxSmall}`,
|
|
71
72
|
// variables are split out for inverse to allow
|
|
72
73
|
// color value changes for inverse-high-constrast
|
|
73
|
-
meterColorBrand: colors
|
|
74
|
-
meterColorBrandInverse: colors
|
|
75
|
-
meterColorInfo: colors
|
|
76
|
-
meterColorInfoInverse: colors
|
|
77
|
-
meterColorSuccess: colors
|
|
78
|
-
meterColorSuccessInverse: colors
|
|
79
|
-
meterColorDanger: colors
|
|
80
|
-
meterColorDangerInverse: colors
|
|
81
|
-
meterColorAlert: colors
|
|
82
|
-
meterColorAlertInverse: colors
|
|
83
|
-
meterColorWarning: colors
|
|
84
|
-
meterColorWarningInverse: colors
|
|
85
|
-
meterBorderWidthInverse: borders
|
|
74
|
+
meterColorBrand: colors?.contrasts?.blue4570,
|
|
75
|
+
meterColorBrandInverse: colors?.contrasts?.blue4570,
|
|
76
|
+
meterColorInfo: colors?.contrasts?.blue4570,
|
|
77
|
+
meterColorInfoInverse: colors?.contrasts?.blue4570,
|
|
78
|
+
meterColorSuccess: colors?.contrasts?.green4570,
|
|
79
|
+
meterColorSuccessInverse: colors?.contrasts?.green4570,
|
|
80
|
+
meterColorDanger: colors?.contrasts?.red4570,
|
|
81
|
+
meterColorDangerInverse: colors?.contrasts?.red4570,
|
|
82
|
+
meterColorAlert: colors?.contrasts?.blue4570,
|
|
83
|
+
meterColorAlertInverse: colors?.contrasts?.blue4570,
|
|
84
|
+
meterColorWarning: colors?.contrasts?.orange4570,
|
|
85
|
+
meterColorWarningInverse: colors?.contrasts?.orange4570,
|
|
86
|
+
meterBorderWidthInverse: borders?.widthSmall,
|
|
86
87
|
meterBorderColorInverse: 'transparent',
|
|
87
|
-
trackColor: colors
|
|
88
|
+
trackColor: colors?.contrasts?.white1010,
|
|
88
89
|
trackColorInverse: 'transparent',
|
|
89
|
-
trackBottomBorderWidth: borders
|
|
90
|
-
trackBottomBorderColor: colors
|
|
91
|
-
trackBottomBorderColorInverse: colors
|
|
90
|
+
trackBottomBorderWidth: borders?.widthSmall,
|
|
91
|
+
trackBottomBorderColor: colors?.contrasts?.grey3045,
|
|
92
|
+
trackBottomBorderColorInverse: colors?.contrasts?.white1010,
|
|
92
93
|
borderRadius: '0px'
|
|
93
94
|
};
|
|
94
95
|
return {
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.ProgressBar = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
8
|
var _react = require("react");
|
|
10
9
|
var _latest = require("@instructure/ui-view/latest");
|
|
11
10
|
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
@@ -14,8 +13,7 @@ var _emotion = require("@instructure/emotion");
|
|
|
14
13
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
15
14
|
var _props = require("./props");
|
|
16
15
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
17
|
-
|
|
18
|
-
var _dec, _class, _ProgressBar;
|
|
16
|
+
var _dec, _class;
|
|
19
17
|
/*
|
|
20
18
|
* The MIT License (MIT)
|
|
21
19
|
*
|
|
@@ -44,43 +42,61 @@ var _dec, _class, _ProgressBar;
|
|
|
44
42
|
category: components
|
|
45
43
|
---
|
|
46
44
|
**/
|
|
47
|
-
let ProgressBar = exports.ProgressBar = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
let ProgressBar = exports.ProgressBar = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = class ProgressBar extends _react.Component {
|
|
46
|
+
static displayName = "ProgressBar";
|
|
47
|
+
static componentId = 'ProgressBar';
|
|
48
|
+
static allowedProps = _props.allowedProps;
|
|
49
|
+
static defaultProps = {
|
|
50
|
+
formatScreenReaderValue: ({
|
|
51
|
+
valueNow,
|
|
52
|
+
valueMax
|
|
53
|
+
}) => `${valueNow} / ${valueMax}`,
|
|
54
|
+
size: 'medium',
|
|
55
|
+
valueMax: 100,
|
|
56
|
+
valueNow: 0,
|
|
57
|
+
as: 'div',
|
|
58
|
+
color: 'primary',
|
|
59
|
+
shouldAnimate: false,
|
|
60
|
+
// default to showing `success` color on completion
|
|
61
|
+
meterColor: ({
|
|
62
|
+
valueNow,
|
|
63
|
+
valueMax
|
|
64
|
+
}) => valueNow / valueMax >= 1 ? 'success' : 'brand'
|
|
65
|
+
};
|
|
66
|
+
ref = null;
|
|
59
67
|
componentDidMount() {
|
|
60
|
-
|
|
61
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
68
|
+
this.props.makeStyles?.();
|
|
62
69
|
}
|
|
63
70
|
componentDidUpdate() {
|
|
64
|
-
|
|
65
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
71
|
+
this.props.makeStyles?.();
|
|
66
72
|
}
|
|
73
|
+
handleRef = el => {
|
|
74
|
+
const {
|
|
75
|
+
elementRef
|
|
76
|
+
} = this.props;
|
|
77
|
+
this.ref = el;
|
|
78
|
+
if (typeof elementRef === 'function') {
|
|
79
|
+
elementRef(el);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
67
82
|
render() {
|
|
68
|
-
const
|
|
69
|
-
renderValue
|
|
70
|
-
formatScreenReaderValue
|
|
71
|
-
valueNow
|
|
72
|
-
valueMax
|
|
73
|
-
screenReaderLabel
|
|
74
|
-
size
|
|
75
|
-
color
|
|
76
|
-
meterColor
|
|
77
|
-
renderValueInside
|
|
78
|
-
styles
|
|
79
|
-
props
|
|
83
|
+
const {
|
|
84
|
+
renderValue,
|
|
85
|
+
formatScreenReaderValue,
|
|
86
|
+
valueNow,
|
|
87
|
+
valueMax,
|
|
88
|
+
screenReaderLabel,
|
|
89
|
+
size,
|
|
90
|
+
color,
|
|
91
|
+
meterColor,
|
|
92
|
+
renderValueInside,
|
|
93
|
+
styles,
|
|
94
|
+
...props
|
|
95
|
+
} = this.props;
|
|
80
96
|
const valueText = typeof formatScreenReaderValue === 'function' ? formatScreenReaderValue({
|
|
81
97
|
valueNow: valueNow,
|
|
82
98
|
valueMax: valueMax
|
|
83
|
-
}) :
|
|
99
|
+
}) : undefined;
|
|
84
100
|
const value = (0, _callRenderProp.callRenderProp)(renderValue, {
|
|
85
101
|
valueNow: valueNow,
|
|
86
102
|
valueMax: valueMax
|
|
@@ -88,49 +104,33 @@ let ProgressBar = exports.ProgressBar = (_dec = (0, _emotion.withStyle)(_styles.
|
|
|
88
104
|
return (0, _jsxRuntime.jsxs)(_latest.View, {
|
|
89
105
|
...(0, _passthroughProps.passthroughProps)(props),
|
|
90
106
|
as: this.props.as,
|
|
91
|
-
css: styles
|
|
107
|
+
css: styles?.progressBar,
|
|
92
108
|
margin: this.props.margin,
|
|
93
109
|
elementRef: this.handleRef,
|
|
94
110
|
"data-cid": "ProgressBar",
|
|
95
111
|
children: [(0, _jsxRuntime.jsxs)("span", {
|
|
96
|
-
css: styles
|
|
112
|
+
css: styles?.trackLayout,
|
|
97
113
|
children: [(0, _jsxRuntime.jsx)("progress", {
|
|
98
|
-
css: styles
|
|
114
|
+
css: styles?.htmlProgress,
|
|
99
115
|
max: valueMax,
|
|
100
116
|
value: valueNow,
|
|
101
117
|
"aria-valuetext": valueText,
|
|
102
118
|
"aria-label": screenReaderLabel
|
|
103
119
|
}), (0, _jsxRuntime.jsx)("span", {
|
|
104
|
-
css: styles
|
|
120
|
+
css: styles?.track,
|
|
105
121
|
role: "presentation",
|
|
106
122
|
"aria-hidden": "true",
|
|
107
123
|
children: (0, _jsxRuntime.jsx)("span", {
|
|
108
|
-
css: styles
|
|
124
|
+
css: styles?.trackValue,
|
|
109
125
|
children: renderValueInside && value
|
|
110
126
|
})
|
|
111
127
|
})]
|
|
112
128
|
}), value && !renderValueInside && (0, _jsxRuntime.jsx)("span", {
|
|
113
|
-
css: styles
|
|
129
|
+
css: styles?.value,
|
|
114
130
|
"aria-hidden": "true",
|
|
115
131
|
children: value
|
|
116
132
|
})]
|
|
117
133
|
});
|
|
118
134
|
}
|
|
119
|
-
}
|
|
120
|
-
formatScreenReaderValue: ({
|
|
121
|
-
valueNow,
|
|
122
|
-
valueMax
|
|
123
|
-
}) => `${valueNow} / ${valueMax}`,
|
|
124
|
-
size: 'medium',
|
|
125
|
-
valueMax: 100,
|
|
126
|
-
valueNow: 0,
|
|
127
|
-
as: 'div',
|
|
128
|
-
color: 'primary',
|
|
129
|
-
shouldAnimate: false,
|
|
130
|
-
// default to showing `success` color on completion
|
|
131
|
-
meterColor: ({
|
|
132
|
-
valueNow,
|
|
133
|
-
valueMax
|
|
134
|
-
}) => valueNow / valueMax >= 1 ? 'success' : 'brand'
|
|
135
|
-
}, _ProgressBar)) || _class);
|
|
135
|
+
}) || _class);
|
|
136
136
|
var _default = exports.default = ProgressBar;
|
|
@@ -39,14 +39,14 @@ exports.default = void 0;
|
|
|
39
39
|
* @return {Object} The final style object, which will be used in the component
|
|
40
40
|
*/
|
|
41
41
|
const generateStyle = (componentTheme, props, _sharedTokens) => {
|
|
42
|
-
const
|
|
43
|
-
valueNow =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
const {
|
|
43
|
+
valueNow = 0,
|
|
44
|
+
valueMax = 100,
|
|
45
|
+
size,
|
|
46
|
+
color,
|
|
47
|
+
meterColor,
|
|
48
|
+
shouldAnimate
|
|
49
|
+
} = props;
|
|
50
50
|
const meterColorClassName = typeof meterColor === 'function' ? meterColor({
|
|
51
51
|
valueNow,
|
|
52
52
|
valueMax
|