@fluentui/react-spinner 9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 → 9.74.3-experimental.esm.20260709-49ee7a20cf.0
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 +98 -10
- package/dist/index.d.cts +128 -0
- package/dist/index.d.ts +21 -2
- package/lib/Spinner.js +1 -1
- package/lib/Spinner.js.map +1 -1
- package/lib/components/Spinner/Spinner.js +5 -5
- package/lib/components/Spinner/Spinner.js.map +1 -1
- package/lib/components/Spinner/Spinner.types.js +1 -1
- package/lib/components/Spinner/Spinner.types.js.map +1 -1
- package/lib/components/Spinner/index.js +4 -4
- package/lib/components/Spinner/index.js.map +1 -1
- package/lib/components/Spinner/renderSpinner.js +1 -1
- package/lib/components/Spinner/renderSpinner.js.map +1 -1
- package/lib/components/Spinner/useSpinner.js +32 -13
- package/lib/components/Spinner/useSpinner.js.map +1 -1
- package/lib/components/Spinner/useSpinnerStyles.styles.js +7 -5
- package/lib/components/Spinner/useSpinnerStyles.styles.js.map +1 -1
- package/lib/components/Spinner/useSpinnerStyles.styles.raw.js +7 -4
- package/lib/components/Spinner/useSpinnerStyles.styles.raw.js.map +1 -1
- package/lib/contexts/SpinnerContext.js +1 -1
- package/lib/contexts/SpinnerContext.js.map +1 -1
- package/lib/contexts/index.js +1 -1
- package/lib/contexts/index.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib-commonjs/{Spinner.js → Spinner.cjs} +4 -1
- package/lib-commonjs/Spinner.cjs.map +1 -0
- package/lib-commonjs/components/Spinner/{Spinner.js → Spinner.cjs} +3 -3
- package/lib-commonjs/components/Spinner/{Spinner.js.map → Spinner.cjs.map} +1 -1
- package/lib-commonjs/components/Spinner/{Spinner.types.js → Spinner.types.cjs} +1 -1
- package/lib-commonjs/components/Spinner/Spinner.types.cjs.map +1 -0
- package/lib-commonjs/components/Spinner/{index.js → index.cjs} +7 -4
- package/lib-commonjs/components/Spinner/index.cjs.map +1 -0
- package/lib-commonjs/components/Spinner/renderSpinner.cjs.map +1 -0
- package/lib-commonjs/components/Spinner/{useSpinner.js → useSpinner.cjs} +34 -13
- package/lib-commonjs/components/Spinner/useSpinner.cjs.map +1 -0
- package/lib-commonjs/components/Spinner/{useSpinnerStyles.styles.js → useSpinnerStyles.styles.cjs} +4 -1
- package/lib-commonjs/components/Spinner/useSpinnerStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/Spinner/{useSpinnerStyles.styles.raw.js → useSpinnerStyles.styles.raw.cjs} +4 -1
- package/lib-commonjs/components/Spinner/useSpinnerStyles.styles.raw.cjs.map +1 -0
- package/lib-commonjs/contexts/SpinnerContext.cjs.map +1 -0
- package/lib-commonjs/contexts/{index.js → index.cjs} +1 -1
- package/lib-commonjs/contexts/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/{index.js → index.cjs} +5 -2
- package/lib-commonjs/index.cjs.map +1 -0
- package/package.json +18 -12
- package/lib-commonjs/Spinner.js.map +0 -1
- package/lib-commonjs/components/Spinner/Spinner.types.js.map +0 -1
- package/lib-commonjs/components/Spinner/index.js.map +0 -1
- package/lib-commonjs/components/Spinner/renderSpinner.js.map +0 -1
- package/lib-commonjs/components/Spinner/useSpinner.js.map +0 -1
- package/lib-commonjs/components/Spinner/useSpinnerStyles.styles.js.map +0 -1
- package/lib-commonjs/components/Spinner/useSpinnerStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/contexts/SpinnerContext.js.map +0 -1
- package/lib-commonjs/index.js.map +0 -1
- /package/lib-commonjs/components/Spinner/{renderSpinner.js → renderSpinner.cjs} +0 -0
- /package/lib-commonjs/contexts/{SpinnerContext.js → SpinnerContext.cjs} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,22 +1,110 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-spinner
|
|
2
2
|
|
|
3
|
-
This log was last generated on Thu,
|
|
3
|
+
This log was last generated on Thu, 09 Jul 2026 17:34:18 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [9.
|
|
7
|
+
## [9.74.3-experimental.esm.20260709-49ee7a20cf.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.74.3-experimental.esm.20260709-49ee7a20cf.0)
|
|
8
8
|
|
|
9
|
-
Thu,
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.
|
|
9
|
+
Thu, 09 Jul 2026 17:34:18 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.8.4..@fluentui/react-spinner_v9.74.3-experimental.esm.20260709-49ee7a20cf.0)
|
|
11
11
|
|
|
12
12
|
### Changes
|
|
13
13
|
|
|
14
|
-
- Release 9.
|
|
15
|
-
- Bump @fluentui/react-jsx-runtime to v9.
|
|
16
|
-
- Bump @fluentui/react-label to v9.
|
|
17
|
-
- Bump @fluentui/react-shared-contexts to v9.
|
|
18
|
-
- Bump @fluentui/react-theme to v9.
|
|
19
|
-
- Bump @fluentui/react-utilities to v9.
|
|
14
|
+
- Release 9.74.3-experimental.esm.20260709-49ee7a20cf ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
|
15
|
+
- Bump @fluentui/react-jsx-runtime to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
|
|
16
|
+
- Bump @fluentui/react-label to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
|
|
17
|
+
- Bump @fluentui/react-shared-contexts to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
|
|
18
|
+
- Bump @fluentui/react-theme to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
|
|
19
|
+
- Bump @fluentui/react-utilities to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
|
|
20
|
+
|
|
21
|
+
## [9.8.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.8.4)
|
|
22
|
+
|
|
23
|
+
Wed, 24 Jun 2026 11:09:57 GMT
|
|
24
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.8.3..@fluentui/react-spinner_v9.8.4)
|
|
25
|
+
|
|
26
|
+
### Patches
|
|
27
|
+
|
|
28
|
+
- fix: remove redundant use no memo directives, and add justification to valid ones ([PR #36224](https://github.com/microsoft/fluentui/pull/36224) by martinhochel@microsoft.com)
|
|
29
|
+
- Bump @fluentui/react-jsx-runtime to v9.4.4 ([commit](https://github.com/microsoft/fluentui/commit/a4b871ca80c1f16f35ab4229def4fe02be7f30ea) by beachball)
|
|
30
|
+
- Bump @fluentui/react-label to v9.4.3 ([commit](https://github.com/microsoft/fluentui/commit/a4b871ca80c1f16f35ab4229def4fe02be7f30ea) by beachball)
|
|
31
|
+
- Bump @fluentui/react-utilities to v9.26.5 ([commit](https://github.com/microsoft/fluentui/commit/a4b871ca80c1f16f35ab4229def4fe02be7f30ea) by beachball)
|
|
32
|
+
|
|
33
|
+
## [9.8.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.8.3)
|
|
34
|
+
|
|
35
|
+
Tue, 26 May 2026 09:39:39 GMT
|
|
36
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.8.2..@fluentui/react-spinner_v9.8.3)
|
|
37
|
+
|
|
38
|
+
### Patches
|
|
39
|
+
|
|
40
|
+
- Bump @fluentui/react-jsx-runtime to v9.4.3 ([PR #36246](https://github.com/microsoft/fluentui/pull/36246) by beachball)
|
|
41
|
+
- Bump @fluentui/react-label to v9.4.2 ([PR #36246](https://github.com/microsoft/fluentui/pull/36246) by beachball)
|
|
42
|
+
- Bump @fluentui/react-utilities to v9.26.4 ([PR #36246](https://github.com/microsoft/fluentui/pull/36246) by beachball)
|
|
43
|
+
|
|
44
|
+
## [9.8.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.8.2)
|
|
45
|
+
|
|
46
|
+
Thu, 23 Apr 2026 14:21:06 GMT
|
|
47
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.8.1..@fluentui/react-spinner_v9.8.2)
|
|
48
|
+
|
|
49
|
+
### Patches
|
|
50
|
+
|
|
51
|
+
- fix: drop unnecessary dependencies from base hooks ([PR #35972](https://github.com/microsoft/fluentui/pull/35972) by dmytrokirpa@microsoft.com)
|
|
52
|
+
- Bump @fluentui/react-jsx-runtime to v9.4.2 ([PR #36035](https://github.com/microsoft/fluentui/pull/36035) by beachball)
|
|
53
|
+
- Bump @fluentui/react-label to v9.4.1 ([PR #36035](https://github.com/microsoft/fluentui/pull/36035) by beachball)
|
|
54
|
+
- Bump @fluentui/react-utilities to v9.26.3 ([PR #36035](https://github.com/microsoft/fluentui/pull/36035) by beachball)
|
|
55
|
+
|
|
56
|
+
## [9.8.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.8.1)
|
|
57
|
+
|
|
58
|
+
Wed, 01 Apr 2026 15:52:43 GMT
|
|
59
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.8.0..@fluentui/react-spinner_v9.8.1)
|
|
60
|
+
|
|
61
|
+
### Patches
|
|
62
|
+
|
|
63
|
+
- Bump @fluentui/react-label to v9.4.0 ([PR #35912](https://github.com/microsoft/fluentui/pull/35912) by beachball)
|
|
64
|
+
|
|
65
|
+
## [9.8.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.8.0)
|
|
66
|
+
|
|
67
|
+
Thu, 26 Mar 2026 08:12:52 GMT
|
|
68
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.7.15..@fluentui/react-spinner_v9.8.0)
|
|
69
|
+
|
|
70
|
+
### Minor changes
|
|
71
|
+
|
|
72
|
+
- feat: add base hooks for Spinner ([PR #35818](https://github.com/microsoft/fluentui/pull/35818) by dmytrokirpa@microsoft.com)
|
|
73
|
+
|
|
74
|
+
## [9.7.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.7.15)
|
|
75
|
+
|
|
76
|
+
Wed, 25 Feb 2026 13:32:28 GMT
|
|
77
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.7.14..@fluentui/react-spinner_v9.7.15)
|
|
78
|
+
|
|
79
|
+
### Patches
|
|
80
|
+
|
|
81
|
+
- Bump @fluentui/react-jsx-runtime to v9.4.1 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
|
|
82
|
+
- Bump @fluentui/react-label to v9.3.15 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
|
|
83
|
+
- Bump @fluentui/react-shared-contexts to v9.26.2 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
|
|
84
|
+
- Bump @fluentui/react-utilities to v9.26.2 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
|
|
85
|
+
|
|
86
|
+
## [9.7.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.7.14)
|
|
87
|
+
|
|
88
|
+
Thu, 12 Feb 2026 10:46:15 GMT
|
|
89
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.7.13..@fluentui/react-spinner_v9.7.14)
|
|
90
|
+
|
|
91
|
+
### Patches
|
|
92
|
+
|
|
93
|
+
- Bump @fluentui/react-jsx-runtime to v9.4.0 ([PR #35743](https://github.com/microsoft/fluentui/pull/35743) by beachball)
|
|
94
|
+
- Bump @fluentui/react-label to v9.3.14 ([PR #35743](https://github.com/microsoft/fluentui/pull/35743) by beachball)
|
|
95
|
+
|
|
96
|
+
## [9.7.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.7.13)
|
|
97
|
+
|
|
98
|
+
Thu, 22 Jan 2026 17:06:40 GMT
|
|
99
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.7.12..@fluentui/react-spinner_v9.7.13)
|
|
100
|
+
|
|
101
|
+
### Patches
|
|
102
|
+
|
|
103
|
+
- Bump @fluentui/react-jsx-runtime to v9.3.5 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
|
|
104
|
+
- Bump @fluentui/react-label to v9.3.13 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
|
|
105
|
+
- Bump @fluentui/react-shared-contexts to v9.26.1 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
|
|
106
|
+
- Bump @fluentui/react-theme to v9.2.1 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
|
|
107
|
+
- Bump @fluentui/react-utilities to v9.26.1 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
|
|
20
108
|
|
|
21
109
|
## [9.7.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.7.12)
|
|
22
110
|
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
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 type { JSXElement } from '@fluentui/react-utilities';
|
|
5
|
+
import type { Label } from '@fluentui/react-label';
|
|
6
|
+
import * as React_2 from 'react';
|
|
7
|
+
import type { Slot } from '@fluentui/react-utilities';
|
|
8
|
+
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Render the final JSX of Spinner
|
|
12
|
+
*/
|
|
13
|
+
export declare const renderSpinner_unstable: (state: SpinnerBaseState) => JSXElement;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Converged Spinner component for the fluentui repo
|
|
17
|
+
*/
|
|
18
|
+
export declare const Spinner: ForwardRefComponent<SpinnerProps>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Spinner base props, excluding design-related props like appearance and size.
|
|
22
|
+
*/
|
|
23
|
+
export declare type SpinnerBaseProps = Omit<SpinnerProps, 'appearance' | 'size'>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Spinner base state, excluding design-related state like appearance and size.
|
|
27
|
+
*/
|
|
28
|
+
export declare type SpinnerBaseState = Omit<SpinnerState, 'appearance' | 'size'>;
|
|
29
|
+
|
|
30
|
+
export declare const spinnerClassNames: SlotClassNames<SpinnerSlots>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare const SpinnerContextProvider: React_2.Provider<SpinnerContextValue | undefined>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export declare type SpinnerContextValue = Pick<SpinnerProps, 'size'>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Spinner Props
|
|
44
|
+
*/
|
|
45
|
+
export declare type SpinnerProps = Omit<ComponentProps<SpinnerSlots>, 'size'> & {
|
|
46
|
+
/**
|
|
47
|
+
* The appearance of the Spinner.
|
|
48
|
+
* @default 'primary'
|
|
49
|
+
*/
|
|
50
|
+
appearance?: 'primary' | 'inverted';
|
|
51
|
+
/**
|
|
52
|
+
* Time in milliseconds after component mount before spinner is visible.
|
|
53
|
+
* @default 0
|
|
54
|
+
*/
|
|
55
|
+
delay?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Where the label is positioned relative to the Spinner
|
|
58
|
+
* @default 'after'
|
|
59
|
+
*/
|
|
60
|
+
labelPosition?: 'above' | 'below' | 'before' | 'after';
|
|
61
|
+
/**
|
|
62
|
+
* The size of the spinner.
|
|
63
|
+
* @default 'medium'
|
|
64
|
+
*/
|
|
65
|
+
size?: 'extra-tiny' | 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large' | 'huge';
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export declare type SpinnerSlots = {
|
|
69
|
+
/**
|
|
70
|
+
* The root of the Spinner.
|
|
71
|
+
* The root slot receives the `className` and `style` specified directly on the `<Spinner>`.
|
|
72
|
+
*/
|
|
73
|
+
root: NonNullable<Slot<'div', 'span'>>;
|
|
74
|
+
/**
|
|
75
|
+
* The animated spinning ring.
|
|
76
|
+
*/
|
|
77
|
+
spinner?: Slot<'span'>;
|
|
78
|
+
/**
|
|
79
|
+
* The part of the spinner that rotates.
|
|
80
|
+
*/
|
|
81
|
+
spinnerTail?: NonNullable<Slot<'span'>>;
|
|
82
|
+
/**
|
|
83
|
+
* An optional label for the Spinner.
|
|
84
|
+
*/
|
|
85
|
+
label?: Slot<typeof Label>;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* State used in rendering Spinner
|
|
90
|
+
*/
|
|
91
|
+
export declare type SpinnerState = ComponentState<SpinnerSlots> & Required<Pick<SpinnerProps, 'appearance' | 'delay' | 'labelPosition' | 'size'>> & {
|
|
92
|
+
/**
|
|
93
|
+
* Should the spinner be rendered in the DOM
|
|
94
|
+
*/
|
|
95
|
+
shouldRenderSpinner: boolean;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Create the state required to render Spinner.
|
|
100
|
+
*
|
|
101
|
+
* The returned state can be modified with hooks such as useSpinnerStyles_unstable,
|
|
102
|
+
* before being passed to renderSpinner_unstable.
|
|
103
|
+
*
|
|
104
|
+
* @param props - props from this instance of Spinner
|
|
105
|
+
* @param ref - reference to root HTMLElement of Spinner
|
|
106
|
+
*/
|
|
107
|
+
export declare const useSpinner_unstable: (props: SpinnerProps, ref: React_2.Ref<HTMLElement>) => SpinnerState;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Base hook for Spinner component, which manages state related to slots structure, ARIA attributes,
|
|
111
|
+
* and delay-based visibility logic.
|
|
112
|
+
*
|
|
113
|
+
* @param props - User provided props to the Spinner component.
|
|
114
|
+
* @param ref - User provided ref to be passed to the Spinner component.
|
|
115
|
+
*/
|
|
116
|
+
export declare const useSpinnerBase_unstable: (props: SpinnerBaseProps, ref: React_2.Ref<HTMLElement>) => SpinnerBaseState;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @internal
|
|
120
|
+
*/
|
|
121
|
+
export declare const useSpinnerContext: () => SpinnerContextValue;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Apply styling to the Spinner slots based on the state
|
|
125
|
+
*/
|
|
126
|
+
export declare const useSpinnerStyles_unstable: (state: SpinnerState) => SpinnerState;
|
|
127
|
+
|
|
128
|
+
export { }
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ComponentProps } from '@fluentui/react-utilities';
|
|
|
2
2
|
import type { ComponentState } from '@fluentui/react-utilities';
|
|
3
3
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
4
4
|
import type { JSXElement } from '@fluentui/react-utilities';
|
|
5
|
-
import { Label } from '@fluentui/react-label';
|
|
5
|
+
import type { Label } from '@fluentui/react-label';
|
|
6
6
|
import * as React_2 from 'react';
|
|
7
7
|
import type { Slot } from '@fluentui/react-utilities';
|
|
8
8
|
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
@@ -10,13 +10,23 @@ import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
|
10
10
|
/**
|
|
11
11
|
* Render the final JSX of Spinner
|
|
12
12
|
*/
|
|
13
|
-
export declare const renderSpinner_unstable: (state:
|
|
13
|
+
export declare const renderSpinner_unstable: (state: SpinnerBaseState) => JSXElement;
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Converged Spinner component for the fluentui repo
|
|
17
17
|
*/
|
|
18
18
|
export declare const Spinner: ForwardRefComponent<SpinnerProps>;
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Spinner base props, excluding design-related props like appearance and size.
|
|
22
|
+
*/
|
|
23
|
+
export declare type SpinnerBaseProps = Omit<SpinnerProps, 'appearance' | 'size'>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Spinner base state, excluding design-related state like appearance and size.
|
|
27
|
+
*/
|
|
28
|
+
export declare type SpinnerBaseState = Omit<SpinnerState, 'appearance' | 'size'>;
|
|
29
|
+
|
|
20
30
|
export declare const spinnerClassNames: SlotClassNames<SpinnerSlots>;
|
|
21
31
|
|
|
22
32
|
/**
|
|
@@ -96,6 +106,15 @@ export declare type SpinnerState = ComponentState<SpinnerSlots> & Required<Pick<
|
|
|
96
106
|
*/
|
|
97
107
|
export declare const useSpinner_unstable: (props: SpinnerProps, ref: React_2.Ref<HTMLElement>) => SpinnerState;
|
|
98
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Base hook for Spinner component, which manages state related to slots structure, ARIA attributes,
|
|
111
|
+
* and delay-based visibility logic.
|
|
112
|
+
*
|
|
113
|
+
* @param props - User provided props to the Spinner component.
|
|
114
|
+
* @param ref - User provided ref to be passed to the Spinner component.
|
|
115
|
+
*/
|
|
116
|
+
export declare const useSpinnerBase_unstable: (props: SpinnerBaseProps, ref: React_2.Ref<HTMLElement>) => SpinnerBaseState;
|
|
117
|
+
|
|
99
118
|
/**
|
|
100
119
|
* @internal
|
|
101
120
|
*/
|
package/lib/Spinner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Spinner, renderSpinner_unstable, spinnerClassNames, useSpinnerStyles_unstable, useSpinner_unstable } from
|
|
1
|
+
export { Spinner, renderSpinner_unstable, spinnerClassNames, useSpinnerStyles_unstable, useSpinner_unstable, useSpinnerBase_unstable } from "./components/Spinner/index.js";
|
package/lib/Spinner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Spinner.ts"],"sourcesContent":["export type {
|
|
1
|
+
{"version":3,"sources":["../src/Spinner.ts"],"sourcesContent":["export type {\n SpinnerBaseProps,\n SpinnerBaseState,\n SpinnerProps,\n SpinnerSlots,\n SpinnerState,\n} from './components/Spinner/index';\nexport {\n Spinner,\n renderSpinner_unstable,\n spinnerClassNames,\n useSpinnerStyles_unstable,\n useSpinner_unstable,\n useSpinnerBase_unstable,\n} from './components/Spinner/index';\n"],"names":["Spinner","renderSpinner_unstable","spinnerClassNames","useSpinnerStyles_unstable","useSpinner_unstable","useSpinnerBase_unstable"],"mappings":"AAOA,SACEA,OAAO,EACPC,sBAAsB,EACtBC,iBAAiB,EACjBC,yBAAyB,EACzBC,mBAAmB,EACnBC,uBAAuB,QAClB,gCAA6B"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import * as React from
|
|
3
|
-
import { useSpinner_unstable } from
|
|
4
|
-
import { renderSpinner_unstable } from
|
|
5
|
-
import { useSpinnerStyles_unstable } from
|
|
6
|
-
import { useCustomStyleHook_unstable } from
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useSpinner_unstable } from "./useSpinner.js";
|
|
4
|
+
import { renderSpinner_unstable } from "./renderSpinner.js";
|
|
5
|
+
import { useSpinnerStyles_unstable } from "./useSpinnerStyles.styles.js";
|
|
6
|
+
import { useCustomStyleHook_unstable } from "@fluentui/react-shared-contexts";
|
|
7
7
|
/**
|
|
8
8
|
* Converged Spinner component for the fluentui repo
|
|
9
9
|
*/ export const Spinner = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Spinner/Spinner.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useSpinner_unstable } from './useSpinner';\nimport { renderSpinner_unstable } from './renderSpinner';\nimport { useSpinnerStyles_unstable } from './useSpinnerStyles.styles';\nimport type { SpinnerProps } from './Spinner.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\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\n useCustomStyleHook_unstable('useSpinnerStyles_unstable')(state);\n\n return renderSpinner_unstable(state);\n});\n\nSpinner.displayName = 'Spinner';\n"],"names":["React","useSpinner_unstable","renderSpinner_unstable","useSpinnerStyles_unstable","useCustomStyleHook_unstable","Spinner","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mBAAmB,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/components/Spinner/Spinner.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useSpinner_unstable } from './useSpinner';\nimport { renderSpinner_unstable } from './renderSpinner';\nimport { useSpinnerStyles_unstable } from './useSpinnerStyles.styles';\nimport type { SpinnerProps } from './Spinner.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\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\n useCustomStyleHook_unstable('useSpinnerStyles_unstable')(state);\n\n return renderSpinner_unstable(state);\n});\n\nSpinner.displayName = 'Spinner';\n"],"names":["React","useSpinner_unstable","renderSpinner_unstable","useSpinnerStyles_unstable","useCustomStyleHook_unstable","Spinner","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mBAAmB,QAAQ,kBAAe;AACnD,SAASC,sBAAsB,QAAQ,qBAAkB;AACzD,SAASC,yBAAyB,QAAQ,+BAA4B;AAGtE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,wBAA6CL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACjF,MAAMC,QAAQR,oBAAoBM,OAAOC;IAEzCL,0BAA0BM;IAE1BL,4BAA4B,6BAA6BK;IAEzD,OAAOP,uBAAuBO;AAChC,GAAG;AAEHJ,QAAQK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Spinner/Spinner.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { Label } from '@fluentui/react-label';\n\nexport type SpinnerSlots = {\n /**\n * The root of the Spinner.\n * The root slot receives the `className` and `style` specified directly on the `<Spinner>`.\n */\n root: NonNullable<Slot<'div', 'span'>>;\n\n /**\n * The animated spinning ring.\n */\n spinner?: Slot<'span'>;\n\n /**\n * The part of the spinner that rotates.\n */\n spinnerTail?: NonNullable<Slot<'span'>>;\n\n /**\n * An optional label for the Spinner.\n */\n label?: Slot<typeof Label>;\n};\n\n/**\n * Spinner Props\n */\nexport type SpinnerProps = Omit<ComponentProps<SpinnerSlots>, 'size'> & {\n /**\n * The appearance of the Spinner.\n * @default 'primary'\n */\n appearance?: 'primary' | 'inverted';\n\n /**\n * Time in milliseconds after component mount before spinner is visible.\n * @default 0\n */\n delay?: number;\n\n /**\n * Where the label is positioned relative to the Spinner\n * @default 'after'\n */\n labelPosition?: 'above' | 'below' | 'before' | 'after';\n\n /**\n * The size of the spinner.\n * @default 'medium'\n */\n size?: 'extra-tiny' | 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large' | 'huge';\n};\n\n/**\n * State used in rendering Spinner\n */\nexport type SpinnerState = ComponentState<SpinnerSlots> &\n Required<Pick<SpinnerProps, 'appearance' | 'delay' | 'labelPosition' | 'size'>> & {\n /**\n * Should the spinner be rendered in the DOM\n */\n shouldRenderSpinner: boolean;\n };\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/Spinner/Spinner.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { Label } from '@fluentui/react-label';\n\nexport type SpinnerSlots = {\n /**\n * The root of the Spinner.\n * The root slot receives the `className` and `style` specified directly on the `<Spinner>`.\n */\n root: NonNullable<Slot<'div', 'span'>>;\n\n /**\n * The animated spinning ring.\n */\n spinner?: Slot<'span'>;\n\n /**\n * The part of the spinner that rotates.\n */\n spinnerTail?: NonNullable<Slot<'span'>>;\n\n /**\n * An optional label for the Spinner.\n */\n label?: Slot<typeof Label>;\n};\n\n/**\n * Spinner Props\n */\nexport type SpinnerProps = Omit<ComponentProps<SpinnerSlots>, 'size'> & {\n /**\n * The appearance of the Spinner.\n * @default 'primary'\n */\n appearance?: 'primary' | 'inverted';\n\n /**\n * Time in milliseconds after component mount before spinner is visible.\n * @default 0\n */\n delay?: number;\n\n /**\n * Where the label is positioned relative to the Spinner\n * @default 'after'\n */\n labelPosition?: 'above' | 'below' | 'before' | 'after';\n\n /**\n * The size of the spinner.\n * @default 'medium'\n */\n size?: 'extra-tiny' | 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large' | 'huge';\n};\n\n/**\n * Spinner base props, excluding design-related props like appearance and size.\n */\nexport type SpinnerBaseProps = Omit<SpinnerProps, 'appearance' | 'size'>;\n\n/**\n * State used in rendering Spinner\n */\nexport type SpinnerState = ComponentState<SpinnerSlots> &\n Required<Pick<SpinnerProps, 'appearance' | 'delay' | 'labelPosition' | 'size'>> & {\n /**\n * Should the spinner be rendered in the DOM\n */\n shouldRenderSpinner: boolean;\n };\n\n/**\n * Spinner base state, excluding design-related state like appearance and size.\n */\nexport type SpinnerBaseState = Omit<SpinnerState, 'appearance' | 'size'>;\n"],"names":[],"mappings":"AAuEA;;CAEC,GACD,WAAyE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Spinner } from
|
|
2
|
-
export { renderSpinner_unstable } from
|
|
3
|
-
export { useSpinner_unstable } from
|
|
4
|
-
export { spinnerClassNames, useSpinnerStyles_unstable } from
|
|
1
|
+
export { Spinner } from "./Spinner.js";
|
|
2
|
+
export { renderSpinner_unstable } from "./renderSpinner.js";
|
|
3
|
+
export { useSpinner_unstable, useSpinnerBase_unstable } from "./useSpinner.js";
|
|
4
|
+
export { spinnerClassNames, useSpinnerStyles_unstable } from "./useSpinnerStyles.styles.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Spinner/index.ts"],"sourcesContent":["export { Spinner } from './Spinner';\nexport type { SpinnerProps, SpinnerSlots, SpinnerState } from './Spinner.types';\nexport { renderSpinner_unstable } from './renderSpinner';\nexport { useSpinner_unstable } from './useSpinner';\nexport { spinnerClassNames, useSpinnerStyles_unstable } from './useSpinnerStyles.styles';\n"],"names":["Spinner","renderSpinner_unstable","useSpinner_unstable","spinnerClassNames","useSpinnerStyles_unstable"],"mappings":"AAAA,SAASA,OAAO,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/components/Spinner/index.ts"],"sourcesContent":["export { Spinner } from './Spinner';\nexport type { SpinnerBaseProps, SpinnerBaseState, SpinnerProps, SpinnerSlots, SpinnerState } from './Spinner.types';\nexport { renderSpinner_unstable } from './renderSpinner';\nexport { useSpinner_unstable, useSpinnerBase_unstable } from './useSpinner';\nexport { spinnerClassNames, useSpinnerStyles_unstable } from './useSpinnerStyles.styles';\n"],"names":["Spinner","renderSpinner_unstable","useSpinner_unstable","useSpinnerBase_unstable","spinnerClassNames","useSpinnerStyles_unstable"],"mappings":"AAAA,SAASA,OAAO,QAAQ,eAAY;AAEpC,SAASC,sBAAsB,QAAQ,qBAAkB;AACzD,SAASC,mBAAmB,EAAEC,uBAAuB,QAAQ,kBAAe;AAC5E,SAASC,iBAAiB,EAAEC,yBAAyB,QAAQ,+BAA4B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
-
import { assertSlots } from
|
|
2
|
+
import { assertSlots } from "@fluentui/react-utilities";
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of Spinner
|
|
5
5
|
*/ export const renderSpinner_unstable = (state)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Spinner/renderSpinner.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type {
|
|
1
|
+
{"version":3,"sources":["../src/components/Spinner/renderSpinner.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { SpinnerBaseState, SpinnerSlots } from './Spinner.types';\n\n/**\n * Render the final JSX of Spinner\n */\nexport const renderSpinner_unstable = (state: SpinnerBaseState): JSXElement => {\n assertSlots<SpinnerSlots>(state);\n const { labelPosition, shouldRenderSpinner } = state;\n return (\n <state.root>\n {state.label && shouldRenderSpinner && (labelPosition === 'above' || labelPosition === 'before') && (\n <state.label />\n )}\n {state.spinner && shouldRenderSpinner && (\n <state.spinner>{state.spinnerTail && <state.spinnerTail />}</state.spinner>\n )}\n {state.label && shouldRenderSpinner && (labelPosition === 'below' || labelPosition === 'after') && (\n <state.label />\n )}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderSpinner_unstable","state","labelPosition","shouldRenderSpinner","root","label","spinner","spinnerTail"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,yBAAyB,CAACC;IACrCF,YAA0BE;IAC1B,MAAM,EAAEC,aAAa,EAAEC,mBAAmB,EAAE,GAAGF;IAC/C,qBACE,MAACA,MAAMG,IAAI;;YACRH,MAAMI,KAAK,IAAIF,uBAAwBD,CAAAA,kBAAkB,WAAWA,kBAAkB,QAAO,mBAC5F,KAACD,MAAMI,KAAK;YAEbJ,MAAMK,OAAO,IAAIH,qCAChB,KAACF,MAAMK,OAAO;0BAAEL,MAAMM,WAAW,kBAAI,KAACN,MAAMM,WAAW;;YAExDN,MAAMI,KAAK,IAAIF,uBAAwBD,CAAAA,kBAAkB,WAAWA,kBAAkB,OAAM,mBAC3F,KAACD,MAAMI,KAAK;;;AAIpB,EAAE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import * as React from
|
|
3
|
-
import { getIntrinsicElementProps, useId, useTimeout, slot } from
|
|
4
|
-
import { Label } from
|
|
5
|
-
import { useSpinnerContext } from
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { getIntrinsicElementProps, useId, useTimeout, slot } from "@fluentui/react-utilities";
|
|
4
|
+
import { Label } from "@fluentui/react-label";
|
|
5
|
+
import { useSpinnerContext } from "../../contexts/SpinnerContext.js";
|
|
6
6
|
/**
|
|
7
7
|
* Create the state required to render Spinner.
|
|
8
8
|
*
|
|
@@ -12,9 +12,32 @@ import { useSpinnerContext } from '../../contexts/SpinnerContext';
|
|
|
12
12
|
* @param props - props from this instance of Spinner
|
|
13
13
|
* @param ref - reference to root HTMLElement of Spinner
|
|
14
14
|
*/ export const useSpinner_unstable = (props, ref)=>{
|
|
15
|
-
// Props
|
|
16
15
|
const { size: contextSize } = useSpinnerContext();
|
|
17
|
-
const { appearance = 'primary',
|
|
16
|
+
const { appearance = 'primary', size = contextSize !== null && contextSize !== void 0 ? contextSize : 'medium', ...baseProps } = props;
|
|
17
|
+
const baseState = useSpinnerBase_unstable(baseProps, ref);
|
|
18
|
+
return {
|
|
19
|
+
...baseState,
|
|
20
|
+
appearance,
|
|
21
|
+
size,
|
|
22
|
+
components: {
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
24
|
+
...baseState.components,
|
|
25
|
+
label: Label
|
|
26
|
+
},
|
|
27
|
+
label: slot.optional(props.label, {
|
|
28
|
+
defaultProps: baseState.label,
|
|
29
|
+
elementType: Label
|
|
30
|
+
})
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Base hook for Spinner component, which manages state related to slots structure, ARIA attributes,
|
|
35
|
+
* and delay-based visibility logic.
|
|
36
|
+
*
|
|
37
|
+
* @param props - User provided props to the Spinner component.
|
|
38
|
+
* @param ref - User provided ref to be passed to the Spinner component.
|
|
39
|
+
*/ export const useSpinnerBase_unstable = (props, ref)=>{
|
|
40
|
+
const { delay = 0, labelPosition = 'after' } = props;
|
|
18
41
|
const baseId = useId('spinner');
|
|
19
42
|
const { role = 'progressbar', ...rest } = props;
|
|
20
43
|
const nativeRoot = slot.always(getIntrinsicElementProps('div', {
|
|
@@ -24,9 +47,7 @@ import { useSpinnerContext } from '../../contexts/SpinnerContext';
|
|
|
24
47
|
ref: ref,
|
|
25
48
|
role,
|
|
26
49
|
...rest
|
|
27
|
-
},
|
|
28
|
-
'size'
|
|
29
|
-
]), {
|
|
50
|
+
}), {
|
|
30
51
|
elementType: 'div'
|
|
31
52
|
});
|
|
32
53
|
const [isShownAfterDelay, setIsShownAfterDelay] = React.useState(false);
|
|
@@ -51,7 +72,7 @@ import { useSpinnerContext } from '../../contexts/SpinnerContext';
|
|
|
51
72
|
id: baseId
|
|
52
73
|
},
|
|
53
74
|
renderByDefault: false,
|
|
54
|
-
elementType:
|
|
75
|
+
elementType: 'label'
|
|
55
76
|
});
|
|
56
77
|
const spinnerShortHand = slot.optional(props.spinner, {
|
|
57
78
|
renderByDefault: true,
|
|
@@ -61,16 +82,14 @@ import { useSpinnerContext } from '../../contexts/SpinnerContext';
|
|
|
61
82
|
nativeRoot['aria-labelledby'] = labelShorthand.id;
|
|
62
83
|
}
|
|
63
84
|
const state = {
|
|
64
|
-
appearance,
|
|
65
85
|
delay,
|
|
66
86
|
labelPosition,
|
|
67
|
-
size,
|
|
68
87
|
shouldRenderSpinner: !delay || isShownAfterDelay,
|
|
69
88
|
components: {
|
|
70
89
|
root: 'div',
|
|
71
90
|
spinner: 'span',
|
|
72
91
|
spinnerTail: 'span',
|
|
73
|
-
label:
|
|
92
|
+
label: 'label'
|
|
74
93
|
},
|
|
75
94
|
root: nativeRoot,
|
|
76
95
|
spinner: spinnerShortHand,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Spinner/useSpinner.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, useId, useTimeout, slot } from '@fluentui/react-utilities';\nimport type { SpinnerProps, SpinnerState } from './Spinner.types';\nimport { Label } from '@fluentui/react-label';\nimport { useSpinnerContext } from '../../contexts/SpinnerContext';\n\n/**\n * Create the state required to render Spinner.\n *\n * The returned state can be modified with hooks such as useSpinnerStyles_unstable,\n * before being passed to renderSpinner_unstable.\n *\n * @param props - props from this instance of Spinner\n * @param ref - reference to root HTMLElement of Spinner\n */\nexport const useSpinner_unstable = (props: SpinnerProps, ref: React.Ref<HTMLElement>): SpinnerState => {\n
|
|
1
|
+
{"version":3,"sources":["../src/components/Spinner/useSpinner.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, useId, useTimeout, slot } from '@fluentui/react-utilities';\nimport type { SpinnerBaseProps, SpinnerBaseState, SpinnerProps, SpinnerState } from './Spinner.types';\nimport { Label } from '@fluentui/react-label';\nimport { useSpinnerContext } from '../../contexts/SpinnerContext';\n\n/**\n * Create the state required to render Spinner.\n *\n * The returned state can be modified with hooks such as useSpinnerStyles_unstable,\n * before being passed to renderSpinner_unstable.\n *\n * @param props - props from this instance of Spinner\n * @param ref - reference to root HTMLElement of Spinner\n */\nexport const useSpinner_unstable = (props: SpinnerProps, ref: React.Ref<HTMLElement>): SpinnerState => {\n const { size: contextSize } = useSpinnerContext();\n const { appearance = 'primary', size = contextSize ?? 'medium', ...baseProps } = props;\n\n const baseState = useSpinnerBase_unstable(baseProps, ref);\n\n return {\n ...baseState,\n appearance,\n size,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...baseState.components,\n label: Label,\n },\n label: slot.optional(props.label, {\n defaultProps: baseState.label,\n elementType: Label,\n }),\n };\n};\n\n/**\n * Base hook for Spinner component, which manages state related to slots structure, ARIA attributes,\n * and delay-based visibility logic.\n *\n * @param props - User provided props to the Spinner component.\n * @param ref - User provided ref to be passed to the Spinner component.\n */\nexport const useSpinnerBase_unstable = (props: SpinnerBaseProps, ref: React.Ref<HTMLElement>): SpinnerBaseState => {\n const { delay = 0, labelPosition = 'after' } = props;\n const baseId = useId('spinner');\n\n const { role = 'progressbar', ...rest } = props;\n const nativeRoot = slot.always(\n getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLDivElement>,\n role,\n ...rest,\n }),\n {\n elementType: 'div',\n },\n );\n const [isShownAfterDelay, setIsShownAfterDelay] = React.useState(false);\n const [setDelayTimeout, clearDelayTimeout] = useTimeout();\n React.useEffect(() => {\n if (delay <= 0) {\n return;\n }\n setDelayTimeout(() => {\n setIsShownAfterDelay(true);\n }, delay);\n return () => {\n clearDelayTimeout();\n };\n }, [setDelayTimeout, clearDelayTimeout, delay]);\n const labelShorthand = slot.optional(props.label, {\n defaultProps: { id: baseId },\n renderByDefault: false,\n elementType: 'label',\n });\n const spinnerShortHand = slot.optional(props.spinner, {\n renderByDefault: true,\n elementType: 'span',\n });\n if (labelShorthand && nativeRoot && !nativeRoot['aria-labelledby']) {\n nativeRoot['aria-labelledby'] = labelShorthand.id;\n }\n const state: SpinnerBaseState = {\n delay,\n labelPosition,\n shouldRenderSpinner: !delay || isShownAfterDelay,\n components: { root: 'div', spinner: 'span', spinnerTail: 'span', label: 'label' },\n root: nativeRoot,\n spinner: spinnerShortHand,\n spinnerTail: slot.always(props.spinnerTail, { elementType: 'span' }),\n label: labelShorthand,\n };\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","useId","useTimeout","slot","Label","useSpinnerContext","useSpinner_unstable","props","ref","size","contextSize","appearance","baseProps","baseState","useSpinnerBase_unstable","components","label","optional","defaultProps","elementType","delay","labelPosition","baseId","role","rest","nativeRoot","always","isShownAfterDelay","setIsShownAfterDelay","useState","setDelayTimeout","clearDelayTimeout","useEffect","labelShorthand","id","renderByDefault","spinnerShortHand","spinner","state","shouldRenderSpinner","root","spinnerTail"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,KAAK,EAAEC,UAAU,EAAEC,IAAI,QAAQ,4BAA4B;AAE9F,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SAASC,iBAAiB,QAAQ,mCAAgC;AAElE;;;;;;;;CAQC,GACD,OAAO,MAAMC,sBAAsB,CAACC,OAAqBC;IACvD,MAAM,EAAEC,MAAMC,WAAW,EAAE,GAAGL;IAC9B,MAAM,EAAEM,aAAa,SAAS,EAAEF,OAAOC,wBAAAA,yBAAAA,cAAe,QAAQ,EAAE,GAAGE,WAAW,GAAGL;IAEjF,MAAMM,YAAYC,wBAAwBF,WAAWJ;IAErD,OAAO;QACL,GAAGK,SAAS;QACZF;QACAF;QACAM,YAAY;YACV,4DAA4D;YAC5D,GAAGF,UAAUE,UAAU;YACvBC,OAAOZ;QACT;QACAY,OAAOb,KAAKc,QAAQ,CAACV,MAAMS,KAAK,EAAE;YAChCE,cAAcL,UAAUG,KAAK;YAC7BG,aAAaf;QACf;IACF;AACF,EAAE;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WAAW,EAAE;YAAEtB,aAAa;QAAO;QAClEH,OAAOiB;IACT;IACA,OAAOK;AACT,EAAE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useFluent_unstable as useFluent } from
|
|
4
|
-
import { tokens, typographyStyles } from
|
|
5
|
-
import { __resetStyles, __styles, mergeClasses } from
|
|
3
|
+
import { useFluent_unstable as useFluent } from "@fluentui/react-shared-contexts";
|
|
4
|
+
import { tokens, typographyStyles } from "@fluentui/react-theme";
|
|
5
|
+
import { __resetStyles, __styles, mergeClasses } from "@griffel/react";
|
|
6
6
|
export const spinnerClassNames = {
|
|
7
7
|
root: 'fui-Spinner',
|
|
8
8
|
spinner: 'fui-Spinner__spinner',
|
|
@@ -150,8 +150,6 @@ const useLabelStyles = /*#__PURE__*/__styles({
|
|
|
150
150
|
* Apply styling to the Spinner slots based on the state
|
|
151
151
|
*/
|
|
152
152
|
export const useSpinnerStyles_unstable = state => {
|
|
153
|
-
'use no memo';
|
|
154
|
-
|
|
155
153
|
const {
|
|
156
154
|
labelPosition,
|
|
157
155
|
size,
|
|
@@ -166,14 +164,18 @@ export const useSpinnerStyles_unstable = state => {
|
|
|
166
164
|
const spinnerStyles = useSpinnerStyles();
|
|
167
165
|
const spinnerTailBaseClassName = useSpinnerTailBaseClassName();
|
|
168
166
|
const labelStyles = useLabelStyles();
|
|
167
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
169
168
|
state.root.className = mergeClasses(spinnerClassNames.root, rootBaseClassName, (labelPosition === 'above' || labelPosition === 'below') && rootStyles.vertical, state.root.className);
|
|
170
169
|
if (state.spinner) {
|
|
170
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
171
171
|
state.spinner.className = mergeClasses(spinnerClassNames.spinner, spinnerBaseClassName, spinnerStyles[size], appearance === 'inverted' && spinnerStyles.inverted, state.spinner.className);
|
|
172
172
|
}
|
|
173
173
|
if (state.spinnerTail) {
|
|
174
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
174
175
|
state.spinnerTail.className = mergeClasses(spinnerClassNames.spinnerTail, spinnerTailBaseClassName, dir === 'rtl' && spinnerStyles.rtlTail, state.spinnerTail.className);
|
|
175
176
|
}
|
|
176
177
|
if (state.label) {
|
|
178
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
177
179
|
state.label.className = mergeClasses(spinnerClassNames.label, labelStyles[size], appearance === 'inverted' && labelStyles.inverted, state.label.className);
|
|
178
180
|
}
|
|
179
181
|
return state;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useFluent_unstable","useFluent","tokens","typographyStyles","__resetStyles","__styles","mergeClasses","spinnerClassNames","root","spinner","spinnerTail","label","vars","strokeWidth","useRootBaseClassName","useRootStyles","vertical","Beiy3e4","d","useSpinnerBaseClassName","r","s","useSpinnerTailBaseClassName","useSpinnerStyles","inverted","De3pzq","sj55zd","rtlTail","btxmck","gb5jj2","Bdya8wy","Bqenvij","a9b677","qmp6fs","tiny","small","medium","large","huge","m","useLabelStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","useSpinnerStyles_unstable","state","labelPosition","size","appearance","dir","rootBaseClassName","rootStyles","spinnerBaseClassName","spinnerStyles","spinnerTailBaseClassName","labelStyles","className"],"sources":["useSpinnerStyles.styles.js"],"sourcesContent":["'use client';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nexport const spinnerClassNames = {\n root: 'fui-Spinner',\n spinner: 'fui-Spinner__spinner',\n spinnerTail: 'fui-Spinner__spinnerTail',\n label: 'fui-Spinner__label'\n};\n/**\n * CSS variables used internally by Spinner\n */ const vars = {\n strokeWidth: '--fui-Spinner--strokeWidth'\n};\nconst useRootBaseClassName = makeResetStyles({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n lineHeight: '0',\n gap: '8px',\n overflow: 'hidden',\n minWidth: 'min-content'\n});\nconst useRootStyles = makeStyles({\n vertical: {\n flexDirection: 'column'\n }\n});\nconst useSpinnerBaseClassName = makeResetStyles({\n position: 'relative',\n flexShrink: 0,\n // Use a mask to create the ring shape of the spinner.\n maskImage: `radial-gradient(closest-side, ` + `transparent calc(100% - var(${vars.strokeWidth}) - 1px), ` + `white calc(100% - var(${vars.strokeWidth})) calc(100% - 1px), ` + `transparent 100%)`,\n backgroundColor: tokens.colorBrandStroke2Contrast,\n color: tokens.colorBrandStroke1,\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'HighlightText',\n color: 'Highlight',\n forcedColorAdjust: 'none'\n },\n animationDuration: '1.5s',\n animationIterationCount: 'infinite',\n animationTimingFunction: 'linear',\n animationName: {\n '0%': {\n transform: 'rotate(0deg)'\n },\n '100%': {\n transform: 'rotate(360deg)'\n }\n },\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationDuration: '1.8s'\n }\n});\n// The spinner tail is rendered using two 135deg arc segments, behind a 105deg arc mask.\n// The segments are rotated out from behind the mask to expand the visible arc from\n// 30deg (min) to 255deg (max), and then back behind the mask again to shrink the arc.\n// The tail and spinner itself also have 360deg rotation animations for the spin.\nconst useSpinnerTailBaseClassName = makeResetStyles({\n position: 'absolute',\n display: 'block',\n width: '100%',\n height: '100%',\n maskImage: 'conic-gradient(transparent 105deg, white 105deg)',\n '&::before, &::after': {\n content: '\"\"',\n position: 'absolute',\n display: 'block',\n width: '100%',\n height: '100%',\n animation: 'inherit',\n backgroundImage: 'conic-gradient(currentcolor 135deg, transparent 135deg)'\n },\n animationDuration: '1.5s',\n animationIterationCount: 'infinite',\n animationTimingFunction: tokens.curveEasyEase,\n animationName: {\n '0%': {\n transform: 'rotate(-135deg)'\n },\n '50%': {\n transform: 'rotate(0deg)'\n },\n '100%': {\n transform: 'rotate(225deg)'\n }\n },\n '&::before': {\n animationName: {\n '0%': {\n transform: 'rotate(0deg)'\n },\n '50%': {\n transform: 'rotate(105deg)'\n },\n '100%': {\n transform: 'rotate(0deg)'\n }\n }\n },\n '&::after': {\n animationName: {\n '0%': {\n transform: 'rotate(0deg)'\n },\n '50%': {\n transform: 'rotate(225deg)'\n },\n '100%': {\n transform: 'rotate(0deg)'\n }\n }\n },\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationIterationCount: '0',\n backgroundImage: 'conic-gradient(transparent 120deg, currentcolor 360deg)',\n '&::before, &::after': {\n content: 'none'\n }\n }\n});\nconst useSpinnerStyles = makeStyles({\n inverted: {\n backgroundColor: tokens.colorNeutralStrokeAlpha2,\n color: tokens.colorNeutralStrokeOnBrand2\n },\n rtlTail: {\n maskImage: 'conic-gradient(white 255deg, transparent 255deg)',\n '&::before, &::after': {\n backgroundImage: 'conic-gradient(transparent 225deg, currentcolor 225deg)'\n },\n '@media screen and (prefers-reduced-motion: reduce)': {\n backgroundImage: 'conic-gradient(currentcolor 0deg, transparent 240deg)'\n }\n },\n 'extra-tiny': {\n height: '16px',\n width: '16px',\n [vars.strokeWidth]: tokens.strokeWidthThick\n },\n tiny: {\n height: '20px',\n width: '20px',\n [vars.strokeWidth]: tokens.strokeWidthThick\n },\n 'extra-small': {\n height: '24px',\n width: '24px',\n [vars.strokeWidth]: tokens.strokeWidthThick\n },\n small: {\n height: '28px',\n width: '28px',\n [vars.strokeWidth]: tokens.strokeWidthThick\n },\n medium: {\n height: '32px',\n width: '32px',\n [vars.strokeWidth]: tokens.strokeWidthThicker\n },\n large: {\n height: '36px',\n width: '36px',\n [vars.strokeWidth]: tokens.strokeWidthThicker\n },\n 'extra-large': {\n height: '40px',\n width: '40px',\n [vars.strokeWidth]: tokens.strokeWidthThicker\n },\n huge: {\n height: '44px',\n width: '44px',\n [vars.strokeWidth]: tokens.strokeWidthThickest\n }\n});\nconst useLabelStyles = makeStyles({\n inverted: {\n color: tokens.colorNeutralForegroundStaticInverted\n },\n 'extra-tiny': {\n ...typographyStyles.body1\n },\n tiny: {\n ...typographyStyles.body1\n },\n 'extra-small': {\n ...typographyStyles.body1\n },\n small: {\n ...typographyStyles.body1\n },\n medium: {\n ...typographyStyles.subtitle2\n },\n large: {\n ...typographyStyles.subtitle2\n },\n 'extra-large': {\n ...typographyStyles.subtitle2\n },\n huge: {\n ...typographyStyles.subtitle1\n }\n});\n/**\n * Apply styling to the Spinner slots based on the state\n */ export const useSpinnerStyles_unstable = (state)=>{\n 'use no memo';\n const { labelPosition, size, appearance } = state;\n const { dir } = useFluent();\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n const spinnerBaseClassName = useSpinnerBaseClassName();\n const spinnerStyles = useSpinnerStyles();\n const spinnerTailBaseClassName = useSpinnerTailBaseClassName();\n const labelStyles = useLabelStyles();\n state.root.className = mergeClasses(spinnerClassNames.root, rootBaseClassName, (labelPosition === 'above' || labelPosition === 'below') && rootStyles.vertical, state.root.className);\n if (state.spinner) {\n state.spinner.className = mergeClasses(spinnerClassNames.spinner, spinnerBaseClassName, spinnerStyles[size], appearance === 'inverted' && spinnerStyles.inverted, state.spinner.className);\n }\n if (state.spinnerTail) {\n state.spinnerTail.className = mergeClasses(spinnerClassNames.spinnerTail, spinnerTailBaseClassName, dir === 'rtl' && spinnerStyles.rtlTail, state.spinnerTail.className);\n }\n if (state.label) {\n state.label.className = mergeClasses(spinnerClassNames.label, labelStyles[size], appearance === 'inverted' && labelStyles.inverted, state.label.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,kBAAkB,IAAIC,SAAS,QAAQ,iCAAiC;AACjF,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,SAAAC,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,OAAO,MAAMC,iBAAiB,GAAG;EAC7BC,IAAI,EAAE,aAAa;EACnBC,OAAO,EAAE,sBAAsB;EAC/BC,WAAW,EAAE,0BAA0B;EACvCC,KAAK,EAAE;AACX,CAAC;AACD;AACA;AACA;AAAI,MAAMC,I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AACrC,OAAO,EAAE;IACfqC,KAAK,CAACrC,OAAO,CAACgD,SAAS,GAAGnD,YAAY,CAACC,iBAAiB,CAACE,OAAO,EAAE4C,oBAAoB,EAAEC,aAAa,CAACN,IAAI,CAAC,EAAEC,UAAU,KAAK,UAAU,IAAIK,aAAa,CAAC9B,QAAQ,EAAEsB,KAAK,CAACrC,OAAO,CAACgD,SAAS,CAAC;EAC9L;EACA,IAAIX,KAAK,CAACpC,WAAW,EAAE;IACnBoC,KAAK,CAACpC,WAAW,CAAC+C,SAAS,GAAGnD,YAAY,CAACC,iBAAiB,CAACG,WAAW,EAAE6C,wBAAwB,EAAEL,GAAG,KAAK,KAAK,IAAII,aAAa,CAAC3B,OAAO,EAAEmB,KAAK,CAACpC,WAAW,CAAC+C,SAAS,CAAC;EAC5K;EACA,IAAIX,KAAK,CAACnC,KAAK,EAAE;IACbmC,KAAK,CAACnC,KAAK,CAAC8C,SAAS,GAAGnD,YAAY,CAACC,iBAAiB,CAACI,KAAK,EAAE6C,WAAW,CAACR,IAAI,CAAC,EAAEC,UAAU,KAAK,UAAU,IAAIO,WAAW,CAAChC,QAAQ,EAAEsB,KAAK,CAACnC,KAAK,CAAC8C,SAAS,CAAC;EAC9J;EACA,OAAOX,KAAK;AAChB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useFluent_unstable","useFluent","tokens","typographyStyles","__resetStyles","__styles","mergeClasses","spinnerClassNames","root","spinner","spinnerTail","label","vars","strokeWidth","useRootBaseClassName","useRootStyles","vertical","Beiy3e4","d","useSpinnerBaseClassName","r","s","useSpinnerTailBaseClassName","useSpinnerStyles","inverted","De3pzq","sj55zd","rtlTail","btxmck","gb5jj2","Bdya8wy","Bqenvij","a9b677","qmp6fs","tiny","small","medium","large","huge","m","useLabelStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","useSpinnerStyles_unstable","state","labelPosition","size","appearance","dir","rootBaseClassName","rootStyles","spinnerBaseClassName","spinnerStyles","spinnerTailBaseClassName","labelStyles","className"],"sources":["useSpinnerStyles.styles.js"],"sourcesContent":["'use client';\nimport { useFluent_unstable as useFluent } from \"@fluentui/react-shared-contexts\";\nimport { tokens, typographyStyles } from \"@fluentui/react-theme\";\nimport { makeResetStyles, makeStyles, mergeClasses } from \"@griffel/react\";\nexport const spinnerClassNames = {\n root: 'fui-Spinner',\n spinner: 'fui-Spinner__spinner',\n spinnerTail: 'fui-Spinner__spinnerTail',\n label: 'fui-Spinner__label'\n};\n/**\n * CSS variables used internally by Spinner\n */ const vars = {\n strokeWidth: '--fui-Spinner--strokeWidth'\n};\nconst useRootBaseClassName = makeResetStyles({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n lineHeight: '0',\n gap: '8px',\n overflow: 'hidden',\n minWidth: 'min-content'\n});\nconst useRootStyles = makeStyles({\n vertical: {\n flexDirection: 'column'\n }\n});\nconst useSpinnerBaseClassName = makeResetStyles({\n position: 'relative',\n flexShrink: 0,\n // Use a mask to create the ring shape of the spinner.\n maskImage: `radial-gradient(closest-side, ` + `transparent calc(100% - var(${vars.strokeWidth}) - 1px), ` + `white calc(100% - var(${vars.strokeWidth})) calc(100% - 1px), ` + `transparent 100%)`,\n backgroundColor: tokens.colorBrandStroke2Contrast,\n color: tokens.colorBrandStroke1,\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'HighlightText',\n color: 'Highlight',\n forcedColorAdjust: 'none'\n },\n animationDuration: '1.5s',\n animationIterationCount: 'infinite',\n animationTimingFunction: 'linear',\n animationName: {\n '0%': {\n transform: 'rotate(0deg)'\n },\n '100%': {\n transform: 'rotate(360deg)'\n }\n },\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationDuration: '1.8s'\n }\n});\n// The spinner tail is rendered using two 135deg arc segments, behind a 105deg arc mask.\n// The segments are rotated out from behind the mask to expand the visible arc from\n// 30deg (min) to 255deg (max), and then back behind the mask again to shrink the arc.\n// The tail and spinner itself also have 360deg rotation animations for the spin.\nconst useSpinnerTailBaseClassName = makeResetStyles({\n position: 'absolute',\n display: 'block',\n width: '100%',\n height: '100%',\n maskImage: 'conic-gradient(transparent 105deg, white 105deg)',\n '&::before, &::after': {\n content: '\"\"',\n position: 'absolute',\n display: 'block',\n width: '100%',\n height: '100%',\n animation: 'inherit',\n backgroundImage: 'conic-gradient(currentcolor 135deg, transparent 135deg)'\n },\n animationDuration: '1.5s',\n animationIterationCount: 'infinite',\n animationTimingFunction: tokens.curveEasyEase,\n animationName: {\n '0%': {\n transform: 'rotate(-135deg)'\n },\n '50%': {\n transform: 'rotate(0deg)'\n },\n '100%': {\n transform: 'rotate(225deg)'\n }\n },\n '&::before': {\n animationName: {\n '0%': {\n transform: 'rotate(0deg)'\n },\n '50%': {\n transform: 'rotate(105deg)'\n },\n '100%': {\n transform: 'rotate(0deg)'\n }\n }\n },\n '&::after': {\n animationName: {\n '0%': {\n transform: 'rotate(0deg)'\n },\n '50%': {\n transform: 'rotate(225deg)'\n },\n '100%': {\n transform: 'rotate(0deg)'\n }\n }\n },\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationIterationCount: '0',\n backgroundImage: 'conic-gradient(transparent 120deg, currentcolor 360deg)',\n '&::before, &::after': {\n content: 'none'\n }\n }\n});\nconst useSpinnerStyles = makeStyles({\n inverted: {\n backgroundColor: tokens.colorNeutralStrokeAlpha2,\n color: tokens.colorNeutralStrokeOnBrand2\n },\n rtlTail: {\n maskImage: 'conic-gradient(white 255deg, transparent 255deg)',\n '&::before, &::after': {\n backgroundImage: 'conic-gradient(transparent 225deg, currentcolor 225deg)'\n },\n '@media screen and (prefers-reduced-motion: reduce)': {\n backgroundImage: 'conic-gradient(currentcolor 0deg, transparent 240deg)'\n }\n },\n 'extra-tiny': {\n height: '16px',\n width: '16px',\n [vars.strokeWidth]: tokens.strokeWidthThick\n },\n tiny: {\n height: '20px',\n width: '20px',\n [vars.strokeWidth]: tokens.strokeWidthThick\n },\n 'extra-small': {\n height: '24px',\n width: '24px',\n [vars.strokeWidth]: tokens.strokeWidthThick\n },\n small: {\n height: '28px',\n width: '28px',\n [vars.strokeWidth]: tokens.strokeWidthThick\n },\n medium: {\n height: '32px',\n width: '32px',\n [vars.strokeWidth]: tokens.strokeWidthThicker\n },\n large: {\n height: '36px',\n width: '36px',\n [vars.strokeWidth]: tokens.strokeWidthThicker\n },\n 'extra-large': {\n height: '40px',\n width: '40px',\n [vars.strokeWidth]: tokens.strokeWidthThicker\n },\n huge: {\n height: '44px',\n width: '44px',\n [vars.strokeWidth]: tokens.strokeWidthThickest\n }\n});\nconst useLabelStyles = makeStyles({\n inverted: {\n color: tokens.colorNeutralForegroundStaticInverted\n },\n 'extra-tiny': {\n ...typographyStyles.body1\n },\n tiny: {\n ...typographyStyles.body1\n },\n 'extra-small': {\n ...typographyStyles.body1\n },\n small: {\n ...typographyStyles.body1\n },\n medium: {\n ...typographyStyles.subtitle2\n },\n large: {\n ...typographyStyles.subtitle2\n },\n 'extra-large': {\n ...typographyStyles.subtitle2\n },\n huge: {\n ...typographyStyles.subtitle1\n }\n});\n/**\n * Apply styling to the Spinner slots based on the state\n */ export const useSpinnerStyles_unstable = (state)=>{\n const { labelPosition, size, appearance } = state;\n const { dir } = useFluent();\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n const spinnerBaseClassName = useSpinnerBaseClassName();\n const spinnerStyles = useSpinnerStyles();\n const spinnerTailBaseClassName = useSpinnerTailBaseClassName();\n const labelStyles = useLabelStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(spinnerClassNames.root, rootBaseClassName, (labelPosition === 'above' || labelPosition === 'below') && rootStyles.vertical, state.root.className);\n if (state.spinner) {\n // eslint-disable-next-line react-hooks/immutability\n state.spinner.className = mergeClasses(spinnerClassNames.spinner, spinnerBaseClassName, spinnerStyles[size], appearance === 'inverted' && spinnerStyles.inverted, state.spinner.className);\n }\n if (state.spinnerTail) {\n // eslint-disable-next-line react-hooks/immutability\n state.spinnerTail.className = mergeClasses(spinnerClassNames.spinnerTail, spinnerTailBaseClassName, dir === 'rtl' && spinnerStyles.rtlTail, state.spinnerTail.className);\n }\n if (state.label) {\n // eslint-disable-next-line react-hooks/immutability\n state.label.className = mergeClasses(spinnerClassNames.label, labelStyles[size], appearance === 'inverted' && labelStyles.inverted, state.label.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,kBAAkB,IAAIC,SAAS,QAAQ,iCAAiC;AACjF,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,SAAAC,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,OAAO,MAAMC,iBAAiB,GAAG;EAC7BC,IAAI,EAAE,aAAa;EACnBC,OAAO,EAAE,sBAAsB;EAC/BC,WAAW,EAAE,0BAA0B;EACvCC,KAAK,EAAE;AACX,CAAC;AACD;AACA;AACA;AAAI,MAAMC,IAAI,GAAG;EACbC,WAAW,EAAE;AACjB,CAAC;AACD,MAAMC,oBAAoB,gBAAGV,aAAA,mJAQ5B,CAAC;AACF,MAAMW,aAAa,gBAAGV,QAAA;EAAAW,QAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAIrB,CAAC;AACF,MAAMC,uBAAuB,gBAAGf,aAAA;EAAAgB,CAAA;EAAAC,CAAA;AAAA,CA0B/B,CAAC;AACF;AACA;AACA;AACA;AACA,MAAMC,2BAA2B,gBAAGlB,aAAA;EAAAgB,CAAA;EAAAC,CAAA;AAAA,CA8DnC,CAAC;AACF,MAAME,gBAAgB,gBAAGlB,QAAA;EAAAmB,QAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,IAAA;IAAAH,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAA;IAAAF,OAAA;IAAAC,MAAA;IAAAC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