@fluentui/react-spinner 0.0.0-nightly-20220422-0419.1

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 (63) hide show
  1. package/CHANGELOG.json +173 -0
  2. package/CHANGELOG.md +71 -0
  3. package/LICENSE +15 -0
  4. package/MIGRATION.md +17 -0
  5. package/README.md +28 -0
  6. package/Spec.md +135 -0
  7. package/dist/react-spinner.d.ts +89 -0
  8. package/lib/Spinner.d.ts +1 -0
  9. package/lib/Spinner.js +2 -0
  10. package/lib/Spinner.js.map +1 -0
  11. package/lib/components/Spinner/DefaultSvg.d.ts +1 -0
  12. package/lib/components/Spinner/DefaultSvg.js +10 -0
  13. package/lib/components/Spinner/DefaultSvg.js.map +1 -0
  14. package/lib/components/Spinner/Spinner.d.ts +6 -0
  15. package/lib/components/Spinner/Spinner.js +15 -0
  16. package/lib/components/Spinner/Spinner.js.map +1 -0
  17. package/lib/components/Spinner/Spinner.types.d.ts +51 -0
  18. package/lib/components/Spinner/Spinner.types.js +2 -0
  19. package/lib/components/Spinner/Spinner.types.js.map +1 -0
  20. package/lib/components/Spinner/index.d.ts +5 -0
  21. package/lib/components/Spinner/index.js +6 -0
  22. package/lib/components/Spinner/index.js.map +1 -0
  23. package/lib/components/Spinner/renderSpinner.d.ts +5 -0
  24. package/lib/components/Spinner/renderSpinner.js +22 -0
  25. package/lib/components/Spinner/renderSpinner.js.map +1 -0
  26. package/lib/components/Spinner/useSpinner.d.ts +12 -0
  27. package/lib/components/Spinner/useSpinner.js +66 -0
  28. package/lib/components/Spinner/useSpinner.js.map +1 -0
  29. package/lib/components/Spinner/useSpinnerStyles.d.ts +7 -0
  30. package/lib/components/Spinner/useSpinnerStyles.js +249 -0
  31. package/lib/components/Spinner/useSpinnerStyles.js.map +1 -0
  32. package/lib/index.d.ts +2 -0
  33. package/lib/index.js +2 -0
  34. package/lib/index.js.map +1 -0
  35. package/lib/tsdoc-metadata.json +11 -0
  36. package/lib-commonjs/Spinner.d.ts +1 -0
  37. package/lib-commonjs/Spinner.js +10 -0
  38. package/lib-commonjs/Spinner.js.map +1 -0
  39. package/lib-commonjs/components/Spinner/DefaultSvg.d.ts +1 -0
  40. package/lib-commonjs/components/Spinner/DefaultSvg.js +20 -0
  41. package/lib-commonjs/components/Spinner/DefaultSvg.js.map +1 -0
  42. package/lib-commonjs/components/Spinner/Spinner.d.ts +6 -0
  43. package/lib-commonjs/components/Spinner/Spinner.js +26 -0
  44. package/lib-commonjs/components/Spinner/Spinner.js.map +1 -0
  45. package/lib-commonjs/components/Spinner/Spinner.types.d.ts +51 -0
  46. package/lib-commonjs/components/Spinner/Spinner.types.js +6 -0
  47. package/lib-commonjs/components/Spinner/Spinner.types.js.map +1 -0
  48. package/lib-commonjs/components/Spinner/index.d.ts +5 -0
  49. package/lib-commonjs/components/Spinner/index.js +18 -0
  50. package/lib-commonjs/components/Spinner/index.js.map +1 -0
  51. package/lib-commonjs/components/Spinner/renderSpinner.d.ts +5 -0
  52. package/lib-commonjs/components/Spinner/renderSpinner.js +33 -0
  53. package/lib-commonjs/components/Spinner/renderSpinner.js.map +1 -0
  54. package/lib-commonjs/components/Spinner/useSpinner.d.ts +12 -0
  55. package/lib-commonjs/components/Spinner/useSpinner.js +79 -0
  56. package/lib-commonjs/components/Spinner/useSpinner.js.map +1 -0
  57. package/lib-commonjs/components/Spinner/useSpinnerStyles.d.ts +7 -0
  58. package/lib-commonjs/components/Spinner/useSpinnerStyles.js +260 -0
  59. package/lib-commonjs/components/Spinner/useSpinnerStyles.js.map +1 -0
  60. package/lib-commonjs/index.d.ts +2 -0
  61. package/lib-commonjs/index.js +40 -0
  62. package/lib-commonjs/index.js.map +1 -0
  63. package/package.json +61 -0
package/CHANGELOG.json ADDED
@@ -0,0 +1,173 @@
1
+ {
2
+ "name": "@fluentui/react-spinner",
3
+ "entries": [
4
+ {
5
+ "date": "Fri, 22 Apr 2022 04:28:36 GMT",
6
+ "tag": "@fluentui/react-spinner_v0.0.0-nightly-20220422-0419.1",
7
+ "version": "0.0.0-nightly-20220422-0419.1",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "email not defined",
12
+ "package": "@fluentui/react-spinner",
13
+ "commit": "not available",
14
+ "comment": "Release nightly v9"
15
+ },
16
+ {
17
+ "author": "ololubek@microsoft.com",
18
+ "package": "@fluentui/react-spinner",
19
+ "commit": "1cfb2361e0c8de06d93d0ba0578a809aaa5d0c0b",
20
+ "comment": "Reexport react-spinner in react-components"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-spinner",
25
+ "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20220422-0419.1",
26
+ "commit": "0dbe6a48dea9ac8bef02ea228baf4172014f9ac9"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-spinner",
31
+ "comment": "Bump @fluentui/react-label to v0.0.0-nightly-20220422-0419.1",
32
+ "commit": "0dbe6a48dea9ac8bef02ea228baf4172014f9ac9"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-spinner",
37
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20220422-0419.1",
38
+ "commit": "0dbe6a48dea9ac8bef02ea228baf4172014f9ac9"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-spinner",
43
+ "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20220422-0419.1",
44
+ "commit": "0dbe6a48dea9ac8bef02ea228baf4172014f9ac9"
45
+ }
46
+ ]
47
+ }
48
+ },
49
+ {
50
+ "date": "Tue, 19 Apr 2022 19:17:29 GMT",
51
+ "tag": "@fluentui/react-spinner_v9.0.0-beta.6",
52
+ "version": "9.0.0-beta.6",
53
+ "comments": {
54
+ "prerelease": [
55
+ {
56
+ "author": "beachball",
57
+ "package": "@fluentui/react-spinner",
58
+ "comment": "Bump @fluentui/react-theme to v9.0.0-rc.5",
59
+ "commit": "f94b48c825ca8c8b2e3b6755bdd29fe15c7d435d"
60
+ },
61
+ {
62
+ "author": "beachball",
63
+ "package": "@fluentui/react-spinner",
64
+ "comment": "Bump @fluentui/react-label to v9.0.0-beta.10",
65
+ "commit": "f94b48c825ca8c8b2e3b6755bdd29fe15c7d435d"
66
+ },
67
+ {
68
+ "author": "beachball",
69
+ "package": "@fluentui/react-spinner",
70
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.6",
71
+ "commit": "f94b48c825ca8c8b2e3b6755bdd29fe15c7d435d"
72
+ },
73
+ {
74
+ "author": "beachball",
75
+ "package": "@fluentui/react-spinner",
76
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.4",
77
+ "commit": "f94b48c825ca8c8b2e3b6755bdd29fe15c7d435d"
78
+ }
79
+ ]
80
+ }
81
+ },
82
+ {
83
+ "date": "Fri, 04 Mar 2022 05:17:40 GMT",
84
+ "tag": "@fluentui/react-spinner_v9.0.0-beta.6",
85
+ "version": "9.0.0-beta.6",
86
+ "comments": {
87
+ "prerelease": [
88
+ {
89
+ "author": "beachball",
90
+ "package": "@fluentui/react-spinner",
91
+ "comment": "Bump @fluentui/react-theme to v9.0.0-rc.4",
92
+ "commit": "1494f0b620f6d5aae7f0aef33fc9e8f6eb7f8749"
93
+ },
94
+ {
95
+ "author": "beachball",
96
+ "package": "@fluentui/react-spinner",
97
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.5",
98
+ "commit": "1494f0b620f6d5aae7f0aef33fc9e8f6eb7f8749"
99
+ }
100
+ ]
101
+ }
102
+ },
103
+ {
104
+ "date": "Tue, 01 Mar 2022 02:17:40 GMT",
105
+ "tag": "@fluentui/react-spinner_v9.0.0-beta.6",
106
+ "version": "9.0.0-beta.6",
107
+ "comments": {
108
+ "prerelease": [
109
+ {
110
+ "author": "beachball",
111
+ "package": "@fluentui/react-spinner",
112
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.4",
113
+ "commit": "0bc1e755543ed69443d5d03e1976c630583242f7"
114
+ }
115
+ ]
116
+ }
117
+ },
118
+ {
119
+ "date": "Fri, 18 Feb 2022 13:35:38 GMT",
120
+ "tag": "@fluentui/react-spinner_v9.0.0-beta.6",
121
+ "version": "9.0.0-beta.6",
122
+ "comments": {
123
+ "prerelease": [
124
+ {
125
+ "author": "beachball",
126
+ "package": "@fluentui/react-spinner",
127
+ "comment": "Bump @fluentui/react-theme to v9.0.0-rc.3",
128
+ "commit": "3b9c1e931c23173da3d1af0c696cdc58516ce504"
129
+ },
130
+ {
131
+ "author": "beachball",
132
+ "package": "@fluentui/react-spinner",
133
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.3",
134
+ "commit": "3b9c1e931c23173da3d1af0c696cdc58516ce504"
135
+ },
136
+ {
137
+ "author": "beachball",
138
+ "package": "@fluentui/react-spinner",
139
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.3",
140
+ "commit": "3b9c1e931c23173da3d1af0c696cdc58516ce504"
141
+ }
142
+ ]
143
+ }
144
+ },
145
+ {
146
+ "date": "Thu, 10 Feb 2022 08:52:26 GMT",
147
+ "tag": "@fluentui/react-spinner_v9.0.0-beta.5",
148
+ "version": "9.0.0-beta.5",
149
+ "comments": {
150
+ "prerelease": [
151
+ {
152
+ "author": "beachball",
153
+ "package": "@fluentui/react-spinner",
154
+ "comment": "Bump @fluentui/react-theme to v9.0.0-rc.1",
155
+ "commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8"
156
+ },
157
+ {
158
+ "author": "beachball",
159
+ "package": "@fluentui/react-spinner",
160
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.1",
161
+ "commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8"
162
+ },
163
+ {
164
+ "author": "beachball",
165
+ "package": "@fluentui/react-spinner",
166
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.1",
167
+ "commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8"
168
+ }
169
+ ]
170
+ }
171
+ }
172
+ ]
173
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,71 @@
1
+ # Change Log - @fluentui/react-spinner
2
+
3
+ This log was last generated on Fri, 22 Apr 2022 04:28:36 GMT and should not be manually modified.
4
+
5
+ <!-- Start content -->
6
+
7
+ ## [0.0.0-nightly-20220422-0419.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v0.0.0-nightly-20220422-0419.1)
8
+
9
+ Fri, 22 Apr 2022 04:28:36 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.0.0-beta.6..@fluentui/react-spinner_v0.0.0-nightly-20220422-0419.1)
11
+
12
+ ### Changes
13
+
14
+ - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by email not defined)
15
+ - Reexport react-spinner in react-components ([PR #22531](https://github.com/microsoft/fluentui/pull/22531) by ololubek@microsoft.com)
16
+ - Bump @fluentui/react-theme to v0.0.0-nightly-20220422-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/0dbe6a48dea9ac8bef02ea228baf4172014f9ac9) by beachball)
17
+ - Bump @fluentui/react-label to v0.0.0-nightly-20220422-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/0dbe6a48dea9ac8bef02ea228baf4172014f9ac9) by beachball)
18
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20220422-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/0dbe6a48dea9ac8bef02ea228baf4172014f9ac9) by beachball)
19
+ - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20220422-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/0dbe6a48dea9ac8bef02ea228baf4172014f9ac9) by beachball)
20
+
21
+ ## [9.0.0-beta.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.0.0-beta.6)
22
+
23
+ Tue, 19 Apr 2022 19:17:29 GMT
24
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.0.0-beta.6..@fluentui/react-spinner_v9.0.0-beta.6)
25
+
26
+ ### Changes
27
+
28
+ - Bump @fluentui/react-theme to v9.0.0-rc.5 ([PR #21995](https://github.com/microsoft/fluentui/pull/21995) by beachball)
29
+ - Bump @fluentui/react-label to v9.0.0-beta.10 ([PR #21995](https://github.com/microsoft/fluentui/pull/21995) by beachball)
30
+ - Bump @fluentui/react-utilities to v9.0.0-rc.6 ([PR #21995](https://github.com/microsoft/fluentui/pull/21995) by beachball)
31
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.4 ([PR #21995](https://github.com/microsoft/fluentui/pull/21995) by beachball)
32
+
33
+ ## [9.0.0-beta.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.0.0-beta.6)
34
+
35
+ Fri, 04 Mar 2022 05:17:40 GMT
36
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.0.0-beta.6..@fluentui/react-spinner_v9.0.0-beta.6)
37
+
38
+ ### Changes
39
+
40
+ - Bump @fluentui/react-theme to v9.0.0-rc.4 ([PR #21947](https://github.com/microsoft/fluentui/pull/21947) by beachball)
41
+ - Bump @fluentui/react-utilities to v9.0.0-rc.5 ([PR #21947](https://github.com/microsoft/fluentui/pull/21947) by beachball)
42
+
43
+ ## [9.0.0-beta.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.0.0-beta.6)
44
+
45
+ Tue, 01 Mar 2022 02:17:40 GMT
46
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.0.0-beta.6..@fluentui/react-spinner_v9.0.0-beta.6)
47
+
48
+ ### Changes
49
+
50
+ - Bump @fluentui/react-utilities to v9.0.0-rc.4 ([PR #21884](https://github.com/microsoft/fluentui/pull/21884) by beachball)
51
+
52
+ ## [9.0.0-beta.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.0.0-beta.6)
53
+
54
+ Fri, 18 Feb 2022 13:35:38 GMT
55
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.0.0-beta.5..@fluentui/react-spinner_v9.0.0-beta.6)
56
+
57
+ ### Changes
58
+
59
+ - Bump @fluentui/react-theme to v9.0.0-rc.3 ([PR #21800](https://github.com/microsoft/fluentui/pull/21800) by beachball)
60
+ - Bump @fluentui/react-utilities to v9.0.0-rc.3 ([PR #21800](https://github.com/microsoft/fluentui/pull/21800) by beachball)
61
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.3 ([PR #21800](https://github.com/microsoft/fluentui/pull/21800) by beachball)
62
+
63
+ ## [9.0.0-beta.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.0.0-beta.5)
64
+
65
+ Thu, 10 Feb 2022 08:52:26 GMT
66
+
67
+ ### Changes
68
+
69
+ - Bump @fluentui/react-theme to v9.0.0-rc.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball)
70
+ - Bump @fluentui/react-utilities to v9.0.0-rc.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball)
71
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball)
package/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ @fluentui/react-spinner
2
+
3
+ Copyright (c) Microsoft Corporation
4
+
5
+ All rights reserved.
6
+
7
+ MIT License
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+
15
+ Note: Usage of the fonts and icons referenced in Fluent UI React is subject to the terms listed at https://aka.ms/fluentui-assets-license
package/MIGRATION.md ADDED
@@ -0,0 +1,17 @@
1
+ # Spinner Migration
2
+
3
+ ## Migration from v0
4
+
5
+ - `Loader`
6
+ - `inline` => Not supported.
7
+ - `labelPosition` => 'start' and 'end' changed to 'before' and 'after'
8
+ - `size` => There are the same number of sizes
9
+ - `delay` => Not supported.
10
+
11
+ ## Migration from v8
12
+
13
+ - `Spinner`
14
+ - `ariaLabel` => use `aria-label` instead.
15
+ - `ariaLive` => use `aria-live` instead.
16
+ - `componentRef` => use `ref` instead.
17
+ - `theme` => Not supported. Use a `ThemeProvider` control instead.
package/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # @fluentui/react-spinner
2
+
3
+ **React Spinner components for [Fluent UI React](https://developer.microsoft.com/en-us/fluentui)**
4
+
5
+ The Spinner is an outline of a circle which animates around itself indicating to the user that things are processing. Spinner is typically an indeterminate ProgressIndicator that is used when it is unknown how long a task will take to complete. They can be various sizes, located inline with content or centered. They generally appear while an action is being processed or committed. They are subtle and generally do not take up much space, but are transitions from the completed task
6
+
7
+ These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
8
+
9
+ ## Usage
10
+
11
+ To import Spinner:
12
+
13
+ ```js
14
+ import { Spinner } from '@fluentui/react-spinner';
15
+ ```
16
+
17
+ Once the Spinner component is ready for production use, the component will be available at:
18
+
19
+ ```js
20
+ import { Spinner } from '@fluentui/react-components';
21
+ ```
22
+
23
+ ### Examples
24
+
25
+ ```js
26
+ <Spinner label="Loading..." />
27
+ <Spinner size="large" />
28
+ ```
package/Spec.md ADDED
@@ -0,0 +1,135 @@
1
+ # @fluentui/react-spinner Spec
2
+
3
+ ## Background
4
+
5
+ A Spinner is an outline of a circle which animates around itself indicating to the user that things are processing. Spinner is typically an indeterminate ProgressIndicator that is used when it is unknown how long a task will take to complete. They can be various sizes, located inline with content or centered. They generally appear while an action is being processed or committed. They are subtle and generally do not take up much space, but are transitions from the completed task.
6
+
7
+ ## Prior Art
8
+
9
+ ### Open UI
10
+
11
+ | Library | Component Name | Spec Link | Notes |
12
+ | ----------------------- | ------------------ | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
13
+ | Chakra UI | `CircularProgress` | [CircularProgress](https://chakra-ui.com/docs/feedback/circular-progress) | `CircularProgress` has determinate and indeterminate forms, with props that give user the ability to change size, value, line thickness, and a min and max value, and add a label |
14
+ | Material UI | `CircularProgress` | [CircularProgress](https://mui.com/components/progress/#progress) | `CircularProgress` has determinate and indeterminate, allows users to change color, add value, and add a label |
15
+ | Carbon | `InlineLoading` | [InlineLoading](https://www.carbondesignsystem.com/components/inline-loading/usage) | `InlineLoading` only has an indeterminate form, with four states: `inactive`, `active`, `finished`, `error` |
16
+ | FluentUI Northstar | `Loader` | [Loader](https://fluentsite.z22.web.core.windows.net/0.57.0/components/loader/definition) | `Loader` has a `delay` prop that specifies how long to wait before the `Loader` is visible on the page. You can also render a custom svg as the image, and use the `as` prop to choose whether to render the loader as a string or a component. Other props include `inline`, `label`, and `size` |
17
+ | Latitude Design System | `Loader` | [Loader](https://www.flexport.com/design/components/loaders#Loader) | This is a simple loader that allows users to modify size and whether the loader is inline |
18
+ | Orbit | `Loading` | [Loading](https://orbit.kiwi/components/progress-indicators/loading/) | Simple loader with animation and text |
19
+ | Elastic UI | `LoadingSpinner` | [LoadingSpinner](https://elastic.github.io/eui/#/display/loading#spinner) | Simple spinner |
20
+ | Adobe Spectrum | `ProgressCircle` | [ProgressCircle](https://spectrum.adobe.com/page/progress-circle/) | It has a default and an over background state. It also has a min and max value setting, as well as a size, determinate, and indeterminate |
21
+ | Ant Design | `Spin` | [Spin](https://ant.design/components/spin/) | Can change size, add a delay, and render a custom spinner |
22
+ | Atlassian Design System | `Spinner` | [Spinner](https://atlassian.design/components/spinner/examples) | Has a default Spinner, with ability to change size(there are preset size options, with the ability to render the spinner with a custom size). Can also delay the Spinner, and use present animations such as `FadeIn` |
23
+ | Base Web | `Spinner` | [Spinner](https://baseweb.design/components/spinner#api) | Started out with a simple Spinner with a size, color, and title prop, but adds an override prop that lets you customize the look and feel of the Spinner |
24
+ | Blueprint | `Spinner` | [Spinner](https://blueprintjs.com/docs/#core/components/spinner) | Has a value prop to allow for determinate or indeterminate Spinners, and a size prop with preset sizes provided as an ENUM |
25
+ | Evergreen Design System | `Spinner` | [Spinner](https://evergreen.segment.com/components/spinner) | Default Spinner that allows you to change size and add a delay, as well as render it centered in a div |
26
+ | Fabric | `Spinner` | [Spinner](https://developer.microsoft.com/en-us/fluentui#/controls/web/spinner) | This Spinner has specific aria attributes as props as well as label and size props to modify the default Spinner |
27
+ | GitLab Design System | `Spinner` | [Spinner](https://design.gitlab.com/components/spinner) | Can change size, color, and set inline. Comes with a default 100ms delay |
28
+ | Paste | `Spinner` | [Spinner](https://paste.twilio.design/components/spinner/#paste-docs-content-area) | Contains many elements present in other design systems' Spinners: delay, size, color, and as props. Notably, no determinate or indeterminate forms |
29
+ | Primer | `Spinner` | [Spinner](https://primer.style/react/Spinner) | Default Spinner with a size prop |
30
+ | Garden | `Spinner` | [Spinner](https://garden.zendesk.com/components/spinner) | Default Spinner with color and size prop |
31
+ | Polaris | `Spinner` | [Spinner](https://polaris.shopify.com/components/feedback-indicators/spinner) | Default Spinner with a size prop, with preset small and large values |
32
+ | Lightning Design System | `Spinner` | [Spinner](https://react.lightningdesignsystem.com/components/spinners/) | A more robust indeterminate Spinner with props that allow the Spinner to be rendered in a container, add styling to said container, inline the Spinner, and change the size |
33
+
34
+ ### Comparison of v8 and v0
35
+
36
+ The existing components are:
37
+
38
+ - v8
39
+ - `Spinner`
40
+ - v0
41
+ - `Loader`
42
+ - Both `Spinner` and `Loader` have very similar props
43
+ - `Loader` has `delay`, while `Spinner` has aria props exposed for accessibility.
44
+
45
+ ## Sample Code
46
+
47
+ Basic examples:
48
+
49
+ ```jsx=
50
+ import { Spinner } from "@fluentui/react-spinner";
51
+
52
+ function App() {
53
+ return (
54
+ <Spinner size="medium" label="Loading" />
55
+ )
56
+ }
57
+
58
+ ```
59
+
60
+ ## Variants
61
+
62
+ - Indeterminate Spinner
63
+ - The default Spinner that spins around indefinitely
64
+
65
+ ### Shape
66
+
67
+ The Spinner is represented as a circle with an arc of a darker shade rotating the circumfrence
68
+
69
+ ## API
70
+
71
+ From [Spinner.types.tsx](https://github.com/microsoft/fluentui/blob/master/packages/react-spinner/src/components/Spinner/Spinner.types.ts)
72
+
73
+ ### Slots
74
+
75
+ - `root` - The root element of the Spinner. The html element is a `span`
76
+ - `loader` - The svg element that gets animated into a Spinner. The html element is `svg`
77
+ - `label` - The text shown with the Spinner. This uses the `Text` control
78
+
79
+ ### Props
80
+
81
+ ```jsx
82
+ export type SpinnerProps = ComponentProps &
83
+ React.HTMLAttributes<HTMLElement> & {
84
+ /* The appearance of the Spinner*/
85
+ appearance?: 'primary' | 'inverted',
86
+ /* The labelPosition prop allows user to set the location of the label*/
87
+ labelPosition?: 'above' | 'below' | 'before' | 'after',
88
+ /* The size prop sets the size of the Spinner
89
+ * @defaultValue "medium"*/
90
+ size?: 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large' | 'huge',
91
+ // inactive ? : boolean
92
+ status?: 'active' | 'inactive',
93
+ };
94
+ ```
95
+
96
+ ## Structure
97
+
98
+ ```html
99
+ <span class="fui-Spinner">
100
+ <!-- Label for Spinner -->
101
+ <span className="fui-Spinner__label">Loading...</span>
102
+ <span className="fui-Spinner__spinner">
103
+ <!-- Svg that receives the animation. Classnames are used for animation -->
104
+ <svg role="progressbar" className="fui-Spinner__Progressbar">
105
+ <circle className="fui-Spinner__Track" />
106
+ <circle className="fui-Spinner__Tail" />
107
+ </svg>
108
+ </span>
109
+ </span>
110
+ ```
111
+
112
+ ## Migration
113
+
114
+ See [MIGRATION.md]().
115
+
116
+ ## Behaviors
117
+
118
+ ### States
119
+
120
+ - **Display** - The Spinner will use the following priority:
121
+
122
+ - Adding the `inverted` will alter the way that the Spinner is displayed.
123
+
124
+ ### Interaction
125
+
126
+ The Spinner is non-interactive.
127
+
128
+ - **Keyboard** - Not keyboard focusable.
129
+ - **Mouse**
130
+
131
+ - Click: No action
132
+
133
+ - **Touch** - Nothing
134
+
135
+ ## Accessibility
@@ -0,0 +1,89 @@
1
+ import type { ComponentProps } from '@fluentui/react-utilities';
2
+ import type { ComponentState } from '@fluentui/react-utilities';
3
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
4
+ import { Label } from '@fluentui/react-label';
5
+ import * as React_2 from 'react';
6
+ import type { Slot } from '@fluentui/react-utilities';
7
+ import type { SlotClassNames } from '@fluentui/react-utilities';
8
+
9
+ /**
10
+ * Render the final JSX of Spinner
11
+ */
12
+ export declare const renderSpinner_unstable: (state: SpinnerState) => JSX.Element;
13
+
14
+ /**
15
+ * Converged Spinner component for the fluentui repo
16
+ */
17
+ export declare const Spinner: ForwardRefComponent<SpinnerProps>;
18
+
19
+ export declare const spinnerClassNames: SlotClassNames<SpinnerSlots>;
20
+
21
+ declare type SpinnerCommons = {
22
+ /**
23
+ * The appearance of the Spinner.
24
+ * @default 'primary'
25
+ */
26
+ appearance?: 'primary' | 'inverted';
27
+ /**
28
+ * Where the label is positioned relative to the Spinner
29
+ * @default 'after'
30
+ */
31
+ labelPosition?: 'above' | 'below' | 'before' | 'after';
32
+ /**
33
+ * The size of the spinner.
34
+ * @default 'medium'
35
+ */
36
+ size?: 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large' | 'huge';
37
+ /**
38
+ * The status of the Spinner.
39
+ * @default 'active'
40
+ */
41
+ status?: 'active' | 'inactive';
42
+ };
43
+
44
+ /**
45
+ * Spinner Props
46
+ */
47
+ export declare type SpinnerProps = Omit<ComponentProps<SpinnerSlots>, 'size'> & Partial<SpinnerCommons>;
48
+
49
+ export declare type SpinnerSlots = {
50
+ /**
51
+ * The root of the Spinner.
52
+ * The root slot receives the `className` and `style` specified directly on the `<Spinner>`.
53
+ */
54
+ root: NonNullable<Slot<'div'>>;
55
+ /**
56
+ * The slot for the animated svg.
57
+ * The spinner slot receives the `className` and `style` that handles the spinning animation.
58
+ * An svg is also rendered as a child of this slot
59
+ */
60
+ spinner?: Slot<'span'>;
61
+ /**
62
+ * The label of the Slider.
63
+ * The label slot receives the styling related to the text associated with the Spinner.
64
+ */
65
+ label?: Slot<typeof Label>;
66
+ };
67
+
68
+ /**
69
+ * State used in rendering Spinner
70
+ */
71
+ export declare type SpinnerState = ComponentState<SpinnerSlots> & SpinnerCommons;
72
+
73
+ /**
74
+ * Create the state required to render Spinner.
75
+ *
76
+ * The returned state can be modified with hooks such as useSpinnerStyles_unstable,
77
+ * before being passed to renderSpinner_unstable.
78
+ *
79
+ * @param props - props from this instance of Spinner
80
+ * @param ref - reference to root HTMLElement of Spinner
81
+ */
82
+ export declare const useSpinner_unstable: (props: SpinnerProps, ref: React_2.Ref<HTMLElement>) => SpinnerState;
83
+
84
+ /**
85
+ * Apply styling to the Spinner slots based on the state
86
+ */
87
+ export declare const useSpinnerStyles_unstable: (state: SpinnerState) => SpinnerState;
88
+
89
+ export { }
@@ -0,0 +1 @@
1
+ export * from './components/Spinner/index';
package/lib/Spinner.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './components/Spinner/index';
2
+ //# sourceMappingURL=Spinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.js","sourceRoot":"../src/","sources":["Spinner.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './components/Spinner/index';\n"]}
@@ -0,0 +1 @@
1
+ export declare const DefaultSvg: () => JSX.Element;
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ export const DefaultSvg = () => /*#__PURE__*/React.createElement("svg", {
3
+ role: "progressbar",
4
+ className: "fui-Spinner__Progressbar"
5
+ }, /*#__PURE__*/React.createElement("circle", {
6
+ className: "fui-Spinner__Track"
7
+ }), /*#__PURE__*/React.createElement("circle", {
8
+ className: "fui-Spinner__Tail"
9
+ }));
10
+ //# sourceMappingURL=DefaultSvg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/Spinner/DefaultSvg.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,OAAO,MAAM,UAAU,GAAG,mBACxB,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAK,EAAA,IAAI,EAAC,aAAV;AAAwB,EAAA,SAAS,EAAC;AAAlC,CAAA,eACE,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA;AAAQ,EAAA,SAAS,EAAC;AAAlB,CAAA,CADF,eAEE,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA;AAAQ,EAAA,SAAS,EAAC;AAAlB,CAAA,CAFF,CADK","sourcesContent":["import * as React from 'react';\n\nexport const DefaultSvg = () => (\n <svg role=\"progressbar\" className=\"fui-Spinner__Progressbar\">\n <circle className=\"fui-Spinner__Track\" />\n <circle className=\"fui-Spinner__Tail\" />\n </svg>\n);\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,6 @@
1
+ import type { SpinnerProps } from './Spinner.types';
2
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
+ /**
4
+ * Converged Spinner component for the fluentui repo
5
+ */
6
+ export declare const Spinner: ForwardRefComponent<SpinnerProps>;
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import { useSpinner_unstable } from './useSpinner';
3
+ import { renderSpinner_unstable } from './renderSpinner';
4
+ import { useSpinnerStyles_unstable } from './useSpinnerStyles';
5
+ /**
6
+ * Converged Spinner component for the fluentui repo
7
+ */
8
+
9
+ export const Spinner = /*#__PURE__*/React.forwardRef((props, ref) => {
10
+ const state = useSpinner_unstable(props, ref);
11
+ useSpinnerStyles_unstable(state);
12
+ return renderSpinner_unstable(state);
13
+ });
14
+ Spinner.displayName = 'Spinner';
15
+ //# sourceMappingURL=Spinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/Spinner/Spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,mBAAT,QAAoC,cAApC;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AAIA;;AAEG;;AACH,OAAO,MAAM,OAAO,gBAAsC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACxF,QAAM,KAAK,GAAG,mBAAmB,CAAC,KAAD,EAAQ,GAAR,CAAjC;AAEA,EAAA,yBAAyB,CAAC,KAAD,CAAzB;AACA,SAAO,sBAAsB,CAAC,KAAD,CAA7B;AACD,CALyD,CAAnD;AAOP,OAAO,CAAC,WAAR,GAAsB,SAAtB","sourcesContent":["import * as React from 'react';\nimport { useSpinner_unstable } from './useSpinner';\nimport { renderSpinner_unstable } from './renderSpinner';\nimport { useSpinnerStyles_unstable } from './useSpinnerStyles';\nimport type { SpinnerProps } from './Spinner.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Converged Spinner component for the fluentui repo\n */\nexport const Spinner: ForwardRefComponent<SpinnerProps> = React.forwardRef((props, ref) => {\n const state = useSpinner_unstable(props, ref);\n\n useSpinnerStyles_unstable(state);\n return renderSpinner_unstable(state);\n});\n\nSpinner.displayName = 'Spinner';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,51 @@
1
+ import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
2
+ import { Label } from '@fluentui/react-label';
3
+ export declare type SpinnerSlots = {
4
+ /**
5
+ * The root of the Spinner.
6
+ * The root slot receives the `className` and `style` specified directly on the `<Spinner>`.
7
+ */
8
+ root: NonNullable<Slot<'div'>>;
9
+ /**
10
+ * The slot for the animated svg.
11
+ * The spinner slot receives the `className` and `style` that handles the spinning animation.
12
+ * An svg is also rendered as a child of this slot
13
+ */
14
+ spinner?: Slot<'span'>;
15
+ /**
16
+ * The label of the Slider.
17
+ * The label slot receives the styling related to the text associated with the Spinner.
18
+ */
19
+ label?: Slot<typeof Label>;
20
+ };
21
+ declare type SpinnerCommons = {
22
+ /**
23
+ * The appearance of the Spinner.
24
+ * @default 'primary'
25
+ */
26
+ appearance?: 'primary' | 'inverted';
27
+ /**
28
+ * Where the label is positioned relative to the Spinner
29
+ * @default 'after'
30
+ */
31
+ labelPosition?: 'above' | 'below' | 'before' | 'after';
32
+ /**
33
+ * The size of the spinner.
34
+ * @default 'medium'
35
+ */
36
+ size?: 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large' | 'huge';
37
+ /**
38
+ * The status of the Spinner.
39
+ * @default 'active'
40
+ */
41
+ status?: 'active' | 'inactive';
42
+ };
43
+ /**
44
+ * Spinner Props
45
+ */
46
+ export declare type SpinnerProps = Omit<ComponentProps<SpinnerSlots>, 'size'> & Partial<SpinnerCommons>;
47
+ /**
48
+ * State used in rendering Spinner
49
+ */
50
+ export declare type SpinnerState = ComponentState<SpinnerSlots> & SpinnerCommons;
51
+ export {};