@instructure/ui-spinner 11.7.8 → 11.7.9-pr-snapshot-1792147648392

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 CHANGED
@@ -3,6 +3,19 @@
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.9-pr-snapshot-1792147648392](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-pr-snapshot-1792147648392) (2026-10-16)
7
+
8
+ ### Build System
9
+
10
+ * **many:** replace babel with swc ([7e36c54](https://github.com/instructure/instructure-ui/commit/7e36c54d240b4fa483801c03ab18e7f860f561e2))
11
+
12
+ ### BREAKING CHANGES
13
+
14
+ * **many:** `@instructure/ui-babel-preset` and
15
+ `@instructure/browserslist-config-instui` are removed and will no longer be
16
+ published. Packages depend on `@swc/helpers` instead of `@babel/runtime`.
17
+
18
+
6
19
  ## [11.7.8](https://github.com/instructure/instructure-ui/compare/v11.7.7...v11.7.8) (2026-10-02)
7
20
 
8
21
  **Note:** Version bump only for package @instructure/ui-spinner
@@ -1,28 +1,5 @@
1
- var _dec, _dec2, _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 { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
26
3
  import { Component } from 'react';
27
4
  import { View } from '@instructure/ui-view/v11_6';
28
5
  import { callRenderProp, omitProps, withDeterministicId } from '@instructure/ui-react-utils';
@@ -31,111 +8,114 @@ import { withStyle } from '@instructure/emotion';
31
8
  import generateStyle from './styles.js';
32
9
  import generateComponentTheme from './theme.js';
33
10
  import { allowedProps } from './props.js';
34
-
35
- /**
36
- ---
37
- category: components
38
- ---
39
- **/
40
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
41
- let Spinner = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = class Spinner extends Component {
42
- static displayName = 'Spinner';
43
- static componentId = 'Spinner';
44
- static allowedProps = allowedProps;
45
- static defaultProps = {
46
- as: 'div',
47
- size: 'medium',
48
- variant: 'default'
49
- };
50
- ref = null;
51
- titleId;
52
- delayTimeout;
53
- handleRef = el => {
54
- const {
55
- elementRef
56
- } = this.props;
57
- this.ref = el;
58
- if (typeof elementRef === 'function') {
59
- elementRef(el);
11
+ class Spinner extends Component {
12
+ static{
13
+ this.displayName = 'Spinner';
14
+ }
15
+ static{
16
+ this.componentId = 'Spinner';
17
+ }
18
+ static{
19
+ this.allowedProps = allowedProps;
20
+ }
21
+ static{
22
+ this.defaultProps = {
23
+ as: 'div',
24
+ size: 'medium',
25
+ variant: 'default'
26
+ };
27
+ }
28
+ constructor(props){
29
+ super(props), this.ref = null, this.handleRef = (el)=>{
30
+ const { elementRef } = this.props;
31
+ this.ref = el;
32
+ if (typeof elementRef === 'function') {
33
+ elementRef(el);
34
+ }
35
+ };
36
+ this.titleId = props.deterministicId();
37
+ this.state = {
38
+ shouldRender: !props.delay
39
+ };
40
+ }
41
+ componentDidMount() {
42
+ this.props.makeStyles?.();
43
+ const { delay } = this.props;
44
+ if (delay) {
45
+ this.delayTimeout = setTimeout(()=>{
46
+ this.setState({
47
+ shouldRender: true
48
+ });
49
+ }, delay);
50
+ }
51
+ }
52
+ componentDidUpdate() {
53
+ this.props.makeStyles?.();
54
+ }
55
+ componentWillUnmount() {
56
+ clearTimeout(this.delayTimeout);
57
+ }
58
+ radius() {
59
+ switch(this.props.size){
60
+ case 'x-small':
61
+ return '0.5em';
62
+ case 'small':
63
+ return '1em';
64
+ case 'large':
65
+ return '2.25em';
66
+ default:
67
+ return '1.75em';
68
+ }
60
69
  }
61
- };
62
- constructor(props) {
63
- super(props);
64
- this.titleId = props.deterministicId();
65
- this.state = {
66
- shouldRender: !props.delay
67
- };
68
- }
69
- componentDidMount() {
70
- this.props.makeStyles?.();
71
- const {
72
- delay
73
- } = this.props;
74
- if (delay) {
75
- this.delayTimeout = setTimeout(() => {
76
- this.setState({
77
- shouldRender: true
70
+ renderSpinner() {
71
+ const passthroughProps = View.omitViewProps(omitProps(this.props, Spinner.allowedProps), Spinner);
72
+ const hasTitle = this.props.renderTitle;
73
+ error(!!hasTitle, '[Spinner] The renderTitle prop is necessary for screen reader support.');
74
+ return /*#__PURE__*/ _jsx(View, {
75
+ ...passthroughProps,
76
+ as: this.props.as,
77
+ elementRef: this.handleRef,
78
+ css: this.props.styles?.spinner,
79
+ margin: this.props.margin,
80
+ "data-cid": "Spinner",
81
+ children: /*#__PURE__*/ _jsxs("svg", {
82
+ css: this.props.styles?.circle,
83
+ role: "img",
84
+ "aria-labelledby": this.titleId,
85
+ focusable: "false",
86
+ children: [
87
+ /*#__PURE__*/ _jsx("title", {
88
+ id: this.titleId,
89
+ children: callRenderProp(this.props.renderTitle)
90
+ }),
91
+ /*#__PURE__*/ _jsxs("g", {
92
+ role: "presentation",
93
+ children: [
94
+ this.props.variant !== 'inverse' && /*#__PURE__*/ _jsx("circle", {
95
+ css: this.props.styles?.circleTrack,
96
+ cx: "50%",
97
+ cy: "50%",
98
+ r: this.radius()
99
+ }),
100
+ /*#__PURE__*/ _jsx("circle", {
101
+ css: this.props.styles?.circleSpin,
102
+ cx: "50%",
103
+ cy: "50%",
104
+ r: this.radius()
105
+ })
106
+ ]
107
+ })
108
+ ]
109
+ })
78
110
  });
79
- }, delay);
80
111
  }
81
- }
82
- componentDidUpdate() {
83
- this.props.makeStyles?.();
84
- }
85
- componentWillUnmount() {
86
- clearTimeout(this.delayTimeout);
87
- }
88
- radius() {
89
- switch (this.props.size) {
90
- case 'x-small':
91
- return '0.5em';
92
- case 'small':
93
- return '1em';
94
- case 'large':
95
- return '2.25em';
96
- default:
97
- return '1.75em';
112
+ render() {
113
+ return this.state.shouldRender ? this.renderSpinner() : null;
98
114
  }
99
- }
100
- renderSpinner() {
101
- const passthroughProps = View.omitViewProps(omitProps(this.props, Spinner.allowedProps), Spinner);
102
- const hasTitle = this.props.renderTitle;
103
- error(!!hasTitle, '[Spinner] The renderTitle prop is necessary for screen reader support.');
104
- return _jsx(View, {
105
- ...passthroughProps,
106
- as: this.props.as,
107
- elementRef: this.handleRef,
108
- css: this.props.styles?.spinner,
109
- margin: this.props.margin,
110
- "data-cid": "Spinner",
111
- children: _jsxs("svg", {
112
- css: this.props.styles?.circle,
113
- role: "img",
114
- "aria-labelledby": this.titleId,
115
- focusable: "false",
116
- children: [_jsx("title", {
117
- id: this.titleId,
118
- children: callRenderProp(this.props.renderTitle)
119
- }), _jsxs("g", {
120
- role: "presentation",
121
- children: [this.props.variant !== 'inverse' && _jsx("circle", {
122
- css: this.props.styles?.circleTrack,
123
- cx: "50%",
124
- cy: "50%",
125
- r: this.radius()
126
- }), _jsx("circle", {
127
- css: this.props.styles?.circleSpin,
128
- cx: "50%",
129
- cy: "50%",
130
- r: this.radius()
131
- })]
132
- })]
133
- })
134
- });
135
- }
136
- render() {
137
- return this.state.shouldRender ? this.renderSpinner() : null;
138
- }
139
- }) || _class) || _class);
115
+ }
116
+ Spinner = _ts_decorate([
117
+ withDeterministicId(),
118
+ withStyle(generateStyle, generateComponentTheme)
119
+ ], Spinner);
140
120
  export default Spinner;
141
- export { Spinner };
121
+ export { Spinner };
@@ -1,26 +1,10 @@
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 = ['delay', 'renderTitle', 'size', 'variant', 'margin', 'elementRef', 'as'];
26
- export { allowedProps };
1
+ const allowedProps = [
2
+ 'delay',
3
+ 'renderTitle',
4
+ 'size',
5
+ 'variant',
6
+ 'margin',
7
+ 'elementRef',
8
+ 'as'
9
+ ];
10
+ export { allowedProps };
@@ -1,30 +1,4 @@
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
  import { keyframes } from '@instructure/emotion';
26
- // keyframes have to be outside of 'generateStyle',
27
- // since it is causing problems in style recalculation
28
2
  const rotate = keyframes`
29
3
  to {
30
4
  transform: rotate(360deg)
@@ -43,141 +17,127 @@ const morph = keyframes`
43
17
  stroke-dashoffset: 190%;
44
18
  transform: rotate(360deg);
45
19
  }`;
46
-
47
- /**
48
- * ---
49
- * private: true
50
- * ---
51
- * Generates the style object from the theme and provided additional information
52
- * @param {Object} componentTheme The theme variable object.
53
- * @param {Object} props the props of the component, the style is applied to
54
- * @param {Object} state the state of the component, the style is applied to
55
- * @return {Object} The final style object, which will be used in the component
56
- */
57
- const generateStyle = (componentTheme, props) => {
58
- const {
59
- size,
60
- variant
61
- } = props;
62
- const spinnerSizes = {
63
- 'x-small': {
64
- width: componentTheme.xSmallSize,
65
- height: componentTheme.xSmallSize
66
- },
67
- small: {
68
- width: componentTheme.smallSize,
69
- height: componentTheme.smallSize
70
- },
71
- medium: {
72
- width: componentTheme.mediumSize,
73
- height: componentTheme.mediumSize
74
- },
75
- large: {
76
- width: componentTheme.largeSize,
77
- height: componentTheme.largeSize
78
- }
79
- };
80
- const circleSizes = {
81
- 'x-small': {
82
- width: componentTheme.xSmallSize,
83
- height: componentTheme.xSmallSize
84
- },
85
- small: {
86
- width: componentTheme.smallSize,
87
- height: componentTheme.smallSize
88
- },
89
- medium: {
90
- width: componentTheme.mediumSize,
91
- height: componentTheme.mediumSize
92
- },
93
- large: {
94
- width: componentTheme.largeSize,
95
- height: componentTheme.largeSize
96
- }
97
- };
98
- const circleTrackSizes = {
99
- 'x-small': {
100
- strokeWidth: componentTheme.xSmallBorderWidth
101
- },
102
- small: {
103
- strokeWidth: componentTheme.smallBorderWidth
104
- },
105
- medium: {
106
- strokeWidth: componentTheme.mediumBorderWidth
107
- },
108
- large: {
109
- strokeWidth: componentTheme.largeBorderWidth
110
- }
111
- };
112
- const circleSpinSizes = {
113
- 'x-small': {
114
- strokeWidth: componentTheme.xSmallBorderWidth,
115
- strokeDasharray: '3em',
116
- transformOrigin: `calc(${componentTheme.xSmallSize} / 2) calc(${componentTheme.xSmallSize} / 2)`
117
- },
118
- small: {
119
- strokeWidth: componentTheme.smallBorderWidth,
120
- strokeDasharray: '6em',
121
- transformOrigin: `calc(${componentTheme.smallSize} / 2) calc(${componentTheme.smallSize} / 2)`
122
- },
123
- medium: {
124
- strokeWidth: componentTheme.mediumBorderWidth,
125
- strokeDasharray: '10.5em',
126
- transformOrigin: `calc(${componentTheme.mediumSize} / 2) calc(${componentTheme.mediumSize} / 2)`
127
- },
128
- large: {
129
- strokeWidth: componentTheme.largeBorderWidth,
130
- strokeDasharray: '14em',
131
- transformOrigin: `calc(${componentTheme.largeSize} / 2) calc(${componentTheme.largeSize} / 2)`
132
- }
133
- };
134
- const circleSpinVariant = {
135
- default: {
136
- stroke: componentTheme.color
137
- },
138
- inverse: {
139
- stroke: componentTheme.inverseColor
140
- }
141
- };
142
- return {
143
- spinner: {
144
- label: 'spinner',
145
- display: 'inline-block',
146
- verticalAlign: 'middle',
147
- position: 'relative',
148
- boxSizing: 'border-box',
149
- overflow: 'hidden',
150
- ...spinnerSizes[size]
151
- },
152
- circle: {
153
- label: 'spinner__circle',
154
- display: 'block',
155
- position: 'absolute',
156
- top: '0',
157
- left: '0',
158
- animationName: rotate,
159
- animationDuration: '2.25s',
160
- animationIterationCount: 'infinite',
161
- animationTimingFunction: 'linear',
162
- ...circleSizes[size]
163
- },
164
- circleTrack: {
165
- label: 'spinner__circleTrack',
166
- stroke: componentTheme.trackColor,
167
- fill: 'none',
168
- ...circleTrackSizes[size]
169
- },
170
- circleSpin: {
171
- label: 'spinner__circleSpin',
172
- fill: 'none',
173
- strokeLinecap: 'round',
174
- animationName: morph,
175
- animationDuration: '1.75s',
176
- animationIterationCount: 'infinite',
177
- animationTimingFunction: 'ease',
178
- ...circleSpinSizes[size],
179
- ...circleSpinVariant[variant]
180
- }
181
- };
20
+ const generateStyle = (componentTheme, props)=>{
21
+ const { size, variant } = props;
22
+ const spinnerSizes = {
23
+ 'x-small': {
24
+ width: componentTheme.xSmallSize,
25
+ height: componentTheme.xSmallSize
26
+ },
27
+ small: {
28
+ width: componentTheme.smallSize,
29
+ height: componentTheme.smallSize
30
+ },
31
+ medium: {
32
+ width: componentTheme.mediumSize,
33
+ height: componentTheme.mediumSize
34
+ },
35
+ large: {
36
+ width: componentTheme.largeSize,
37
+ height: componentTheme.largeSize
38
+ }
39
+ };
40
+ const circleSizes = {
41
+ 'x-small': {
42
+ width: componentTheme.xSmallSize,
43
+ height: componentTheme.xSmallSize
44
+ },
45
+ small: {
46
+ width: componentTheme.smallSize,
47
+ height: componentTheme.smallSize
48
+ },
49
+ medium: {
50
+ width: componentTheme.mediumSize,
51
+ height: componentTheme.mediumSize
52
+ },
53
+ large: {
54
+ width: componentTheme.largeSize,
55
+ height: componentTheme.largeSize
56
+ }
57
+ };
58
+ const circleTrackSizes = {
59
+ 'x-small': {
60
+ strokeWidth: componentTheme.xSmallBorderWidth
61
+ },
62
+ small: {
63
+ strokeWidth: componentTheme.smallBorderWidth
64
+ },
65
+ medium: {
66
+ strokeWidth: componentTheme.mediumBorderWidth
67
+ },
68
+ large: {
69
+ strokeWidth: componentTheme.largeBorderWidth
70
+ }
71
+ };
72
+ const circleSpinSizes = {
73
+ 'x-small': {
74
+ strokeWidth: componentTheme.xSmallBorderWidth,
75
+ strokeDasharray: '3em',
76
+ transformOrigin: `calc(${componentTheme.xSmallSize} / 2) calc(${componentTheme.xSmallSize} / 2)`
77
+ },
78
+ small: {
79
+ strokeWidth: componentTheme.smallBorderWidth,
80
+ strokeDasharray: '6em',
81
+ transformOrigin: `calc(${componentTheme.smallSize} / 2) calc(${componentTheme.smallSize} / 2)`
82
+ },
83
+ medium: {
84
+ strokeWidth: componentTheme.mediumBorderWidth,
85
+ strokeDasharray: '10.5em',
86
+ transformOrigin: `calc(${componentTheme.mediumSize} / 2) calc(${componentTheme.mediumSize} / 2)`
87
+ },
88
+ large: {
89
+ strokeWidth: componentTheme.largeBorderWidth,
90
+ strokeDasharray: '14em',
91
+ transformOrigin: `calc(${componentTheme.largeSize} / 2) calc(${componentTheme.largeSize} / 2)`
92
+ }
93
+ };
94
+ const circleSpinVariant = {
95
+ default: {
96
+ stroke: componentTheme.color
97
+ },
98
+ inverse: {
99
+ stroke: componentTheme.inverseColor
100
+ }
101
+ };
102
+ return {
103
+ spinner: {
104
+ label: 'spinner',
105
+ display: 'inline-block',
106
+ verticalAlign: 'middle',
107
+ position: 'relative',
108
+ boxSizing: 'border-box',
109
+ overflow: 'hidden',
110
+ ...spinnerSizes[size]
111
+ },
112
+ circle: {
113
+ label: 'spinner__circle',
114
+ display: 'block',
115
+ position: 'absolute',
116
+ top: '0',
117
+ left: '0',
118
+ animationName: rotate,
119
+ animationDuration: '2.25s',
120
+ animationIterationCount: 'infinite',
121
+ animationTimingFunction: 'linear',
122
+ ...circleSizes[size]
123
+ },
124
+ circleTrack: {
125
+ label: 'spinner__circleTrack',
126
+ stroke: componentTheme.trackColor,
127
+ fill: 'none',
128
+ ...circleTrackSizes[size]
129
+ },
130
+ circleSpin: {
131
+ label: 'spinner__circleSpin',
132
+ fill: 'none',
133
+ strokeLinecap: 'round',
134
+ animationName: morph,
135
+ animationDuration: '1.75s',
136
+ animationIterationCount: 'infinite',
137
+ animationTimingFunction: 'ease',
138
+ ...circleSpinSizes[size],
139
+ ...circleSpinVariant[variant]
140
+ }
141
+ };
182
142
  };
183
- export default generateStyle;
143
+ export default generateStyle;