@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.ProgressCircle = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
8
|
var _react = require("react");
|
|
10
9
|
var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
|
|
11
10
|
var _v11_ = require("@instructure/ui-view/v11_6");
|
|
@@ -16,8 +15,7 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
16
15
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
17
16
|
var _props = require("./props");
|
|
18
17
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
19
|
-
|
|
20
|
-
var _dec, _class, _ProgressCircle;
|
|
18
|
+
var _dec, _class;
|
|
21
19
|
/*
|
|
22
20
|
* The MIT License (MIT)
|
|
23
21
|
*
|
|
@@ -46,29 +44,50 @@ var _dec, _class, _ProgressCircle;
|
|
|
46
44
|
category: components
|
|
47
45
|
---
|
|
48
46
|
**/
|
|
49
|
-
let ProgressCircle = exports.ProgressCircle = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class =
|
|
47
|
+
let ProgressCircle = exports.ProgressCircle = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class ProgressCircle extends _react.Component {
|
|
48
|
+
static displayName = "ProgressCircle";
|
|
49
|
+
static componentId = 'ProgressCircle';
|
|
50
|
+
static allowedProps = _props.allowedProps;
|
|
51
|
+
static defaultProps = {
|
|
52
|
+
formatScreenReaderValue: ({
|
|
53
|
+
valueNow,
|
|
54
|
+
valueMax
|
|
55
|
+
}) => `${valueNow} / ${valueMax}`,
|
|
56
|
+
size: 'medium',
|
|
57
|
+
valueMax: 100,
|
|
58
|
+
valueNow: 0,
|
|
59
|
+
as: 'div',
|
|
60
|
+
color: 'primary',
|
|
61
|
+
shouldAnimateOnMount: false,
|
|
62
|
+
// default to showing `success` color on completion
|
|
63
|
+
meterColor: ({
|
|
64
|
+
valueNow,
|
|
65
|
+
valueMax
|
|
66
|
+
}) => valueNow / valueMax >= 1 ? 'success' : 'brand'
|
|
67
|
+
};
|
|
68
|
+
_timeouts = [];
|
|
69
|
+
ref = null;
|
|
50
70
|
constructor(props) {
|
|
51
71
|
super(props);
|
|
52
|
-
this._timeouts = [];
|
|
53
|
-
this.ref = null;
|
|
54
|
-
this.handleRef = el => {
|
|
55
|
-
const elementRef = this.props.elementRef;
|
|
56
|
-
this.ref = el;
|
|
57
|
-
if (typeof elementRef === 'function') {
|
|
58
|
-
elementRef(el);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
72
|
this.state = {
|
|
62
73
|
shouldAnimateOnMount: props.shouldAnimateOnMount
|
|
63
74
|
};
|
|
64
75
|
}
|
|
76
|
+
handleRef = el => {
|
|
77
|
+
const {
|
|
78
|
+
elementRef
|
|
79
|
+
} = this.props;
|
|
80
|
+
this.ref = el;
|
|
81
|
+
if (typeof elementRef === 'function') {
|
|
82
|
+
elementRef(el);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
65
85
|
get makeStylesVariables() {
|
|
66
86
|
return {
|
|
67
87
|
shouldAnimateOnMount: this.state.shouldAnimateOnMount
|
|
68
88
|
};
|
|
69
89
|
}
|
|
70
90
|
componentDidMount() {
|
|
71
|
-
var _this$props$makeStyle, _this$props;
|
|
72
91
|
if (this.state.shouldAnimateOnMount) {
|
|
73
92
|
this._timeouts.push(setTimeout(() => {
|
|
74
93
|
this.setState({
|
|
@@ -76,32 +95,31 @@ let ProgressCircle = exports.ProgressCircle = (_dec = (0, _emotion.withStyleLega
|
|
|
76
95
|
});
|
|
77
96
|
}, this.props.animationDelay || 500));
|
|
78
97
|
}
|
|
79
|
-
|
|
98
|
+
this.props.makeStyles?.(this.makeStylesVariables);
|
|
80
99
|
}
|
|
81
100
|
componentDidUpdate() {
|
|
82
|
-
|
|
83
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStylesVariables);
|
|
101
|
+
this.props.makeStyles?.(this.makeStylesVariables);
|
|
84
102
|
}
|
|
85
103
|
componentWillUnmount() {
|
|
86
104
|
this._timeouts.forEach(timeout => clearTimeout(timeout));
|
|
87
105
|
}
|
|
88
106
|
render() {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
107
|
+
const {
|
|
108
|
+
color,
|
|
109
|
+
renderValue,
|
|
110
|
+
formatScreenReaderValue,
|
|
111
|
+
meterColor,
|
|
112
|
+
valueNow,
|
|
113
|
+
valueMax,
|
|
114
|
+
screenReaderLabel,
|
|
115
|
+
size,
|
|
116
|
+
styles,
|
|
117
|
+
...props
|
|
118
|
+
} = this.props;
|
|
101
119
|
const valueText = typeof formatScreenReaderValue === 'function' ? formatScreenReaderValue({
|
|
102
120
|
valueNow: valueNow,
|
|
103
121
|
valueMax: valueMax
|
|
104
|
-
}) :
|
|
122
|
+
}) : undefined;
|
|
105
123
|
// consolidating the label and aria-valuetext to put in aria-label because
|
|
106
124
|
// NVDA does not read aria-valuetext: https://github.com/nvaccess/nvda/issues/913
|
|
107
125
|
// But leaving aria-valuetext because JAWS ignores aria-label
|
|
@@ -111,13 +129,13 @@ let ProgressCircle = exports.ProgressCircle = (_dec = (0, _emotion.withStyleLega
|
|
|
111
129
|
valueMax: valueMax
|
|
112
130
|
});
|
|
113
131
|
const style = {
|
|
114
|
-
strokeDashoffset: `${styles
|
|
132
|
+
strokeDashoffset: `${styles?.dashOffset}em`
|
|
115
133
|
};
|
|
116
134
|
return (0, _jsxRuntime.jsxs)(_v11_.View, {
|
|
117
135
|
...(0, _passthroughProps.passthroughProps)(props),
|
|
118
136
|
as: this.props.as,
|
|
119
137
|
elementRef: this.handleRef,
|
|
120
|
-
css: styles
|
|
138
|
+
css: styles?.progressCircle,
|
|
121
139
|
margin: this.props.margin,
|
|
122
140
|
"data-cid": "ProgressCircle",
|
|
123
141
|
children: [(0, _jsxRuntime.jsx)(_ScreenReaderContent.ScreenReaderContent, {
|
|
@@ -127,54 +145,38 @@ let ProgressCircle = exports.ProgressCircle = (_dec = (0, _emotion.withStyleLega
|
|
|
127
145
|
"aria-valuetext": labelAndValueText
|
|
128
146
|
})
|
|
129
147
|
}), value && (0, _jsxRuntime.jsx)("span", {
|
|
130
|
-
css: styles
|
|
148
|
+
css: styles?.center,
|
|
131
149
|
"aria-hidden": "true",
|
|
132
150
|
children: (0, _jsxRuntime.jsx)("span", {
|
|
133
|
-
css: styles
|
|
151
|
+
css: styles?.value,
|
|
134
152
|
children: value
|
|
135
153
|
})
|
|
136
154
|
}), (0, _jsxRuntime.jsxs)("svg", {
|
|
137
|
-
css: styles
|
|
155
|
+
css: styles?.circle,
|
|
138
156
|
role: "presentation",
|
|
139
157
|
focusable: "false",
|
|
140
158
|
children: [(0, _jsxRuntime.jsx)("circle", {
|
|
141
|
-
css: styles
|
|
159
|
+
css: styles?.track,
|
|
142
160
|
role: "presentation",
|
|
143
161
|
cx: "50%",
|
|
144
162
|
cy: "50%",
|
|
145
|
-
r: styles
|
|
163
|
+
r: styles?.radii?.radius
|
|
146
164
|
}), (0, _jsxRuntime.jsx)("circle", {
|
|
147
|
-
css: styles
|
|
165
|
+
css: styles?.border,
|
|
148
166
|
role: "presentation",
|
|
149
167
|
cx: "50%",
|
|
150
168
|
cy: "50%",
|
|
151
|
-
r: styles
|
|
169
|
+
r: styles?.radii?.borderOffsetRadius
|
|
152
170
|
}), (0, _jsxRuntime.jsx)("circle", {
|
|
153
|
-
css: styles
|
|
171
|
+
css: styles?.meter,
|
|
154
172
|
role: "presentation",
|
|
155
173
|
style: style,
|
|
156
174
|
cx: "50%",
|
|
157
175
|
cy: "50%",
|
|
158
|
-
r: styles
|
|
176
|
+
r: styles?.radii?.radius
|
|
159
177
|
})]
|
|
160
178
|
})]
|
|
161
179
|
});
|
|
162
180
|
}
|
|
163
|
-
}
|
|
164
|
-
formatScreenReaderValue: ({
|
|
165
|
-
valueNow,
|
|
166
|
-
valueMax
|
|
167
|
-
}) => `${valueNow} / ${valueMax}`,
|
|
168
|
-
size: 'medium',
|
|
169
|
-
valueMax: 100,
|
|
170
|
-
valueNow: 0,
|
|
171
|
-
as: 'div',
|
|
172
|
-
color: 'primary',
|
|
173
|
-
shouldAnimateOnMount: false,
|
|
174
|
-
// default to showing `success` color on completion
|
|
175
|
-
meterColor: ({
|
|
176
|
-
valueNow,
|
|
177
|
-
valueMax
|
|
178
|
-
}) => valueNow / valueMax >= 1 ? 'success' : 'brand'
|
|
179
|
-
}, _ProgressCircle)) || _class);
|
|
181
|
+
}) || _class);
|
|
180
182
|
var _default = exports.default = ProgressCircle;
|
|
@@ -39,14 +39,16 @@ 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, state) => {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
valueNow =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
42
|
+
const {
|
|
43
|
+
size,
|
|
44
|
+
color,
|
|
45
|
+
meterColor,
|
|
46
|
+
valueNow = 0,
|
|
47
|
+
valueMax = 100
|
|
48
|
+
} = props;
|
|
49
|
+
const {
|
|
50
|
+
shouldAnimateOnMount
|
|
51
|
+
} = state;
|
|
50
52
|
const getMeterColorClassName = typeof meterColor === 'function' ? meterColor({
|
|
51
53
|
valueNow,
|
|
52
54
|
valueMax
|
|
@@ -70,28 +70,29 @@ const transform = function (s) {
|
|
|
70
70
|
* @return {Object} The final theme object with the overrides and component variables
|
|
71
71
|
*/
|
|
72
72
|
const generateComponentTheme = theme => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
typography
|
|
76
|
-
themeName
|
|
73
|
+
const {
|
|
74
|
+
colors,
|
|
75
|
+
typography,
|
|
76
|
+
key: themeName
|
|
77
|
+
} = theme;
|
|
77
78
|
const themeSpecificStyle = {
|
|
78
79
|
canvas: {
|
|
79
80
|
color: theme['ic-brand-font-color-dark'],
|
|
80
81
|
meterColorBrand: theme['ic-brand-primary']
|
|
81
82
|
},
|
|
82
83
|
'canvas-high-contrast': {
|
|
83
|
-
meterColorBrandInverse: colors
|
|
84
|
-
meterColorSuccessInverse: colors
|
|
85
|
-
meterColorInfoInverse: colors
|
|
86
|
-
meterColorAlertInverse: colors
|
|
87
|
-
meterColorWarningInverse: colors
|
|
88
|
-
meterColorDangerInverse: colors
|
|
84
|
+
meterColorBrandInverse: colors?.contrasts?.white1010,
|
|
85
|
+
meterColorSuccessInverse: colors?.contrasts?.white1010,
|
|
86
|
+
meterColorInfoInverse: colors?.contrasts?.white1010,
|
|
87
|
+
meterColorAlertInverse: colors?.contrasts?.white1010,
|
|
88
|
+
meterColorWarningInverse: colors?.contrasts?.white1010,
|
|
89
|
+
meterColorDangerInverse: colors?.contrasts?.white1010
|
|
89
90
|
}
|
|
90
91
|
};
|
|
91
92
|
const componentVariables = {
|
|
92
|
-
fontFamily: typography
|
|
93
|
-
fontWeight: typography
|
|
94
|
-
lineHeight: typography
|
|
93
|
+
fontFamily: typography?.fontFamily,
|
|
94
|
+
fontWeight: typography?.fontWeightNormal,
|
|
95
|
+
lineHeight: typography?.lineHeightCondensed,
|
|
95
96
|
xSmallSize: `${size.xSmall}em`,
|
|
96
97
|
xSmallRadius: `${radius.xSmall}em`,
|
|
97
98
|
xSmallCircumference: `${circumference(radius.xSmall)}em`,
|
|
@@ -116,26 +117,26 @@ const generateComponentTheme = theme => {
|
|
|
116
117
|
largeTransform: `${transform(size.large)}em`,
|
|
117
118
|
largeStrokeWidth: `${strokeWidth.large}em`,
|
|
118
119
|
largeBorderOffset: `${borderOffsetRadius.large}em`,
|
|
119
|
-
color: colors
|
|
120
|
-
colorInverse: colors
|
|
121
|
-
trackColor: colors
|
|
120
|
+
color: colors?.contrasts?.grey125125,
|
|
121
|
+
colorInverse: colors?.contrasts?.white1010,
|
|
122
|
+
trackColor: colors?.contrasts?.white1010,
|
|
122
123
|
trackColorInverse: 'transparent',
|
|
123
|
-
trackBorderColor: colors
|
|
124
|
-
trackBorderColorInverse: colors
|
|
124
|
+
trackBorderColor: colors?.contrasts?.grey3045,
|
|
125
|
+
trackBorderColorInverse: colors?.contrasts?.white1010,
|
|
125
126
|
// variables are split out for inverse to allow
|
|
126
127
|
// color value changes for inverse-high-contrast
|
|
127
|
-
meterColorBrand: colors
|
|
128
|
-
meterColorBrandInverse: colors
|
|
129
|
-
meterColorInfo: colors
|
|
130
|
-
meterColorInfoInverse: colors
|
|
131
|
-
meterColorSuccess: colors
|
|
132
|
-
meterColorSuccessInverse: colors
|
|
133
|
-
meterColorDanger: colors
|
|
134
|
-
meterColorDangerInverse: colors
|
|
135
|
-
meterColorAlert: colors
|
|
136
|
-
meterColorAlertInverse: colors
|
|
137
|
-
meterColorWarning: colors
|
|
138
|
-
meterColorWarningInverse: colors
|
|
128
|
+
meterColorBrand: colors?.contrasts?.blue4570,
|
|
129
|
+
meterColorBrandInverse: colors?.contrasts?.blue4570,
|
|
130
|
+
meterColorInfo: colors?.contrasts?.blue4570,
|
|
131
|
+
meterColorInfoInverse: colors?.contrasts?.blue4570,
|
|
132
|
+
meterColorSuccess: colors?.contrasts?.green4570,
|
|
133
|
+
meterColorSuccessInverse: colors?.contrasts?.green4570,
|
|
134
|
+
meterColorDanger: colors?.contrasts?.red4570,
|
|
135
|
+
meterColorDangerInverse: colors?.contrasts?.red4570,
|
|
136
|
+
meterColorAlert: colors?.contrasts?.blue4570,
|
|
137
|
+
meterColorAlertInverse: colors?.contrasts?.blue4570,
|
|
138
|
+
meterColorWarning: colors?.contrasts?.orange4570,
|
|
139
|
+
meterColorWarningInverse: colors?.contrasts?.orange4570
|
|
139
140
|
};
|
|
140
141
|
return {
|
|
141
142
|
...componentVariables,
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.ProgressCircle = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
8
|
var _react = require("react");
|
|
10
9
|
var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
|
|
11
10
|
var _latest = require("@instructure/ui-view/latest");
|
|
@@ -15,8 +14,7 @@ var _emotion = require("@instructure/emotion");
|
|
|
15
14
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
16
15
|
var _props = require("./props");
|
|
17
16
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
18
|
-
|
|
19
|
-
var _dec, _class, _ProgressCircle;
|
|
17
|
+
var _dec, _class;
|
|
20
18
|
/*
|
|
21
19
|
* The MIT License (MIT)
|
|
22
20
|
*
|
|
@@ -45,29 +43,50 @@ var _dec, _class, _ProgressCircle;
|
|
|
45
43
|
category: components
|
|
46
44
|
---
|
|
47
45
|
**/
|
|
48
|
-
let ProgressCircle = exports.ProgressCircle = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class =
|
|
46
|
+
let ProgressCircle = exports.ProgressCircle = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = class ProgressCircle extends _react.Component {
|
|
47
|
+
static displayName = "ProgressCircle";
|
|
48
|
+
static componentId = 'ProgressCircle';
|
|
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
|
+
shouldAnimateOnMount: false,
|
|
61
|
+
// default to showing `success` color on completion
|
|
62
|
+
meterColor: ({
|
|
63
|
+
valueNow,
|
|
64
|
+
valueMax
|
|
65
|
+
}) => valueNow / valueMax >= 1 ? 'success' : 'brand'
|
|
66
|
+
};
|
|
67
|
+
_timeouts = [];
|
|
68
|
+
ref = null;
|
|
49
69
|
constructor(props) {
|
|
50
70
|
super(props);
|
|
51
|
-
this._timeouts = [];
|
|
52
|
-
this.ref = null;
|
|
53
|
-
this.handleRef = el => {
|
|
54
|
-
const elementRef = this.props.elementRef;
|
|
55
|
-
this.ref = el;
|
|
56
|
-
if (typeof elementRef === 'function') {
|
|
57
|
-
elementRef(el);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
71
|
this.state = {
|
|
61
72
|
shouldAnimateOnMount: props.shouldAnimateOnMount
|
|
62
73
|
};
|
|
63
74
|
}
|
|
75
|
+
handleRef = el => {
|
|
76
|
+
const {
|
|
77
|
+
elementRef
|
|
78
|
+
} = this.props;
|
|
79
|
+
this.ref = el;
|
|
80
|
+
if (typeof elementRef === 'function') {
|
|
81
|
+
elementRef(el);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
64
84
|
get makeStylesVariables() {
|
|
65
85
|
return {
|
|
66
86
|
shouldAnimateOnMount: this.state.shouldAnimateOnMount
|
|
67
87
|
};
|
|
68
88
|
}
|
|
69
89
|
componentDidMount() {
|
|
70
|
-
var _this$props$makeStyle, _this$props;
|
|
71
90
|
if (this.state.shouldAnimateOnMount) {
|
|
72
91
|
this._timeouts.push(setTimeout(() => {
|
|
73
92
|
this.setState({
|
|
@@ -75,32 +94,31 @@ let ProgressCircle = exports.ProgressCircle = (_dec = (0, _emotion.withStyle)(_s
|
|
|
75
94
|
});
|
|
76
95
|
}, this.props.animationDelay || 500));
|
|
77
96
|
}
|
|
78
|
-
|
|
97
|
+
this.props.makeStyles?.(this.makeStylesVariables);
|
|
79
98
|
}
|
|
80
99
|
componentDidUpdate() {
|
|
81
|
-
|
|
82
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStylesVariables);
|
|
100
|
+
this.props.makeStyles?.(this.makeStylesVariables);
|
|
83
101
|
}
|
|
84
102
|
componentWillUnmount() {
|
|
85
103
|
this._timeouts.forEach(timeout => clearTimeout(timeout));
|
|
86
104
|
}
|
|
87
105
|
render() {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
106
|
+
const {
|
|
107
|
+
color,
|
|
108
|
+
renderValue,
|
|
109
|
+
formatScreenReaderValue,
|
|
110
|
+
meterColor,
|
|
111
|
+
valueNow,
|
|
112
|
+
valueMax,
|
|
113
|
+
screenReaderLabel,
|
|
114
|
+
size,
|
|
115
|
+
styles,
|
|
116
|
+
...props
|
|
117
|
+
} = this.props;
|
|
100
118
|
const valueText = typeof formatScreenReaderValue === 'function' ? formatScreenReaderValue({
|
|
101
119
|
valueNow: valueNow,
|
|
102
120
|
valueMax: valueMax
|
|
103
|
-
}) :
|
|
121
|
+
}) : undefined;
|
|
104
122
|
// consolidating the label and aria-valuetext to put in aria-label because
|
|
105
123
|
// NVDA does not read aria-valuetext: https://github.com/nvaccess/nvda/issues/913
|
|
106
124
|
// But leaving aria-valuetext because JAWS ignores aria-label
|
|
@@ -110,13 +128,13 @@ let ProgressCircle = exports.ProgressCircle = (_dec = (0, _emotion.withStyle)(_s
|
|
|
110
128
|
valueMax: valueMax
|
|
111
129
|
});
|
|
112
130
|
const style = {
|
|
113
|
-
strokeDashoffset: `${styles
|
|
131
|
+
strokeDashoffset: `${styles?.dashOffset}em`
|
|
114
132
|
};
|
|
115
133
|
return (0, _jsxRuntime.jsxs)(_latest.View, {
|
|
116
134
|
...(0, _passthroughProps.passthroughProps)(props),
|
|
117
135
|
as: this.props.as,
|
|
118
136
|
elementRef: this.handleRef,
|
|
119
|
-
css: styles
|
|
137
|
+
css: styles?.progressCircle,
|
|
120
138
|
margin: this.props.margin,
|
|
121
139
|
"data-cid": "ProgressCircle",
|
|
122
140
|
children: [(0, _jsxRuntime.jsx)(_ScreenReaderContent.ScreenReaderContent, {
|
|
@@ -126,54 +144,38 @@ let ProgressCircle = exports.ProgressCircle = (_dec = (0, _emotion.withStyle)(_s
|
|
|
126
144
|
"aria-valuetext": labelAndValueText
|
|
127
145
|
})
|
|
128
146
|
}), value && (0, _jsxRuntime.jsx)("span", {
|
|
129
|
-
css: styles
|
|
147
|
+
css: styles?.center,
|
|
130
148
|
"aria-hidden": "true",
|
|
131
149
|
children: (0, _jsxRuntime.jsx)("span", {
|
|
132
|
-
css: styles
|
|
150
|
+
css: styles?.value,
|
|
133
151
|
children: value
|
|
134
152
|
})
|
|
135
153
|
}), (0, _jsxRuntime.jsxs)("svg", {
|
|
136
|
-
css: styles
|
|
154
|
+
css: styles?.circle,
|
|
137
155
|
role: "presentation",
|
|
138
156
|
focusable: "false",
|
|
139
157
|
children: [(0, _jsxRuntime.jsx)("circle", {
|
|
140
|
-
css: styles
|
|
158
|
+
css: styles?.track,
|
|
141
159
|
role: "presentation",
|
|
142
160
|
cx: "50%",
|
|
143
161
|
cy: "50%",
|
|
144
|
-
r: styles
|
|
162
|
+
r: styles?.radii?.radius
|
|
145
163
|
}), (0, _jsxRuntime.jsx)("circle", {
|
|
146
|
-
css: styles
|
|
164
|
+
css: styles?.border,
|
|
147
165
|
role: "presentation",
|
|
148
166
|
cx: "50%",
|
|
149
167
|
cy: "50%",
|
|
150
|
-
r: styles
|
|
168
|
+
r: styles?.radii?.borderOffsetRadius
|
|
151
169
|
}), (0, _jsxRuntime.jsx)("circle", {
|
|
152
|
-
css: styles
|
|
170
|
+
css: styles?.meter,
|
|
153
171
|
role: "presentation",
|
|
154
172
|
style: style,
|
|
155
173
|
cx: "50%",
|
|
156
174
|
cy: "50%",
|
|
157
|
-
r: styles
|
|
175
|
+
r: styles?.radii?.radius
|
|
158
176
|
})]
|
|
159
177
|
})]
|
|
160
178
|
});
|
|
161
179
|
}
|
|
162
|
-
}
|
|
163
|
-
formatScreenReaderValue: ({
|
|
164
|
-
valueNow,
|
|
165
|
-
valueMax
|
|
166
|
-
}) => `${valueNow} / ${valueMax}`,
|
|
167
|
-
size: 'medium',
|
|
168
|
-
valueMax: 100,
|
|
169
|
-
valueNow: 0,
|
|
170
|
-
as: 'div',
|
|
171
|
-
color: 'primary',
|
|
172
|
-
shouldAnimateOnMount: false,
|
|
173
|
-
// default to showing `success` color on completion
|
|
174
|
-
meterColor: ({
|
|
175
|
-
valueNow,
|
|
176
|
-
valueMax
|
|
177
|
-
}) => valueNow / valueMax >= 1 ? 'success' : 'brand'
|
|
178
|
-
}, _ProgressCircle)) || _class);
|
|
180
|
+
}) || _class);
|
|
179
181
|
var _default = exports.default = ProgressCircle;
|
|
@@ -39,14 +39,16 @@ 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, state) => {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
valueNow =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
42
|
+
const {
|
|
43
|
+
size,
|
|
44
|
+
color,
|
|
45
|
+
meterColor,
|
|
46
|
+
valueNow = 0,
|
|
47
|
+
valueMax = 100
|
|
48
|
+
} = props;
|
|
49
|
+
const {
|
|
50
|
+
shouldAnimateOnMount
|
|
51
|
+
} = state;
|
|
50
52
|
const getMeterColorClassName = typeof meterColor === 'function' ? meterColor({
|
|
51
53
|
valueNow,
|
|
52
54
|
valueMax
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-progress",
|
|
3
|
-
"version": "11.7.3-snapshot-
|
|
3
|
+
"version": "11.7.3-snapshot-26",
|
|
4
4
|
"description": "Styled HTML <progress /> elements for showing completion of a task",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -14,22 +14,22 @@
|
|
|
14
14
|
"bugs": "https://github.com/instructure/instructure-ui/issues",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@babel/runtime": "^7.
|
|
18
|
-
"@instructure/console": "11.7.3-snapshot-
|
|
19
|
-
"@instructure/
|
|
20
|
-
"@instructure/
|
|
21
|
-
"@instructure/
|
|
22
|
-
"@instructure/ui-color-utils": "11.7.3-snapshot-
|
|
23
|
-
"@instructure/ui-react-utils": "11.7.3-snapshot-
|
|
24
|
-
"@instructure/ui-
|
|
25
|
-
"@instructure/ui-
|
|
17
|
+
"@babel/runtime": "^7.29.2",
|
|
18
|
+
"@instructure/console": "11.7.3-snapshot-26",
|
|
19
|
+
"@instructure/shared-types": "11.7.3-snapshot-26",
|
|
20
|
+
"@instructure/emotion": "11.7.3-snapshot-26",
|
|
21
|
+
"@instructure/ui-a11y-content": "11.7.3-snapshot-26",
|
|
22
|
+
"@instructure/ui-color-utils": "11.7.3-snapshot-26",
|
|
23
|
+
"@instructure/ui-react-utils": "11.7.3-snapshot-26",
|
|
24
|
+
"@instructure/ui-themes": "11.7.3-snapshot-26",
|
|
25
|
+
"@instructure/ui-view": "11.7.3-snapshot-26"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@testing-library/jest-dom": "^6.6.3",
|
|
29
29
|
"@testing-library/react": "15.0.7",
|
|
30
30
|
"vitest": "^3.2.2",
|
|
31
|
-
"@instructure/ui-axe-check": "11.7.3-snapshot-
|
|
32
|
-
"@instructure/ui-babel-preset": "11.7.3-snapshot-
|
|
31
|
+
"@instructure/ui-axe-check": "11.7.3-snapshot-26",
|
|
32
|
+
"@instructure/ui-babel-preset": "11.7.3-snapshot-26"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": ">=18 <=19"
|