@spark-web/spinner 2.0.0-rc.2 → 2.0.0-rc.21
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 +266 -0
- package/dist/spark-web-spinner.cjs.d.ts +2 -2
- package/dist/spark-web-spinner.cjs.js +15 -6
- package/package.json +6 -6
- package/dist/declarations/src/index.d.ts +0 -2
- package/dist/declarations/src/spinner.d.ts +0 -14
- package/dist/spark-web-spinner.cjs.dev.js +0 -73
- package/dist/spark-web-spinner.cjs.prod.js +0 -73
- package/dist/spark-web-spinner.esm.js +0 -69
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,271 @@
|
|
|
1
1
|
# @spark-web/spinner
|
|
2
2
|
|
|
3
|
+
## 2.0.0-rc.21
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Introduce global theming provider to set global default theme
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies []:
|
|
12
|
+
- @spark-web/utils@2.0.0-rc.21
|
|
13
|
+
- @spark-web/a11y@2.0.0-rc.21
|
|
14
|
+
- @spark-web/icon@2.0.0-rc.21
|
|
15
|
+
- @spark-web/box@2.0.0-rc.21
|
|
16
|
+
|
|
17
|
+
## 2.0.0-rc.20
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- Support for component-level theming; button-level theming
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies []:
|
|
26
|
+
- @spark-web/utils@2.0.0-rc.20
|
|
27
|
+
- @spark-web/a11y@2.0.0-rc.20
|
|
28
|
+
- @spark-web/icon@2.0.0-rc.20
|
|
29
|
+
- @spark-web/box@2.0.0-rc.20
|
|
30
|
+
|
|
31
|
+
## 2.0.0-rc.19
|
|
32
|
+
|
|
33
|
+
### Major Changes
|
|
34
|
+
|
|
35
|
+
- test
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Updated dependencies []:
|
|
40
|
+
- @spark-web/utils@2.0.0-rc.19
|
|
41
|
+
- @spark-web/a11y@2.0.0-rc.19
|
|
42
|
+
- @spark-web/icon@2.0.0-rc.19
|
|
43
|
+
- @spark-web/box@2.0.0-rc.19
|
|
44
|
+
|
|
45
|
+
## 2.0.0-rc.18
|
|
46
|
+
|
|
47
|
+
### Major Changes
|
|
48
|
+
|
|
49
|
+
- tests
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- Updated dependencies []:
|
|
54
|
+
- @spark-web/utils@2.0.0-rc.18
|
|
55
|
+
- @spark-web/a11y@2.0.0-rc.18
|
|
56
|
+
- @spark-web/icon@2.0.0-rc.18
|
|
57
|
+
- @spark-web/box@2.0.0-rc.18
|
|
58
|
+
|
|
59
|
+
## 2.0.0-rc.17
|
|
60
|
+
|
|
61
|
+
### Major Changes
|
|
62
|
+
|
|
63
|
+
- test
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- Updated dependencies []:
|
|
68
|
+
- @spark-web/utils@2.0.0-rc.17
|
|
69
|
+
- @spark-web/a11y@2.0.0-rc.17
|
|
70
|
+
- @spark-web/icon@2.0.0-rc.17
|
|
71
|
+
- @spark-web/box@2.0.0-rc.17
|
|
72
|
+
|
|
73
|
+
## 2.0.0-rc.16
|
|
74
|
+
|
|
75
|
+
### Major Changes
|
|
76
|
+
|
|
77
|
+
- test
|
|
78
|
+
|
|
79
|
+
### Patch Changes
|
|
80
|
+
|
|
81
|
+
- Updated dependencies []:
|
|
82
|
+
- @spark-web/utils@2.0.0-rc.16
|
|
83
|
+
- @spark-web/a11y@2.0.0-rc.16
|
|
84
|
+
- @spark-web/icon@2.0.0-rc.16
|
|
85
|
+
- @spark-web/box@2.0.0-rc.16
|
|
86
|
+
|
|
87
|
+
## 2.0.0-rc.15
|
|
88
|
+
|
|
89
|
+
### Major Changes
|
|
90
|
+
|
|
91
|
+
- test
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- Updated dependencies []:
|
|
96
|
+
- @spark-web/utils@2.0.0-rc.15
|
|
97
|
+
- @spark-web/a11y@2.0.0-rc.15
|
|
98
|
+
- @spark-web/icon@2.0.0-rc.15
|
|
99
|
+
- @spark-web/box@2.0.0-rc.15
|
|
100
|
+
|
|
101
|
+
## 2.0.0-rc.14
|
|
102
|
+
|
|
103
|
+
### Major Changes
|
|
104
|
+
|
|
105
|
+
- test
|
|
106
|
+
|
|
107
|
+
### Patch Changes
|
|
108
|
+
|
|
109
|
+
- Updated dependencies []:
|
|
110
|
+
- @spark-web/utils@2.0.0-rc.14
|
|
111
|
+
- @spark-web/a11y@2.0.0-rc.14
|
|
112
|
+
- @spark-web/icon@2.0.0-rc.14
|
|
113
|
+
- @spark-web/box@2.0.0-rc.14
|
|
114
|
+
|
|
115
|
+
## 2.0.0-rc.13
|
|
116
|
+
|
|
117
|
+
### Major Changes
|
|
118
|
+
|
|
119
|
+
- test
|
|
120
|
+
|
|
121
|
+
### Patch Changes
|
|
122
|
+
|
|
123
|
+
- Updated dependencies []:
|
|
124
|
+
- @spark-web/utils@2.0.0-rc.13
|
|
125
|
+
- @spark-web/a11y@2.0.0-rc.13
|
|
126
|
+
- @spark-web/icon@2.0.0-rc.13
|
|
127
|
+
- @spark-web/box@2.0.0-rc.13
|
|
128
|
+
|
|
129
|
+
## 2.0.0-rc.12
|
|
130
|
+
|
|
131
|
+
### Major Changes
|
|
132
|
+
|
|
133
|
+
- test
|
|
134
|
+
|
|
135
|
+
### Patch Changes
|
|
136
|
+
|
|
137
|
+
- Updated dependencies []:
|
|
138
|
+
- @spark-web/utils@2.0.0-rc.12
|
|
139
|
+
- @spark-web/a11y@2.0.0-rc.12
|
|
140
|
+
- @spark-web/icon@2.0.0-rc.12
|
|
141
|
+
- @spark-web/box@2.0.0-rc.12
|
|
142
|
+
|
|
143
|
+
## 2.0.0-rc.11
|
|
144
|
+
|
|
145
|
+
### Major Changes
|
|
146
|
+
|
|
147
|
+
- test
|
|
148
|
+
|
|
149
|
+
### Patch Changes
|
|
150
|
+
|
|
151
|
+
- Updated dependencies []:
|
|
152
|
+
- @spark-web/utils@2.0.0-rc.11
|
|
153
|
+
- @spark-web/a11y@2.0.0-rc.11
|
|
154
|
+
- @spark-web/icon@2.0.0-rc.11
|
|
155
|
+
- @spark-web/box@2.0.0-rc.11
|
|
156
|
+
|
|
157
|
+
## 2.0.0-rc.10
|
|
158
|
+
|
|
159
|
+
### Major Changes
|
|
160
|
+
|
|
161
|
+
- test
|
|
162
|
+
|
|
163
|
+
### Patch Changes
|
|
164
|
+
|
|
165
|
+
- Updated dependencies []:
|
|
166
|
+
- @spark-web/utils@2.0.0-rc.10
|
|
167
|
+
- @spark-web/a11y@2.0.0-rc.10
|
|
168
|
+
- @spark-web/icon@2.0.0-rc.10
|
|
169
|
+
- @spark-web/box@2.0.0-rc.10
|
|
170
|
+
|
|
171
|
+
## 2.0.0-rc.9
|
|
172
|
+
|
|
173
|
+
### Major Changes
|
|
174
|
+
|
|
175
|
+
- test
|
|
176
|
+
|
|
177
|
+
### Patch Changes
|
|
178
|
+
|
|
179
|
+
- Updated dependencies []:
|
|
180
|
+
- @spark-web/utils@2.0.0-rc.9
|
|
181
|
+
- @spark-web/a11y@2.0.0-rc.9
|
|
182
|
+
- @spark-web/icon@2.0.0-rc.9
|
|
183
|
+
- @spark-web/box@2.0.0-rc.9
|
|
184
|
+
|
|
185
|
+
## 2.0.0-rc.8
|
|
186
|
+
|
|
187
|
+
### Major Changes
|
|
188
|
+
|
|
189
|
+
- test
|
|
190
|
+
|
|
191
|
+
### Patch Changes
|
|
192
|
+
|
|
193
|
+
- Updated dependencies []:
|
|
194
|
+
- @spark-web/utils@2.0.0-rc.8
|
|
195
|
+
- @spark-web/a11y@2.0.0-rc.8
|
|
196
|
+
- @spark-web/icon@2.0.0-rc.8
|
|
197
|
+
- @spark-web/box@2.0.0-rc.8
|
|
198
|
+
|
|
199
|
+
## 2.0.0-rc.7
|
|
200
|
+
|
|
201
|
+
### Major Changes
|
|
202
|
+
|
|
203
|
+
- test
|
|
204
|
+
|
|
205
|
+
### Patch Changes
|
|
206
|
+
|
|
207
|
+
- Updated dependencies []:
|
|
208
|
+
- @spark-web/utils@2.0.0-rc.7
|
|
209
|
+
- @spark-web/a11y@2.0.0-rc.7
|
|
210
|
+
- @spark-web/icon@2.0.0-rc.7
|
|
211
|
+
- @spark-web/box@2.0.0-rc.7
|
|
212
|
+
|
|
213
|
+
## 2.0.0-rc.6
|
|
214
|
+
|
|
215
|
+
### Major Changes
|
|
216
|
+
|
|
217
|
+
- test
|
|
218
|
+
|
|
219
|
+
### Patch Changes
|
|
220
|
+
|
|
221
|
+
- Updated dependencies []:
|
|
222
|
+
- @spark-web/utils@2.0.0-rc.6
|
|
223
|
+
- @spark-web/a11y@2.0.0-rc.6
|
|
224
|
+
- @spark-web/icon@2.0.0-rc.6
|
|
225
|
+
- @spark-web/box@2.0.0-rc.6
|
|
226
|
+
|
|
227
|
+
## 2.0.0-rc.5
|
|
228
|
+
|
|
229
|
+
### Major Changes
|
|
230
|
+
|
|
231
|
+
- test
|
|
232
|
+
|
|
233
|
+
### Patch Changes
|
|
234
|
+
|
|
235
|
+
- Updated dependencies []:
|
|
236
|
+
- @spark-web/utils@2.0.0-rc.5
|
|
237
|
+
- @spark-web/a11y@2.0.0-rc.5
|
|
238
|
+
- @spark-web/icon@2.0.0-rc.5
|
|
239
|
+
- @spark-web/box@2.0.0-rc.5
|
|
240
|
+
|
|
241
|
+
## 2.0.0-rc.4
|
|
242
|
+
|
|
243
|
+
### Major Changes
|
|
244
|
+
|
|
245
|
+
- bug
|
|
246
|
+
|
|
247
|
+
### Patch Changes
|
|
248
|
+
|
|
249
|
+
- Updated dependencies []:
|
|
250
|
+
- @spark-web/utils@2.0.0-rc.4
|
|
251
|
+
- @spark-web/a11y@2.0.0-rc.4
|
|
252
|
+
- @spark-web/icon@2.0.0-rc.4
|
|
253
|
+
- @spark-web/box@2.0.0-rc.4
|
|
254
|
+
|
|
255
|
+
## 2.0.0-rc.3
|
|
256
|
+
|
|
257
|
+
### Major Changes
|
|
258
|
+
|
|
259
|
+
- upgrade package
|
|
260
|
+
|
|
261
|
+
### Patch Changes
|
|
262
|
+
|
|
263
|
+
- Updated dependencies []:
|
|
264
|
+
- @spark-web/utils@2.0.0-rc.3
|
|
265
|
+
- @spark-web/a11y@2.0.0-rc.3
|
|
266
|
+
- @spark-web/icon@2.0.0-rc.3
|
|
267
|
+
- @spark-web/box@2.0.0-rc.3
|
|
268
|
+
|
|
3
269
|
## 2.0.0-rc.2
|
|
4
270
|
|
|
5
271
|
### Major Changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "
|
|
2
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
1
|
+
export * from "../src/index";
|
|
2
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Bhcmstd2ViLXNwaW5uZXIuY2pzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEifQ==
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
// this file might look strange and you might be wondering what it's for
|
|
3
|
+
// it's lets you import your source files by importing this entrypoint
|
|
4
|
+
// as you would import it if it was built with preconstruct build
|
|
5
|
+
// this file is slightly different to some others though
|
|
6
|
+
// it has a require hook which compiles your code with Babel
|
|
7
|
+
// this means that you don't have to set up @babel/register or anything like that
|
|
8
|
+
// but you can still require this module and it'll be compiled
|
|
2
9
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
// this bit of code imports the require hook and registers it
|
|
11
|
+
let unregister = require("../../../node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../..", "..");
|
|
12
|
+
|
|
13
|
+
// this re-exports the source file
|
|
14
|
+
module.exports = require("../src/index.ts");
|
|
15
|
+
|
|
16
|
+
unregister();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spark-web/spinner",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.21",
|
|
4
4
|
"homepage": "https://github.com/brighte-labs/spark-web#readme",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime": "^7.25.0",
|
|
19
|
-
"@emotion/react": "^11.
|
|
20
|
-
"@spark-web/a11y": "^2.0.0-rc.
|
|
21
|
-
"@spark-web/box": "^2.0.0-rc.
|
|
22
|
-
"@spark-web/icon": "^2.0.0-rc.
|
|
23
|
-
"@spark-web/utils": "^2.0.0-rc.
|
|
19
|
+
"@emotion/react": "^11.14.0",
|
|
20
|
+
"@spark-web/a11y": "^2.0.0-rc.21",
|
|
21
|
+
"@spark-web/box": "^2.0.0-rc.21",
|
|
22
|
+
"@spark-web/icon": "^2.0.0-rc.21",
|
|
23
|
+
"@spark-web/utils": "^2.0.0-rc.21"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/react": "^18.2.0",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { IconProps } from '@spark-web/icon';
|
|
2
|
-
import type { DataAttributeMap } from '@spark-web/utils/internal';
|
|
3
|
-
export declare type SpinnerProps = {
|
|
4
|
-
/** Provide a tone to influence elements of the field, and its input. */
|
|
5
|
-
tone?: IconProps['tone'];
|
|
6
|
-
/** The size of the nested radios. */
|
|
7
|
-
size?: 'xxsmall' | 'xsmall';
|
|
8
|
-
/** Sets data attributes for the element. */
|
|
9
|
-
data?: DataAttributeMap;
|
|
10
|
-
};
|
|
11
|
-
export declare function Spinner({ tone, size, data }: SpinnerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
|
-
export declare namespace Spinner {
|
|
13
|
-
var displayName: string;
|
|
14
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var react = require('@emotion/react');
|
|
6
|
-
var a11y = require('@spark-web/a11y');
|
|
7
|
-
var box = require('@spark-web/box');
|
|
8
|
-
var icon = require('@spark-web/icon');
|
|
9
|
-
var utils = require('@spark-web/utils');
|
|
10
|
-
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
11
|
-
|
|
12
|
-
function Spinner(_ref) {
|
|
13
|
-
var tone = _ref.tone,
|
|
14
|
-
_ref$size = _ref.size,
|
|
15
|
-
size = _ref$size === void 0 ? 'xxsmall' : _ref$size,
|
|
16
|
-
data = _ref.data;
|
|
17
|
-
var spinAnimationRef = utils.useSynchronizedAnimation(spinAnimation);
|
|
18
|
-
var strokeAnimationRef = utils.useSynchronizedAnimation(strokeDashAnimation);
|
|
19
|
-
var styles = useSpinnerStyles();
|
|
20
|
-
return jsxRuntime.jsxs(box.Box, {
|
|
21
|
-
as: "span",
|
|
22
|
-
ref: spinAnimationRef,
|
|
23
|
-
css: react.css(styles),
|
|
24
|
-
height: size,
|
|
25
|
-
width: size,
|
|
26
|
-
display: "inline-flex",
|
|
27
|
-
alignItems: "center",
|
|
28
|
-
justifyContent: "center",
|
|
29
|
-
data: data,
|
|
30
|
-
children: [jsxRuntime.jsx(a11y.VisuallyHidden, {
|
|
31
|
-
children: "Image of a partial circle indicating \"loading\"."
|
|
32
|
-
}), jsxRuntime.jsx(SpinnerIcon, {
|
|
33
|
-
size: size,
|
|
34
|
-
tone: tone,
|
|
35
|
-
ref: strokeAnimationRef,
|
|
36
|
-
"aria-hidden": "true"
|
|
37
|
-
})]
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
Spinner.displayName = 'Spinner';
|
|
41
|
-
var SpinnerIcon = icon.createIcon(jsxRuntime.jsx("circle", {
|
|
42
|
-
cx: 12,
|
|
43
|
-
cy: 12,
|
|
44
|
-
r: 9
|
|
45
|
-
}), 'SpinnerIcon');
|
|
46
|
-
var spinAnimation = react.keyframes({
|
|
47
|
-
from: {
|
|
48
|
-
transform: 'rotate(0deg)'
|
|
49
|
-
},
|
|
50
|
-
to: {
|
|
51
|
-
transform: 'rotate(360deg)'
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
var strokeDashAnimation = react.keyframes({
|
|
55
|
-
'0%': {
|
|
56
|
-
strokeDasharray: '1px, 200px',
|
|
57
|
-
strokeDashoffset: 0
|
|
58
|
-
},
|
|
59
|
-
'100%': {
|
|
60
|
-
strokeDasharray: '200px, 200px',
|
|
61
|
-
strokeDashoffset: '-55px'
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
function useSpinnerStyles() {
|
|
65
|
-
return {
|
|
66
|
-
animation: "".concat(spinAnimation, " 1.4s linear infinite"),
|
|
67
|
-
'& circle': {
|
|
68
|
-
animation: "".concat(strokeDashAnimation, " 1.6s cubic-bezier(0.47, 0, 0.75, 0.72) infinite")
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
exports.Spinner = Spinner;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var react = require('@emotion/react');
|
|
6
|
-
var a11y = require('@spark-web/a11y');
|
|
7
|
-
var box = require('@spark-web/box');
|
|
8
|
-
var icon = require('@spark-web/icon');
|
|
9
|
-
var utils = require('@spark-web/utils');
|
|
10
|
-
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
11
|
-
|
|
12
|
-
function Spinner(_ref) {
|
|
13
|
-
var tone = _ref.tone,
|
|
14
|
-
_ref$size = _ref.size,
|
|
15
|
-
size = _ref$size === void 0 ? 'xxsmall' : _ref$size,
|
|
16
|
-
data = _ref.data;
|
|
17
|
-
var spinAnimationRef = utils.useSynchronizedAnimation(spinAnimation);
|
|
18
|
-
var strokeAnimationRef = utils.useSynchronizedAnimation(strokeDashAnimation);
|
|
19
|
-
var styles = useSpinnerStyles();
|
|
20
|
-
return jsxRuntime.jsxs(box.Box, {
|
|
21
|
-
as: "span",
|
|
22
|
-
ref: spinAnimationRef,
|
|
23
|
-
css: react.css(styles),
|
|
24
|
-
height: size,
|
|
25
|
-
width: size,
|
|
26
|
-
display: "inline-flex",
|
|
27
|
-
alignItems: "center",
|
|
28
|
-
justifyContent: "center",
|
|
29
|
-
data: data,
|
|
30
|
-
children: [jsxRuntime.jsx(a11y.VisuallyHidden, {
|
|
31
|
-
children: "Image of a partial circle indicating \"loading\"."
|
|
32
|
-
}), jsxRuntime.jsx(SpinnerIcon, {
|
|
33
|
-
size: size,
|
|
34
|
-
tone: tone,
|
|
35
|
-
ref: strokeAnimationRef,
|
|
36
|
-
"aria-hidden": "true"
|
|
37
|
-
})]
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
Spinner.displayName = 'Spinner';
|
|
41
|
-
var SpinnerIcon = icon.createIcon(jsxRuntime.jsx("circle", {
|
|
42
|
-
cx: 12,
|
|
43
|
-
cy: 12,
|
|
44
|
-
r: 9
|
|
45
|
-
}), 'SpinnerIcon');
|
|
46
|
-
var spinAnimation = react.keyframes({
|
|
47
|
-
from: {
|
|
48
|
-
transform: 'rotate(0deg)'
|
|
49
|
-
},
|
|
50
|
-
to: {
|
|
51
|
-
transform: 'rotate(360deg)'
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
var strokeDashAnimation = react.keyframes({
|
|
55
|
-
'0%': {
|
|
56
|
-
strokeDasharray: '1px, 200px',
|
|
57
|
-
strokeDashoffset: 0
|
|
58
|
-
},
|
|
59
|
-
'100%': {
|
|
60
|
-
strokeDasharray: '200px, 200px',
|
|
61
|
-
strokeDashoffset: '-55px'
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
function useSpinnerStyles() {
|
|
65
|
-
return {
|
|
66
|
-
animation: "".concat(spinAnimation, " 1.4s linear infinite"),
|
|
67
|
-
'& circle': {
|
|
68
|
-
animation: "".concat(strokeDashAnimation, " 1.6s cubic-bezier(0.47, 0, 0.75, 0.72) infinite")
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
exports.Spinner = Spinner;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { keyframes, css } from '@emotion/react';
|
|
2
|
-
import { VisuallyHidden } from '@spark-web/a11y';
|
|
3
|
-
import { Box } from '@spark-web/box';
|
|
4
|
-
import { createIcon } from '@spark-web/icon';
|
|
5
|
-
import { useSynchronizedAnimation } from '@spark-web/utils';
|
|
6
|
-
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
function Spinner(_ref) {
|
|
9
|
-
var tone = _ref.tone,
|
|
10
|
-
_ref$size = _ref.size,
|
|
11
|
-
size = _ref$size === void 0 ? 'xxsmall' : _ref$size,
|
|
12
|
-
data = _ref.data;
|
|
13
|
-
var spinAnimationRef = useSynchronizedAnimation(spinAnimation);
|
|
14
|
-
var strokeAnimationRef = useSynchronizedAnimation(strokeDashAnimation);
|
|
15
|
-
var styles = useSpinnerStyles();
|
|
16
|
-
return jsxs(Box, {
|
|
17
|
-
as: "span",
|
|
18
|
-
ref: spinAnimationRef,
|
|
19
|
-
css: css(styles),
|
|
20
|
-
height: size,
|
|
21
|
-
width: size,
|
|
22
|
-
display: "inline-flex",
|
|
23
|
-
alignItems: "center",
|
|
24
|
-
justifyContent: "center",
|
|
25
|
-
data: data,
|
|
26
|
-
children: [jsx(VisuallyHidden, {
|
|
27
|
-
children: "Image of a partial circle indicating \"loading\"."
|
|
28
|
-
}), jsx(SpinnerIcon, {
|
|
29
|
-
size: size,
|
|
30
|
-
tone: tone,
|
|
31
|
-
ref: strokeAnimationRef,
|
|
32
|
-
"aria-hidden": "true"
|
|
33
|
-
})]
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
Spinner.displayName = 'Spinner';
|
|
37
|
-
var SpinnerIcon = createIcon(jsx("circle", {
|
|
38
|
-
cx: 12,
|
|
39
|
-
cy: 12,
|
|
40
|
-
r: 9
|
|
41
|
-
}), 'SpinnerIcon');
|
|
42
|
-
var spinAnimation = keyframes({
|
|
43
|
-
from: {
|
|
44
|
-
transform: 'rotate(0deg)'
|
|
45
|
-
},
|
|
46
|
-
to: {
|
|
47
|
-
transform: 'rotate(360deg)'
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
var strokeDashAnimation = keyframes({
|
|
51
|
-
'0%': {
|
|
52
|
-
strokeDasharray: '1px, 200px',
|
|
53
|
-
strokeDashoffset: 0
|
|
54
|
-
},
|
|
55
|
-
'100%': {
|
|
56
|
-
strokeDasharray: '200px, 200px',
|
|
57
|
-
strokeDashoffset: '-55px'
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
function useSpinnerStyles() {
|
|
61
|
-
return {
|
|
62
|
-
animation: "".concat(spinAnimation, " 1.4s linear infinite"),
|
|
63
|
-
'& circle': {
|
|
64
|
-
animation: "".concat(strokeDashAnimation, " 1.6s cubic-bezier(0.47, 0, 0.75, 0.72) infinite")
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export { Spinner };
|