@instructure/ui-spinner 11.6.0 → 11.6.1-pr-snapshot-1779894247159

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,14 @@
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.6.1-pr-snapshot-1779894247159](https://github.com/instructure/instructure-ui/compare/v11.6.0...v11.6.1-pr-snapshot-1779894247159) (2026-05-27)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-spinner
9
+
10
+
11
+
12
+
13
+
6
14
  # [11.6.0](https://github.com/instructure/instructure-ui/compare/v11.5.0...v11.6.0) (2026-02-18)
7
15
 
8
16
  **Note:** Version bump only for package @instructure/ui-spinner
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.allowedProps = void 0;
7
1
  /*
8
2
  * The MIT License (MIT)
9
3
  *
@@ -28,4 +22,16 @@ exports.allowedProps = void 0;
28
22
  * SOFTWARE.
29
23
  */
30
24
 
31
- const allowedProps = exports.allowedProps = ['delay', 'renderTitle', 'size', 'variant', 'margin', 'elementRef', 'as'];
25
+ module.exports = {
26
+ presets: [
27
+ [
28
+ require('@instructure/ui-babel-preset'),
29
+ {
30
+ coverage: Boolean(process.env.COVERAGE),
31
+ esModules: Boolean(process.env.ES_MODULES),
32
+ removeConsole: process.env.NODE_ENV === 'production',
33
+ transformImports: Boolean(process.env.TRANSFORM_IMPORTS)
34
+ }
35
+ ]
36
+ ]
37
+ }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@instructure/ui-spinner",
3
- "version": "11.6.0",
3
+ "version": "11.6.1-pr-snapshot-1779894247159",
4
+ "type": "module",
4
5
  "description": "A spinner/loading component",
5
6
  "author": "Instructure, Inc. Engineering and Product Design",
6
7
  "module": "./es/index.js",
7
- "main": "./lib/index.js",
8
8
  "types": "./types/index.d.ts",
9
9
  "repository": {
10
10
  "type": "git",
@@ -15,22 +15,22 @@
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
17
  "@babel/runtime": "^7.27.6",
18
- "@instructure/console": "11.6.0",
19
- "@instructure/emotion": "11.6.0",
20
- "@instructure/ui-color-utils": "11.6.0",
21
- "@instructure/shared-types": "11.6.0",
22
- "@instructure/ui-react-utils": "11.6.0",
23
- "@instructure/ui-utils": "11.6.0",
24
- "@instructure/uid": "11.6.0",
25
- "@instructure/ui-view": "11.6.0"
18
+ "@instructure/console": "11.6.1-pr-snapshot-1779894247159",
19
+ "@instructure/shared-types": "11.6.1-pr-snapshot-1779894247159",
20
+ "@instructure/emotion": "11.6.1-pr-snapshot-1779894247159",
21
+ "@instructure/ui-color-utils": "11.6.1-pr-snapshot-1779894247159",
22
+ "@instructure/ui-react-utils": "11.6.1-pr-snapshot-1779894247159",
23
+ "@instructure/ui-utils": "11.6.1-pr-snapshot-1779894247159",
24
+ "@instructure/ui-view": "11.6.1-pr-snapshot-1779894247159",
25
+ "@instructure/uid": "11.6.1-pr-snapshot-1779894247159"
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.6.0",
32
- "@instructure/ui-themes": "11.6.0",
33
- "@instructure/ui-babel-preset": "11.6.0"
31
+ "@instructure/ui-axe-check": "11.6.1-pr-snapshot-1779894247159",
32
+ "@instructure/ui-babel-preset": "11.6.1-pr-snapshot-1779894247159",
33
+ "@instructure/ui-themes": "11.6.1-pr-snapshot-1779894247159"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "react": ">=18 <=19"
@@ -43,10 +43,8 @@
43
43
  ".": {
44
44
  "types": "./types/index.d.ts",
45
45
  "import": "./es/index.js",
46
- "require": "./lib/index.js",
47
46
  "default": "./es/index.js"
48
47
  },
49
- "./lib/*": "./lib/*",
50
48
  "./es/*": "./es/*",
51
49
  "./types/*": "./types/*",
52
50
  "./package.json": "./package.json",
@@ -56,7 +54,7 @@
56
54
  "lint": "ui-scripts lint",
57
55
  "lint:fix": "ui-scripts lint --fix",
58
56
  "clean": "ui-scripts clean",
59
- "build": "ui-scripts build --modules es,cjs",
57
+ "build": "ui-scripts build",
60
58
  "build:watch": "pnpm run ts:check -- --watch & ui-scripts build --watch",
61
59
  "build:types": "tsc -p tsconfig.build.json",
62
60
  "ts:check": "tsc -p tsconfig.build.json --noEmit --emitDeclarationOnly false"
@@ -1,142 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.Spinner = void 0;
8
- var _react = require("react");
9
- var _View = require("@instructure/ui-view/lib/View");
10
- var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
11
- var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
12
- var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
13
- var _console = require("@instructure/console");
14
- var _emotion = require("@instructure/emotion");
15
- var _styles = _interopRequireDefault(require("./styles"));
16
- var _theme = _interopRequireDefault(require("./theme"));
17
- var _props = require("./props");
18
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
19
- var _dec, _dec2, _class, _Spinner;
20
- /*
21
- * The MIT License (MIT)
22
- *
23
- * Copyright (c) 2015 - present Instructure, Inc.
24
- *
25
- * Permission is hereby granted, free of charge, to any person obtaining a copy
26
- * of this software and associated documentation files (the "Software"), to deal
27
- * in the Software without restriction, including without limitation the rights
28
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
29
- * copies of the Software, and to permit persons to whom the Software is
30
- * furnished to do so, subject to the following conditions:
31
- *
32
- * The above copyright notice and this permission notice shall be included in all
33
- * copies or substantial portions of the Software.
34
- *
35
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
41
- * SOFTWARE.
42
- */
43
- /**
44
- ---
45
- category: components
46
- ---
47
- **/
48
- let Spinner = exports.Spinner = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = (_Spinner = class Spinner extends _react.Component {
49
- constructor(props) {
50
- super(props);
51
- this.ref = null;
52
- this.titleId = void 0;
53
- this.delayTimeout = void 0;
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
- this.titleId = props.deterministicId();
62
- this.state = {
63
- shouldRender: !props.delay
64
- };
65
- }
66
- componentDidMount() {
67
- var _this$props$makeStyle, _this$props;
68
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
69
- const delay = this.props.delay;
70
- if (delay) {
71
- this.delayTimeout = setTimeout(() => {
72
- this.setState({
73
- shouldRender: true
74
- });
75
- }, delay);
76
- }
77
- }
78
- componentDidUpdate() {
79
- var _this$props$makeStyle2, _this$props2;
80
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
81
- }
82
- componentWillUnmount() {
83
- clearTimeout(this.delayTimeout);
84
- }
85
- radius() {
86
- switch (this.props.size) {
87
- case 'x-small':
88
- return '0.5em';
89
- case 'small':
90
- return '1em';
91
- case 'large':
92
- return '2.25em';
93
- default:
94
- return '1.75em';
95
- }
96
- }
97
- renderSpinner() {
98
- var _this$props$styles, _this$props$styles2, _this$props$styles3, _this$props$styles4;
99
- const passthroughProps = _View.View.omitViewProps((0, _omitProps.omitProps)(this.props, Spinner.allowedProps), Spinner);
100
- const hasTitle = this.props.renderTitle;
101
- (0, _console.logError)(!!hasTitle, '[Spinner] The renderTitle prop is necessary for screen reader support.');
102
- return (0, _jsxRuntime.jsx)(_View.View, {
103
- ...passthroughProps,
104
- as: this.props.as,
105
- elementRef: this.handleRef,
106
- css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.spinner,
107
- margin: this.props.margin,
108
- "data-cid": "Spinner",
109
- children: (0, _jsxRuntime.jsxs)("svg", {
110
- css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.circle,
111
- role: "img",
112
- "aria-labelledby": this.titleId,
113
- focusable: "false",
114
- children: [(0, _jsxRuntime.jsx)("title", {
115
- id: this.titleId,
116
- children: (0, _callRenderProp.callRenderProp)(this.props.renderTitle)
117
- }), (0, _jsxRuntime.jsxs)("g", {
118
- role: "presentation",
119
- children: [this.props.variant !== 'inverse' && (0, _jsxRuntime.jsx)("circle", {
120
- css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.circleTrack,
121
- cx: "50%",
122
- cy: "50%",
123
- r: this.radius()
124
- }), (0, _jsxRuntime.jsx)("circle", {
125
- css: (_this$props$styles4 = this.props.styles) === null || _this$props$styles4 === void 0 ? void 0 : _this$props$styles4.circleSpin,
126
- cx: "50%",
127
- cy: "50%",
128
- r: this.radius()
129
- })]
130
- })]
131
- })
132
- });
133
- }
134
- render() {
135
- return this.state.shouldRender ? this.renderSpinner() : null;
136
- }
137
- }, _Spinner.displayName = "Spinner", _Spinner.componentId = 'Spinner', _Spinner.allowedProps = _props.allowedProps, _Spinner.defaultProps = {
138
- as: 'div',
139
- size: 'medium',
140
- variant: 'default'
141
- }, _Spinner)) || _class) || _class);
142
- var _default = exports.default = Spinner;
@@ -1,187 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _emotion = require("@instructure/emotion");
8
- /*
9
- * The MIT License (MIT)
10
- *
11
- * Copyright (c) 2015 - present Instructure, Inc.
12
- *
13
- * Permission is hereby granted, free of charge, to any person obtaining a copy
14
- * of this software and associated documentation files (the "Software"), to deal
15
- * in the Software without restriction, including without limitation the rights
16
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
- * copies of the Software, and to permit persons to whom the Software is
18
- * furnished to do so, subject to the following conditions:
19
- *
20
- * The above copyright notice and this permission notice shall be included in all
21
- * copies or substantial portions of the Software.
22
- *
23
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
- * SOFTWARE.
30
- */
31
-
32
- // keyframes have to be outside of 'generateStyle',
33
- // since it is causing problems in style recalculation
34
- const rotate = (0, _emotion.keyframes)`
35
- to {
36
- transform: rotate(360deg)
37
- }`;
38
- const morph = (0, _emotion.keyframes)`
39
- 0% {
40
- stroke-dashoffset: 190%;
41
- }
42
-
43
- 50% {
44
- stroke-dashoffset: 50%;
45
- transform: rotate(90deg);
46
- }
47
-
48
- 100% {
49
- stroke-dashoffset: 190%;
50
- transform: rotate(360deg);
51
- }`;
52
-
53
- /**
54
- * ---
55
- * private: true
56
- * ---
57
- * Generates the style object from the theme and provided additional information
58
- * @param {Object} componentTheme The theme variable object.
59
- * @param {Object} props the props of the component, the style is applied to
60
- * @param {Object} state the state of the component, the style is applied to
61
- * @return {Object} The final style object, which will be used in the component
62
- */
63
- const generateStyle = (componentTheme, props) => {
64
- const size = props.size,
65
- variant = props.variant;
66
- const spinnerSizes = {
67
- 'x-small': {
68
- width: componentTheme.xSmallSize,
69
- height: componentTheme.xSmallSize
70
- },
71
- small: {
72
- width: componentTheme.smallSize,
73
- height: componentTheme.smallSize
74
- },
75
- medium: {
76
- width: componentTheme.mediumSize,
77
- height: componentTheme.mediumSize
78
- },
79
- large: {
80
- width: componentTheme.largeSize,
81
- height: componentTheme.largeSize
82
- }
83
- };
84
- const circleSizes = {
85
- 'x-small': {
86
- width: componentTheme.xSmallSize,
87
- height: componentTheme.xSmallSize
88
- },
89
- small: {
90
- width: componentTheme.smallSize,
91
- height: componentTheme.smallSize
92
- },
93
- medium: {
94
- width: componentTheme.mediumSize,
95
- height: componentTheme.mediumSize
96
- },
97
- large: {
98
- width: componentTheme.largeSize,
99
- height: componentTheme.largeSize
100
- }
101
- };
102
- const circleTrackSizes = {
103
- 'x-small': {
104
- strokeWidth: componentTheme.xSmallBorderWidth
105
- },
106
- small: {
107
- strokeWidth: componentTheme.smallBorderWidth
108
- },
109
- medium: {
110
- strokeWidth: componentTheme.mediumBorderWidth
111
- },
112
- large: {
113
- strokeWidth: componentTheme.largeBorderWidth
114
- }
115
- };
116
- const circleSpinSizes = {
117
- 'x-small': {
118
- strokeWidth: componentTheme.xSmallBorderWidth,
119
- strokeDasharray: '3em',
120
- transformOrigin: `calc(${componentTheme.xSmallSize} / 2) calc(${componentTheme.xSmallSize} / 2)`
121
- },
122
- small: {
123
- strokeWidth: componentTheme.smallBorderWidth,
124
- strokeDasharray: '6em',
125
- transformOrigin: `calc(${componentTheme.smallSize} / 2) calc(${componentTheme.smallSize} / 2)`
126
- },
127
- medium: {
128
- strokeWidth: componentTheme.mediumBorderWidth,
129
- strokeDasharray: '10.5em',
130
- transformOrigin: `calc(${componentTheme.mediumSize} / 2) calc(${componentTheme.mediumSize} / 2)`
131
- },
132
- large: {
133
- strokeWidth: componentTheme.largeBorderWidth,
134
- strokeDasharray: '14em',
135
- transformOrigin: `calc(${componentTheme.largeSize} / 2) calc(${componentTheme.largeSize} / 2)`
136
- }
137
- };
138
- const circleSpinVariant = {
139
- default: {
140
- stroke: componentTheme.color
141
- },
142
- inverse: {
143
- stroke: componentTheme.inverseColor
144
- }
145
- };
146
- return {
147
- spinner: {
148
- label: 'spinner',
149
- display: 'inline-block',
150
- verticalAlign: 'middle',
151
- position: 'relative',
152
- boxSizing: 'border-box',
153
- overflow: 'hidden',
154
- ...spinnerSizes[size]
155
- },
156
- circle: {
157
- label: 'spinner__circle',
158
- display: 'block',
159
- position: 'absolute',
160
- top: '0',
161
- left: '0',
162
- animationName: rotate,
163
- animationDuration: '2.25s',
164
- animationIterationCount: 'infinite',
165
- animationTimingFunction: 'linear',
166
- ...circleSizes[size]
167
- },
168
- circleTrack: {
169
- label: 'spinner__circleTrack',
170
- stroke: componentTheme.trackColor,
171
- fill: 'none',
172
- ...circleTrackSizes[size]
173
- },
174
- circleSpin: {
175
- label: 'spinner__circleSpin',
176
- fill: 'none',
177
- strokeLinecap: 'round',
178
- animationName: morph,
179
- animationDuration: '1.75s',
180
- animationIterationCount: 'infinite',
181
- animationTimingFunction: 'ease',
182
- ...circleSpinSizes[size],
183
- ...circleSpinVariant[variant]
184
- }
185
- };
186
- };
187
- var _default = exports.default = generateStyle;
@@ -1,66 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- /*
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2015 - present Instructure, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- /**
32
- * Generates the theme object for the component from the theme and provided additional information
33
- * @param {Object} theme The actual theme object.
34
- * @return {Object} The final theme object with the overrides and component variables
35
- */
36
- const generateComponentTheme = theme => {
37
- var _colors$contrasts, _colors$contrasts2, _colors$contrasts3, _colors$contrasts4;
38
- const colors = theme.colors,
39
- themeName = theme.key;
40
- const themeSpecificStyle = {
41
- 'canvas-high-contrast': {
42
- inverseColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.white1010
43
- },
44
- canvas: {
45
- color: theme['ic-brand-primary']
46
- }
47
- };
48
- const componentVariables = {
49
- trackColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.grey1111,
50
- color: colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.blue4570,
51
- xSmallSize: '1.5em',
52
- xSmallBorderWidth: '0.25em',
53
- smallSize: '3em',
54
- smallBorderWidth: '0.375em',
55
- mediumSize: '5em',
56
- mediumBorderWidth: '0.5em',
57
- largeSize: '7em',
58
- largeBorderWidth: '0.75em',
59
- inverseColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts4 = colors.contrasts) === null || _colors$contrasts4 === void 0 ? void 0 : _colors$contrasts4.blue4570
60
- };
61
- return {
62
- ...componentVariables,
63
- ...themeSpecificStyle[themeName]
64
- };
65
- };
66
- var _default = exports.default = generateComponentTheme;
package/lib/index.js DELETED
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "Spinner", {
7
- enumerable: true,
8
- get: function () {
9
- return _Spinner.Spinner;
10
- }
11
- });
12
- var _Spinner = require("./Spinner");
package/lib/package.json DELETED
@@ -1 +0,0 @@
1
- {"type":"commonjs"}