@instructure/ui-progress 11.7.10 → 11.7.11-pr-snapshot-1794841957152

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/es/ProgressBar/v1/index.js +87 -123
  3. package/es/ProgressBar/v1/props.js +15 -26
  4. package/es/ProgressBar/v1/styles.js +167 -209
  5. package/es/ProgressBar/v1/theme.js +55 -93
  6. package/es/ProgressBar/v2/index.js +87 -123
  7. package/es/ProgressBar/v2/props.js +15 -26
  8. package/es/ProgressBar/v2/styles.js +188 -235
  9. package/es/ProgressCircle/v1/index.js +125 -165
  10. package/es/ProgressCircle/v1/props.js +16 -26
  11. package/es/ProgressCircle/v1/styles.js +291 -348
  12. package/es/ProgressCircle/v1/theme.js +88 -128
  13. package/es/ProgressCircle/v2/index.js +125 -165
  14. package/es/ProgressCircle/v2/props.js +16 -26
  15. package/es/ProgressCircle/v2/styles.js +291 -348
  16. package/es/exports/a.js +1 -25
  17. package/es/exports/b.js +1 -25
  18. package/package.json +13 -19
  19. package/src/ProgressBar/v1/index.tsx +7 -2
  20. package/src/ProgressBar/v2/index.tsx +4 -2
  21. package/src/ProgressCircle/v1/index.tsx +7 -2
  22. package/src/ProgressCircle/v2/index.tsx +4 -2
  23. package/tsconfig.build.json +0 -1
  24. package/tsconfig.build.tsbuildinfo +1 -1
  25. package/types/ProgressBar/v1/index.d.ts +3 -1
  26. package/types/ProgressBar/v1/index.d.ts.map +1 -1
  27. package/types/ProgressBar/v2/index.d.ts +3 -1
  28. package/types/ProgressBar/v2/index.d.ts.map +1 -1
  29. package/types/ProgressCircle/v1/index.d.ts +3 -1
  30. package/types/ProgressCircle/v1/index.d.ts.map +1 -1
  31. package/types/ProgressCircle/v2/index.d.ts +3 -1
  32. package/types/ProgressCircle/v2/index.d.ts.map +1 -1
  33. package/lib/ProgressBar/v1/index.js +0 -136
  34. package/lib/ProgressBar/v1/props.js +0 -31
  35. package/lib/ProgressBar/v1/styles.js +0 -216
  36. package/lib/ProgressBar/v1/theme.js +0 -100
  37. package/lib/ProgressBar/v2/index.js +0 -135
  38. package/lib/ProgressBar/v2/props.js +0 -31
  39. package/lib/ProgressBar/v2/styles.js +0 -242
  40. package/lib/ProgressCircle/v1/index.js +0 -181
  41. package/lib/ProgressCircle/v1/props.js +0 -31
  42. package/lib/ProgressCircle/v1/styles.js +0 -357
  43. package/lib/ProgressCircle/v1/theme.js +0 -146
  44. package/lib/ProgressCircle/v2/index.js +0 -180
  45. package/lib/ProgressCircle/v2/props.js +0 -31
  46. package/lib/ProgressCircle/v2/styles.js +0 -357
  47. package/lib/exports/a.js +0 -19
  48. package/lib/exports/b.js +0 -19
  49. package/lib/package.json +0 -1
@@ -1,140 +1,100 @@
1
- /*
2
- * The MIT License (MIT)
3
- *
4
- * Copyright (c) 2015 - present Instructure, Inc.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
1
  const radius = {
26
- xSmall: 1,
27
- small: 1.8,
28
- medium: 2.75,
29
- large: 3.5
2
+ xSmall: 1,
3
+ small: 1.8,
4
+ medium: 2.75,
5
+ large: 3.5
30
6
  };
31
7
  const size = {
32
- xSmall: 3,
33
- small: 5,
34
- medium: 7,
35
- large: 9
8
+ xSmall: 3,
9
+ small: 5,
10
+ medium: 7,
11
+ large: 9
36
12
  };
37
13
  const strokeWidth = {
38
- xSmall: 0.185,
39
- small: 0.5,
40
- medium: 0.625,
41
- large: 0.875
14
+ xSmall: 0.185,
15
+ small: 0.5,
16
+ medium: 0.625,
17
+ large: 0.875
42
18
  };
43
-
44
- // Necessary to get the 1px border line to go "under" the meter
45
- // strokeWidth is divided in half because SVG strokeWidth is
46
- // centered along the path of the stroke, unlike CSS
47
19
  const borderWidth = 0.0625;
48
20
  const borderOffsetRadius = {
49
- xSmall: radius.xSmall - strokeWidth.xSmall / 2 + borderWidth,
50
- small: radius.small - strokeWidth.small / 2 + borderWidth,
51
- medium: radius.medium - strokeWidth.medium / 2 + borderWidth,
52
- large: radius.large - strokeWidth.large / 2 + borderWidth
21
+ xSmall: radius.xSmall - strokeWidth.xSmall / 2 + borderWidth,
22
+ small: radius.small - strokeWidth.small / 2 + borderWidth,
23
+ medium: radius.medium - strokeWidth.medium / 2 + borderWidth,
24
+ large: radius.large - strokeWidth.large / 2 + borderWidth
53
25
  };
54
- const circumference = function (r) {
55
- return (2 * Math.PI * r).toFixed(3);
26
+ const circumference = function(r) {
27
+ return (2 * Math.PI * r).toFixed(3);
56
28
  };
57
- const transform = function (s) {
58
- return s / 2;
29
+ const transform = function(s) {
30
+ return s / 2;
59
31
  };
60
-
61
- /**
62
- * Generates the theme object for the component from the theme and provided additional information
63
- * @param {Object} theme The actual theme object.
64
- * @return {Object} The final theme object with the overrides and component variables
65
- */
66
- const generateComponentTheme = theme => {
67
- const {
68
- colors,
69
- typography,
70
- key: themeName
71
- } = theme;
72
- const themeSpecificStyle = {
73
- canvas: {
74
- color: theme['ic-brand-font-color-dark'],
75
- meterColorBrand: theme['ic-brand-primary']
76
- },
77
- 'canvas-high-contrast': {
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
84
- }
85
- };
86
- const componentVariables = {
87
- fontFamily: typography?.fontFamily,
88
- fontWeight: typography?.fontWeightNormal,
89
- lineHeight: typography?.lineHeightCondensed,
90
- xSmallSize: `${size.xSmall}em`,
91
- xSmallRadius: `${radius.xSmall}em`,
92
- xSmallCircumference: `${circumference(radius.xSmall)}em`,
93
- xSmallTransform: `${transform(size.xSmall)}em`,
94
- xSmallStrokeWidth: `${strokeWidth.xSmall}em`,
95
- xSmallBorderOffset: `${borderOffsetRadius.xSmall}em`,
96
- smallSize: `${size.small}em`,
97
- smallRadius: `${radius.small}em`,
98
- smallCircumference: `${circumference(radius.small)}em`,
99
- smallTransform: `${transform(size.small)}em`,
100
- smallStrokeWidth: `${strokeWidth.small}em`,
101
- smallBorderOffset: `${borderOffsetRadius.small}em`,
102
- mediumSize: `${size.medium}em`,
103
- mediumRadius: `${radius.medium}em`,
104
- mediumCircumference: `${circumference(radius.medium)}em`,
105
- mediumTransform: `${transform(size.medium)}em`,
106
- mediumStrokeWidth: `${strokeWidth.medium}em`,
107
- mediumBorderOffset: `${borderOffsetRadius.medium}em`,
108
- largeSize: `${size.large}em`,
109
- largeRadius: `${radius.large}em`,
110
- largeCircumference: `${circumference(radius.large)}em`,
111
- largeTransform: `${transform(size.large)}em`,
112
- largeStrokeWidth: `${strokeWidth.large}em`,
113
- largeBorderOffset: `${borderOffsetRadius.large}em`,
114
- color: colors?.contrasts?.grey125125,
115
- colorInverse: colors?.contrasts?.white1010,
116
- trackColor: colors?.contrasts?.white1010,
117
- trackColorInverse: 'transparent',
118
- trackBorderColor: colors?.contrasts?.grey3045,
119
- trackBorderColorInverse: colors?.contrasts?.white1010,
120
- // variables are split out for inverse to allow
121
- // color value changes for inverse-high-contrast
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
134
- };
135
- return {
136
- ...componentVariables,
137
- ...themeSpecificStyle[themeName]
138
- };
32
+ const generateComponentTheme = (theme)=>{
33
+ const { colors, typography, key: themeName } = theme;
34
+ const themeSpecificStyle = {
35
+ canvas: {
36
+ color: theme['ic-brand-font-color-dark'],
37
+ meterColorBrand: theme['ic-brand-primary']
38
+ },
39
+ 'canvas-high-contrast': {
40
+ meterColorBrandInverse: colors?.contrasts?.white1010,
41
+ meterColorSuccessInverse: colors?.contrasts?.white1010,
42
+ meterColorInfoInverse: colors?.contrasts?.white1010,
43
+ meterColorAlertInverse: colors?.contrasts?.white1010,
44
+ meterColorWarningInverse: colors?.contrasts?.white1010,
45
+ meterColorDangerInverse: colors?.contrasts?.white1010
46
+ }
47
+ };
48
+ const componentVariables = {
49
+ fontFamily: typography?.fontFamily,
50
+ fontWeight: typography?.fontWeightNormal,
51
+ lineHeight: typography?.lineHeightCondensed,
52
+ xSmallSize: `${size.xSmall}em`,
53
+ xSmallRadius: `${radius.xSmall}em`,
54
+ xSmallCircumference: `${circumference(radius.xSmall)}em`,
55
+ xSmallTransform: `${transform(size.xSmall)}em`,
56
+ xSmallStrokeWidth: `${strokeWidth.xSmall}em`,
57
+ xSmallBorderOffset: `${borderOffsetRadius.xSmall}em`,
58
+ smallSize: `${size.small}em`,
59
+ smallRadius: `${radius.small}em`,
60
+ smallCircumference: `${circumference(radius.small)}em`,
61
+ smallTransform: `${transform(size.small)}em`,
62
+ smallStrokeWidth: `${strokeWidth.small}em`,
63
+ smallBorderOffset: `${borderOffsetRadius.small}em`,
64
+ mediumSize: `${size.medium}em`,
65
+ mediumRadius: `${radius.medium}em`,
66
+ mediumCircumference: `${circumference(radius.medium)}em`,
67
+ mediumTransform: `${transform(size.medium)}em`,
68
+ mediumStrokeWidth: `${strokeWidth.medium}em`,
69
+ mediumBorderOffset: `${borderOffsetRadius.medium}em`,
70
+ largeSize: `${size.large}em`,
71
+ largeRadius: `${radius.large}em`,
72
+ largeCircumference: `${circumference(radius.large)}em`,
73
+ largeTransform: `${transform(size.large)}em`,
74
+ largeStrokeWidth: `${strokeWidth.large}em`,
75
+ largeBorderOffset: `${borderOffsetRadius.large}em`,
76
+ color: colors?.contrasts?.grey125125,
77
+ colorInverse: colors?.contrasts?.white1010,
78
+ trackColor: colors?.contrasts?.white1010,
79
+ trackColorInverse: 'transparent',
80
+ trackBorderColor: colors?.contrasts?.grey3045,
81
+ trackBorderColorInverse: colors?.contrasts?.white1010,
82
+ meterColorBrand: colors?.contrasts?.blue4570,
83
+ meterColorBrandInverse: colors?.contrasts?.blue4570,
84
+ meterColorInfo: colors?.contrasts?.blue4570,
85
+ meterColorInfoInverse: colors?.contrasts?.blue4570,
86
+ meterColorSuccess: colors?.contrasts?.green4570,
87
+ meterColorSuccessInverse: colors?.contrasts?.green4570,
88
+ meterColorDanger: colors?.contrasts?.red4570,
89
+ meterColorDangerInverse: colors?.contrasts?.red4570,
90
+ meterColorAlert: colors?.contrasts?.blue4570,
91
+ meterColorAlertInverse: colors?.contrasts?.blue4570,
92
+ meterColorWarning: colors?.contrasts?.orange4570,
93
+ meterColorWarningInverse: colors?.contrasts?.orange4570
94
+ };
95
+ return {
96
+ ...componentVariables,
97
+ ...themeSpecificStyle[themeName]
98
+ };
139
99
  };
140
- export default generateComponentTheme;
100
+ export default generateComponentTheme;
@@ -1,28 +1,4 @@
1
- var _dec, _class;
2
- /*
3
- * The MIT License (MIT)
4
- *
5
- * Copyright (c) 2015 - present Instructure, Inc.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- * SOFTWARE.
24
- */
25
-
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
26
2
  import { Component } from 'react';
27
3
  import { ScreenReaderContent } from '@instructure/ui-a11y-content';
28
4
  import { View } from '@instructure/ui-view/latest';
@@ -30,147 +6,131 @@ import { callRenderProp, passthroughProps } from '@instructure/ui-react-utils';
30
6
  import { withStyleNew } from '@instructure/emotion';
31
7
  import generateStyle from './styles.js';
32
8
  import { allowedProps } from './props.js';
33
-
34
- /**
35
- ---
36
- category: components
37
- ---
38
- **/
39
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
40
- let ProgressCircle = (_dec = withStyleNew(generateStyle), _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;
63
- constructor(props) {
64
- super(props);
65
- this.state = {
66
- shouldAnimateOnMount: props.shouldAnimateOnMount
67
- };
68
- }
69
- handleRef = el => {
70
- const {
71
- elementRef
72
- } = this.props;
73
- this.ref = el;
74
- if (typeof elementRef === 'function') {
75
- elementRef(el);
9
+ export class ProgressCircleBase extends Component {
10
+ static{
11
+ this.displayName = 'ProgressCircle';
12
+ }
13
+ static{
14
+ this.componentId = 'ProgressCircle';
15
+ }
16
+ static{
17
+ this.allowedProps = allowedProps;
18
+ }
19
+ static{
20
+ this.defaultProps = {
21
+ formatScreenReaderValue: ({ valueNow, valueMax })=>`${valueNow} / ${valueMax}`,
22
+ size: 'medium',
23
+ valueMax: 100,
24
+ valueNow: 0,
25
+ as: 'div',
26
+ color: 'primary',
27
+ shouldAnimateOnMount: false,
28
+ meterColor: ({ valueNow, valueMax })=>valueNow / valueMax >= 1 ? 'success' : 'brand'
29
+ };
30
+ }
31
+ constructor(props){
32
+ super(props), this._timeouts = [], this.ref = null, this.handleRef = (el)=>{
33
+ const { elementRef } = this.props;
34
+ this.ref = el;
35
+ if (typeof elementRef === 'function') {
36
+ elementRef(el);
37
+ }
38
+ };
39
+ this.state = {
40
+ shouldAnimateOnMount: props.shouldAnimateOnMount
41
+ };
76
42
  }
77
- };
78
- get makeStylesVariables() {
79
- return {
80
- shouldAnimateOnMount: this.state.shouldAnimateOnMount
81
- };
82
- }
83
- componentDidMount() {
84
- if (this.state.shouldAnimateOnMount) {
85
- this._timeouts.push(setTimeout(() => {
86
- this.setState({
87
- shouldAnimateOnMount: false
43
+ get makeStylesVariables() {
44
+ return {
45
+ shouldAnimateOnMount: this.state.shouldAnimateOnMount
46
+ };
47
+ }
48
+ componentDidMount() {
49
+ if (this.state.shouldAnimateOnMount) {
50
+ this._timeouts.push(setTimeout(()=>{
51
+ this.setState({
52
+ shouldAnimateOnMount: false
53
+ });
54
+ }, this.props.animationDelay || 500));
55
+ }
56
+ this.props.makeStyles?.(this.makeStylesVariables);
57
+ }
58
+ componentDidUpdate() {
59
+ this.props.makeStyles?.(this.makeStylesVariables);
60
+ }
61
+ componentWillUnmount() {
62
+ this._timeouts.forEach((timeout)=>clearTimeout(timeout));
63
+ }
64
+ render() {
65
+ const { color, renderValue, formatScreenReaderValue, meterColor, valueNow, valueMax, screenReaderLabel, size, styles, ...props } = this.props;
66
+ const valueText = typeof formatScreenReaderValue === 'function' ? formatScreenReaderValue({
67
+ valueNow: valueNow,
68
+ valueMax: valueMax
69
+ }) : undefined;
70
+ const labelAndValueText = `${screenReaderLabel} ${valueText}`;
71
+ const value = callRenderProp(renderValue, {
72
+ valueNow: valueNow,
73
+ valueMax: valueMax
74
+ });
75
+ const style = {
76
+ strokeDashoffset: `${styles?.dashOffset}em`
77
+ };
78
+ return /*#__PURE__*/ _jsxs(View, {
79
+ ...passthroughProps(props),
80
+ as: this.props.as,
81
+ elementRef: this.handleRef,
82
+ css: styles?.progressCircle,
83
+ margin: this.props.margin,
84
+ "data-cid": "ProgressCircle",
85
+ children: [
86
+ /*#__PURE__*/ _jsx(ScreenReaderContent, {
87
+ children: /*#__PURE__*/ _jsx("progress", {
88
+ max: valueMax,
89
+ value: valueNow,
90
+ "aria-valuetext": labelAndValueText
91
+ })
92
+ }),
93
+ value && /*#__PURE__*/ _jsx("span", {
94
+ css: styles?.center,
95
+ "aria-hidden": "true",
96
+ children: /*#__PURE__*/ _jsx("span", {
97
+ css: styles?.value,
98
+ children: value
99
+ })
100
+ }),
101
+ /*#__PURE__*/ _jsxs("svg", {
102
+ css: styles?.circle,
103
+ role: "presentation",
104
+ focusable: "false",
105
+ children: [
106
+ /*#__PURE__*/ _jsx("circle", {
107
+ css: styles?.track,
108
+ role: "presentation",
109
+ cx: "50%",
110
+ cy: "50%",
111
+ r: styles?.radii?.radius
112
+ }),
113
+ /*#__PURE__*/ _jsx("circle", {
114
+ css: styles?.border,
115
+ role: "presentation",
116
+ cx: "50%",
117
+ cy: "50%",
118
+ r: styles?.radii?.borderOffsetRadius
119
+ }),
120
+ /*#__PURE__*/ _jsx("circle", {
121
+ css: styles?.meter,
122
+ role: "presentation",
123
+ style: style,
124
+ cx: "50%",
125
+ cy: "50%",
126
+ r: styles?.radii?.radius
127
+ })
128
+ ]
129
+ })
130
+ ]
88
131
  });
89
- }, this.props.animationDelay || 500));
90
132
  }
91
- this.props.makeStyles?.(this.makeStylesVariables);
92
- }
93
- componentDidUpdate() {
94
- this.props.makeStyles?.(this.makeStylesVariables);
95
- }
96
- componentWillUnmount() {
97
- this._timeouts.forEach(timeout => clearTimeout(timeout));
98
- }
99
- render() {
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;
112
- const valueText = typeof formatScreenReaderValue === 'function' ? formatScreenReaderValue({
113
- valueNow: valueNow,
114
- valueMax: valueMax
115
- }) : undefined;
116
- // consolidating the label and aria-valuetext to put in aria-label because
117
- // NVDA does not read aria-valuetext: https://github.com/nvaccess/nvda/issues/913
118
- // But leaving aria-valuetext because JAWS ignores aria-label
119
- const labelAndValueText = `${screenReaderLabel} ${valueText}`;
120
- const value = callRenderProp(renderValue, {
121
- valueNow: valueNow,
122
- valueMax: valueMax
123
- });
124
- const style = {
125
- strokeDashoffset: `${styles?.dashOffset}em`
126
- };
127
- return _jsxs(View, {
128
- ...passthroughProps(props),
129
- as: this.props.as,
130
- elementRef: this.handleRef,
131
- css: styles?.progressCircle,
132
- margin: this.props.margin,
133
- "data-cid": "ProgressCircle",
134
- children: [_jsx(ScreenReaderContent, {
135
- children: _jsx("progress", {
136
- max: valueMax,
137
- value: valueNow,
138
- "aria-valuetext": labelAndValueText
139
- })
140
- }), value && _jsx("span", {
141
- css: styles?.center,
142
- "aria-hidden": "true",
143
- children: _jsx("span", {
144
- css: styles?.value,
145
- children: value
146
- })
147
- }), _jsxs("svg", {
148
- css: styles?.circle,
149
- role: "presentation",
150
- focusable: "false",
151
- children: [_jsx("circle", {
152
- css: styles?.track,
153
- role: "presentation",
154
- cx: "50%",
155
- cy: "50%",
156
- r: styles?.radii?.radius
157
- }), _jsx("circle", {
158
- css: styles?.border,
159
- role: "presentation",
160
- cx: "50%",
161
- cy: "50%",
162
- r: styles?.radii?.borderOffsetRadius
163
- }), _jsx("circle", {
164
- css: styles?.meter,
165
- role: "presentation",
166
- style: style,
167
- cx: "50%",
168
- cy: "50%",
169
- r: styles?.radii?.radius
170
- })]
171
- })]
172
- });
173
- }
174
- }) || _class);
133
+ }
134
+ const ProgressCircle = withStyleNew(generateStyle)(ProgressCircleBase);
175
135
  export default ProgressCircle;
176
- export { ProgressCircle };
136
+ export { ProgressCircle };
@@ -1,26 +1,16 @@
1
- /*
2
- * The MIT License (MIT)
3
- *
4
- * Copyright (c) 2015 - present Instructure, Inc.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- const allowedProps = ['screenReaderLabel', 'size', 'valueMax', 'valueNow', 'formatScreenReaderValue', 'renderValue', 'color', 'meterColor', 'margin', 'elementRef', 'as', 'shouldAnimateOnMount', 'animationDelay'];
26
- export { allowedProps };
1
+ const allowedProps = [
2
+ 'screenReaderLabel',
3
+ 'size',
4
+ 'valueMax',
5
+ 'valueNow',
6
+ 'formatScreenReaderValue',
7
+ 'renderValue',
8
+ 'color',
9
+ 'meterColor',
10
+ 'margin',
11
+ 'elementRef',
12
+ 'as',
13
+ 'shouldAnimateOnMount',
14
+ 'animationDelay'
15
+ ];
16
+ export { allowedProps };