@fluentui/react-spinner 9.6.2 → 9.7.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 +12 -2
- package/lib/components/Spinner/useSpinnerStyles.styles.raw.js +229 -0
- package/lib/components/Spinner/useSpinnerStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/Spinner/useSpinnerStyles.styles.raw.js +245 -0
- package/lib-commonjs/components/Spinner/useSpinnerStyles.styles.raw.js.map +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
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, 17 Jul 2025 13:45:47 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.7.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.7.0)
|
|
8
|
+
|
|
9
|
+
Thu, 17 Jul 2025 13:45:47 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.6.2..@fluentui/react-spinner_v9.7.0)
|
|
11
|
+
|
|
12
|
+
### Minor changes
|
|
13
|
+
|
|
14
|
+
- feat: enable griffel raw styles ([PR #34853](https://github.com/microsoft/fluentui/pull/34853) by martinhochel@microsoft.com)
|
|
15
|
+
- Bump @fluentui/react-label to v9.3.0 ([PR #34862](https://github.com/microsoft/fluentui/pull/34862) by beachball)
|
|
16
|
+
|
|
7
17
|
## [9.6.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.6.2)
|
|
8
18
|
|
|
9
|
-
Thu, 26 Jun 2025 14:
|
|
19
|
+
Thu, 26 Jun 2025 14:11:55 GMT
|
|
10
20
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.6.1..@fluentui/react-spinner_v9.6.2)
|
|
11
21
|
|
|
12
22
|
### Patches
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
|
|
2
|
+
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
3
|
+
import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';
|
|
4
|
+
export const spinnerClassNames = {
|
|
5
|
+
root: 'fui-Spinner',
|
|
6
|
+
spinner: 'fui-Spinner__spinner',
|
|
7
|
+
spinnerTail: 'fui-Spinner__spinnerTail',
|
|
8
|
+
label: 'fui-Spinner__label'
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* CSS variables used internally by Spinner
|
|
12
|
+
*/ const vars = {
|
|
13
|
+
strokeWidth: '--fui-Spinner--strokeWidth'
|
|
14
|
+
};
|
|
15
|
+
const useRootBaseClassName = makeResetStyles({
|
|
16
|
+
display: 'flex',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
justifyContent: 'center',
|
|
19
|
+
lineHeight: '0',
|
|
20
|
+
gap: '8px',
|
|
21
|
+
overflow: 'hidden'
|
|
22
|
+
});
|
|
23
|
+
const useRootStyles = makeStyles({
|
|
24
|
+
vertical: {
|
|
25
|
+
flexDirection: 'column'
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const useSpinnerBaseClassName = makeResetStyles({
|
|
29
|
+
position: 'relative',
|
|
30
|
+
flexShrink: 0,
|
|
31
|
+
// Use a mask to create the ring shape of the spinner.
|
|
32
|
+
maskImage: `radial-gradient(closest-side, ` + `transparent calc(100% - var(${vars.strokeWidth}) - 1px), ` + `white calc(100% - var(${vars.strokeWidth})) calc(100% - 1px), ` + `transparent 100%)`,
|
|
33
|
+
backgroundColor: tokens.colorBrandStroke2Contrast,
|
|
34
|
+
color: tokens.colorBrandStroke1,
|
|
35
|
+
'@media screen and (forced-colors: active)': {
|
|
36
|
+
backgroundColor: 'HighlightText',
|
|
37
|
+
color: 'Highlight',
|
|
38
|
+
forcedColorAdjust: 'none'
|
|
39
|
+
},
|
|
40
|
+
animationDuration: '1.5s',
|
|
41
|
+
animationIterationCount: 'infinite',
|
|
42
|
+
animationTimingFunction: 'linear',
|
|
43
|
+
animationName: {
|
|
44
|
+
'0%': {
|
|
45
|
+
transform: 'rotate(0deg)'
|
|
46
|
+
},
|
|
47
|
+
'100%': {
|
|
48
|
+
transform: 'rotate(360deg)'
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
'@media screen and (prefers-reduced-motion: reduce)': {
|
|
52
|
+
animationDuration: '1.8s'
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
// The spinner tail is rendered using two 135deg arc segments, behind a 105deg arc mask.
|
|
56
|
+
// The segments are rotated out from behind the mask to expand the visible arc from
|
|
57
|
+
// 30deg (min) to 255deg (max), and then back behind the mask again to shrink the arc.
|
|
58
|
+
// The tail and spinner itself also have 360deg rotation animations for the spin.
|
|
59
|
+
const useSpinnerTailBaseClassName = makeResetStyles({
|
|
60
|
+
position: 'absolute',
|
|
61
|
+
display: 'block',
|
|
62
|
+
width: '100%',
|
|
63
|
+
height: '100%',
|
|
64
|
+
maskImage: 'conic-gradient(transparent 105deg, white 105deg)',
|
|
65
|
+
'&::before, &::after': {
|
|
66
|
+
content: '""',
|
|
67
|
+
position: 'absolute',
|
|
68
|
+
display: 'block',
|
|
69
|
+
width: '100%',
|
|
70
|
+
height: '100%',
|
|
71
|
+
animation: 'inherit',
|
|
72
|
+
backgroundImage: 'conic-gradient(currentcolor 135deg, transparent 135deg)'
|
|
73
|
+
},
|
|
74
|
+
animationDuration: '1.5s',
|
|
75
|
+
animationIterationCount: 'infinite',
|
|
76
|
+
animationTimingFunction: tokens.curveEasyEase,
|
|
77
|
+
animationName: {
|
|
78
|
+
'0%': {
|
|
79
|
+
transform: 'rotate(-135deg)'
|
|
80
|
+
},
|
|
81
|
+
'50%': {
|
|
82
|
+
transform: 'rotate(0deg)'
|
|
83
|
+
},
|
|
84
|
+
'100%': {
|
|
85
|
+
transform: 'rotate(225deg)'
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
'&::before': {
|
|
89
|
+
animationName: {
|
|
90
|
+
'0%': {
|
|
91
|
+
transform: 'rotate(0deg)'
|
|
92
|
+
},
|
|
93
|
+
'50%': {
|
|
94
|
+
transform: 'rotate(105deg)'
|
|
95
|
+
},
|
|
96
|
+
'100%': {
|
|
97
|
+
transform: 'rotate(0deg)'
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
'&::after': {
|
|
102
|
+
animationName: {
|
|
103
|
+
'0%': {
|
|
104
|
+
transform: 'rotate(0deg)'
|
|
105
|
+
},
|
|
106
|
+
'50%': {
|
|
107
|
+
transform: 'rotate(225deg)'
|
|
108
|
+
},
|
|
109
|
+
'100%': {
|
|
110
|
+
transform: 'rotate(0deg)'
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
'@media screen and (prefers-reduced-motion: reduce)': {
|
|
115
|
+
animationIterationCount: '0',
|
|
116
|
+
backgroundImage: 'conic-gradient(transparent 120deg, currentcolor 360deg)',
|
|
117
|
+
'&::before, &::after': {
|
|
118
|
+
content: 'none'
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
const useSpinnerStyles = makeStyles({
|
|
123
|
+
inverted: {
|
|
124
|
+
backgroundColor: tokens.colorNeutralStrokeAlpha2,
|
|
125
|
+
color: tokens.colorNeutralStrokeOnBrand2
|
|
126
|
+
},
|
|
127
|
+
rtlTail: {
|
|
128
|
+
maskImage: 'conic-gradient(white 255deg, transparent 255deg)',
|
|
129
|
+
'&::before, &::after': {
|
|
130
|
+
backgroundImage: 'conic-gradient(transparent 225deg, currentcolor 225deg)'
|
|
131
|
+
},
|
|
132
|
+
'@media screen and (prefers-reduced-motion: reduce)': {
|
|
133
|
+
backgroundImage: 'conic-gradient(currentcolor 0deg, transparent 240deg)'
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
'extra-tiny': {
|
|
137
|
+
height: '16px',
|
|
138
|
+
width: '16px',
|
|
139
|
+
[vars.strokeWidth]: tokens.strokeWidthThick
|
|
140
|
+
},
|
|
141
|
+
tiny: {
|
|
142
|
+
height: '20px',
|
|
143
|
+
width: '20px',
|
|
144
|
+
[vars.strokeWidth]: tokens.strokeWidthThick
|
|
145
|
+
},
|
|
146
|
+
'extra-small': {
|
|
147
|
+
height: '24px',
|
|
148
|
+
width: '24px',
|
|
149
|
+
[vars.strokeWidth]: tokens.strokeWidthThick
|
|
150
|
+
},
|
|
151
|
+
small: {
|
|
152
|
+
height: '28px',
|
|
153
|
+
width: '28px',
|
|
154
|
+
[vars.strokeWidth]: tokens.strokeWidthThick
|
|
155
|
+
},
|
|
156
|
+
medium: {
|
|
157
|
+
height: '32px',
|
|
158
|
+
width: '32px',
|
|
159
|
+
[vars.strokeWidth]: tokens.strokeWidthThicker
|
|
160
|
+
},
|
|
161
|
+
large: {
|
|
162
|
+
height: '36px',
|
|
163
|
+
width: '36px',
|
|
164
|
+
[vars.strokeWidth]: tokens.strokeWidthThicker
|
|
165
|
+
},
|
|
166
|
+
'extra-large': {
|
|
167
|
+
height: '40px',
|
|
168
|
+
width: '40px',
|
|
169
|
+
[vars.strokeWidth]: tokens.strokeWidthThicker
|
|
170
|
+
},
|
|
171
|
+
huge: {
|
|
172
|
+
height: '44px',
|
|
173
|
+
width: '44px',
|
|
174
|
+
[vars.strokeWidth]: tokens.strokeWidthThickest
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
const useLabelStyles = makeStyles({
|
|
178
|
+
inverted: {
|
|
179
|
+
color: tokens.colorNeutralForegroundStaticInverted
|
|
180
|
+
},
|
|
181
|
+
'extra-tiny': {
|
|
182
|
+
...typographyStyles.body1
|
|
183
|
+
},
|
|
184
|
+
tiny: {
|
|
185
|
+
...typographyStyles.body1
|
|
186
|
+
},
|
|
187
|
+
'extra-small': {
|
|
188
|
+
...typographyStyles.body1
|
|
189
|
+
},
|
|
190
|
+
small: {
|
|
191
|
+
...typographyStyles.body1
|
|
192
|
+
},
|
|
193
|
+
medium: {
|
|
194
|
+
...typographyStyles.subtitle2
|
|
195
|
+
},
|
|
196
|
+
large: {
|
|
197
|
+
...typographyStyles.subtitle2
|
|
198
|
+
},
|
|
199
|
+
'extra-large': {
|
|
200
|
+
...typographyStyles.subtitle2
|
|
201
|
+
},
|
|
202
|
+
huge: {
|
|
203
|
+
...typographyStyles.subtitle1
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
/**
|
|
207
|
+
* Apply styling to the Spinner slots based on the state
|
|
208
|
+
*/ export const useSpinnerStyles_unstable = (state)=>{
|
|
209
|
+
'use no memo';
|
|
210
|
+
const { labelPosition, size, appearance } = state;
|
|
211
|
+
const { dir } = useFluent();
|
|
212
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
213
|
+
const rootStyles = useRootStyles();
|
|
214
|
+
const spinnerBaseClassName = useSpinnerBaseClassName();
|
|
215
|
+
const spinnerStyles = useSpinnerStyles();
|
|
216
|
+
const spinnerTailBaseClassName = useSpinnerTailBaseClassName();
|
|
217
|
+
const labelStyles = useLabelStyles();
|
|
218
|
+
state.root.className = mergeClasses(spinnerClassNames.root, rootBaseClassName, (labelPosition === 'above' || labelPosition === 'below') && rootStyles.vertical, state.root.className);
|
|
219
|
+
if (state.spinner) {
|
|
220
|
+
state.spinner.className = mergeClasses(spinnerClassNames.spinner, spinnerBaseClassName, spinnerStyles[size], appearance === 'inverted' && spinnerStyles.inverted, state.spinner.className);
|
|
221
|
+
}
|
|
222
|
+
if (state.spinnerTail) {
|
|
223
|
+
state.spinnerTail.className = mergeClasses(spinnerClassNames.spinnerTail, spinnerTailBaseClassName, dir === 'rtl' && spinnerStyles.rtlTail, state.spinnerTail.className);
|
|
224
|
+
}
|
|
225
|
+
if (state.label) {
|
|
226
|
+
state.label.className = mergeClasses(spinnerClassNames.label, labelStyles[size], appearance === 'inverted' && labelStyles.inverted, state.label.className);
|
|
227
|
+
}
|
|
228
|
+
return state;
|
|
229
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Spinner/useSpinnerStyles.styles.ts"],"sourcesContent":["import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SpinnerSlots, SpinnerState } from './Spinner.types';\n\nexport const spinnerClassNames: SlotClassNames<SpinnerSlots> = {\n root: 'fui-Spinner',\n spinner: 'fui-Spinner__spinner',\n spinnerTail: 'fui-Spinner__spinnerTail',\n label: 'fui-Spinner__label',\n};\n\n/**\n * CSS variables used internally by Spinner\n */\nconst vars = {\n strokeWidth: '--fui-Spinner--strokeWidth',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n lineHeight: '0',\n gap: '8px',\n overflow: 'hidden', // prevents height changes from rotating children\n});\n\nconst useRootStyles = makeStyles({\n vertical: {\n flexDirection: 'column',\n },\n});\n\nconst useSpinnerBaseClassName = makeResetStyles({\n position: 'relative',\n flexShrink: 0,\n\n // Use a mask to create the ring shape of the spinner.\n maskImage:\n `radial-gradient(closest-side, ` +\n `transparent calc(100% - var(${vars.strokeWidth}) - 1px), ` +\n `white calc(100% - var(${vars.strokeWidth})) calc(100% - 1px), ` +\n `transparent 100%)`,\n\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\n animationDuration: '1.5s',\n animationIterationCount: 'infinite',\n animationTimingFunction: 'linear',\n animationName: {\n '0%': { transform: 'rotate(0deg)' },\n '100%': { transform: 'rotate(360deg)' },\n },\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationDuration: '1.8s',\n },\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\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\n animationDuration: '1.5s',\n animationIterationCount: 'infinite',\n animationTimingFunction: tokens.curveEasyEase,\n animationName: {\n '0%': { transform: 'rotate(-135deg)' },\n '50%': { transform: 'rotate(0deg)' },\n '100%': { transform: 'rotate(225deg)' },\n },\n '&::before': {\n animationName: {\n '0%': { transform: 'rotate(0deg)' },\n '50%': { transform: 'rotate(105deg)' },\n '100%': { transform: 'rotate(0deg)' },\n },\n },\n '&::after': {\n animationName: {\n '0%': { transform: 'rotate(0deg)' },\n '50%': { transform: 'rotate(225deg)' },\n '100%': { transform: 'rotate(0deg)' },\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});\n\nconst useSpinnerStyles = makeStyles({\n inverted: {\n backgroundColor: tokens.colorNeutralStrokeAlpha2,\n color: tokens.colorNeutralStrokeOnBrand2,\n },\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\n 'extra-tiny': {\n height: '16px',\n width: '16px',\n [vars.strokeWidth]: tokens.strokeWidthThick,\n },\n\n tiny: {\n height: '20px',\n width: '20px',\n [vars.strokeWidth]: tokens.strokeWidthThick,\n },\n\n 'extra-small': {\n height: '24px',\n width: '24px',\n [vars.strokeWidth]: tokens.strokeWidthThick,\n },\n\n small: {\n height: '28px',\n width: '28px',\n [vars.strokeWidth]: tokens.strokeWidthThick,\n },\n\n medium: {\n height: '32px',\n width: '32px',\n [vars.strokeWidth]: tokens.strokeWidthThicker,\n },\n\n large: {\n height: '36px',\n width: '36px',\n [vars.strokeWidth]: tokens.strokeWidthThicker,\n },\n\n 'extra-large': {\n height: '40px',\n width: '40px',\n [vars.strokeWidth]: tokens.strokeWidthThicker,\n },\n\n huge: {\n height: '44px',\n width: '44px',\n [vars.strokeWidth]: tokens.strokeWidthThickest,\n },\n});\n\nconst useLabelStyles = makeStyles({\n inverted: {\n color: tokens.colorNeutralForegroundStaticInverted,\n },\n\n 'extra-tiny': {\n ...typographyStyles.body1,\n },\n\n tiny: {\n ...typographyStyles.body1,\n },\n\n 'extra-small': {\n ...typographyStyles.body1,\n },\n\n small: {\n ...typographyStyles.body1,\n },\n\n medium: {\n ...typographyStyles.subtitle2,\n },\n\n large: {\n ...typographyStyles.subtitle2,\n },\n\n 'extra-large': {\n ...typographyStyles.subtitle2,\n },\n\n huge: {\n ...typographyStyles.subtitle1,\n },\n});\n\n/**\n * Apply styling to the Spinner slots based on the state\n */\nexport const useSpinnerStyles_unstable = (state: SpinnerState): SpinnerState => {\n 'use no memo';\n\n const { labelPosition, size, appearance } = state;\n const { dir } = useFluent();\n\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\n state.root.className = mergeClasses(\n spinnerClassNames.root,\n rootBaseClassName,\n (labelPosition === 'above' || labelPosition === 'below') && rootStyles.vertical,\n state.root.className,\n );\n if (state.spinner) {\n state.spinner.className = mergeClasses(\n spinnerClassNames.spinner,\n spinnerBaseClassName,\n spinnerStyles[size],\n appearance === 'inverted' && spinnerStyles.inverted,\n state.spinner.className,\n );\n }\n if (state.spinnerTail) {\n state.spinnerTail.className = mergeClasses(\n spinnerClassNames.spinnerTail,\n spinnerTailBaseClassName,\n dir === 'rtl' && spinnerStyles.rtlTail,\n state.spinnerTail.className,\n );\n }\n if (state.label) {\n state.label.className = mergeClasses(\n spinnerClassNames.label,\n labelStyles[size],\n appearance === 'inverted' && labelStyles.inverted,\n state.label.className,\n );\n }\n\n return state;\n};\n"],"names":["useFluent_unstable","useFluent","tokens","typographyStyles","makeResetStyles","makeStyles","mergeClasses","spinnerClassNames","root","spinner","spinnerTail","label","vars","strokeWidth","useRootBaseClassName","display","alignItems","justifyContent","lineHeight","gap","overflow","useRootStyles","vertical","flexDirection","useSpinnerBaseClassName","position","flexShrink","maskImage","backgroundColor","colorBrandStroke2Contrast","color","colorBrandStroke1","forcedColorAdjust","animationDuration","animationIterationCount","animationTimingFunction","animationName","transform","useSpinnerTailBaseClassName","width","height","content","animation","backgroundImage","curveEasyEase","useSpinnerStyles","inverted","colorNeutralStrokeAlpha2","colorNeutralStrokeOnBrand2","rtlTail","strokeWidthThick","tiny","small","medium","strokeWidthThicker","large","huge","strokeWidthThickest","useLabelStyles","colorNeutralForegroundStaticInverted","body1","subtitle2","subtitle1","useSpinnerStyles_unstable","state","labelPosition","size","appearance","dir","rootBaseClassName","rootStyles","spinnerBaseClassName","spinnerStyles","spinnerTailBaseClassName","labelStyles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAMgD,gBAAgB3B;IACtB,MAAM4B,2BAA2BnC;IACjC,MAAMoC,cAAchB;IAEpBM,MAAMxD,IAAI,CAACmE,SAAS,GAAGrE,aACrBC,kBAAkBC,IAAI,EACtB6D,mBACA,AAACJ,CAAAA,kBAAkB,WAAWA,kBAAkB,OAAM,KAAMK,WAAWhD,QAAQ,EAC/E0C,MAAMxD,IAAI,CAACmE,SAAS;IAEtB,IAAIX,MAAMvD,OAAO,EAAE;QACjBuD,MAAMvD,OAAO,CAACkE,SAAS,GAAGrE,aACxBC,kBAAkBE,OAAO,EACzB8D,sBACAC,aAAa,CAACN,KAAK,EACnBC,eAAe,cAAcK,cAAc1B,QAAQ,EACnDkB,MAAMvD,OAAO,CAACkE,SAAS;IAE3B;IACA,IAAIX,MAAMtD,WAAW,EAAE;QACrBsD,MAAMtD,WAAW,CAACiE,SAAS,GAAGrE,aAC5BC,kBAAkBG,WAAW,EAC7B+D,0BACAL,QAAQ,SAASI,cAAcvB,OAAO,EACtCe,MAAMtD,WAAW,CAACiE,SAAS;IAE/B;IACA,IAAIX,MAAMrD,KAAK,EAAE;QACfqD,MAAMrD,KAAK,CAACgE,SAAS,GAAGrE,aACtBC,kBAAkBI,KAAK,EACvB+D,WAAW,CAACR,KAAK,EACjBC,eAAe,cAAcO,YAAY5B,QAAQ,EACjDkB,MAAMrD,KAAK,CAACgE,SAAS;IAEzB;IAEA,OAAOX;AACT,EAAE"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
spinnerClassNames: function() {
|
|
13
|
+
return spinnerClassNames;
|
|
14
|
+
},
|
|
15
|
+
useSpinnerStyles_unstable: function() {
|
|
16
|
+
return useSpinnerStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
20
|
+
const _reacttheme = require("@fluentui/react-theme");
|
|
21
|
+
const _react = require("@griffel/react");
|
|
22
|
+
const spinnerClassNames = {
|
|
23
|
+
root: 'fui-Spinner',
|
|
24
|
+
spinner: 'fui-Spinner__spinner',
|
|
25
|
+
spinnerTail: 'fui-Spinner__spinnerTail',
|
|
26
|
+
label: 'fui-Spinner__label'
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* CSS variables used internally by Spinner
|
|
30
|
+
*/ const vars = {
|
|
31
|
+
strokeWidth: '--fui-Spinner--strokeWidth'
|
|
32
|
+
};
|
|
33
|
+
const useRootBaseClassName = (0, _react.makeResetStyles)({
|
|
34
|
+
display: 'flex',
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
justifyContent: 'center',
|
|
37
|
+
lineHeight: '0',
|
|
38
|
+
gap: '8px',
|
|
39
|
+
overflow: 'hidden'
|
|
40
|
+
});
|
|
41
|
+
const useRootStyles = (0, _react.makeStyles)({
|
|
42
|
+
vertical: {
|
|
43
|
+
flexDirection: 'column'
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const useSpinnerBaseClassName = (0, _react.makeResetStyles)({
|
|
47
|
+
position: 'relative',
|
|
48
|
+
flexShrink: 0,
|
|
49
|
+
// Use a mask to create the ring shape of the spinner.
|
|
50
|
+
maskImage: `radial-gradient(closest-side, ` + `transparent calc(100% - var(${vars.strokeWidth}) - 1px), ` + `white calc(100% - var(${vars.strokeWidth})) calc(100% - 1px), ` + `transparent 100%)`,
|
|
51
|
+
backgroundColor: _reacttheme.tokens.colorBrandStroke2Contrast,
|
|
52
|
+
color: _reacttheme.tokens.colorBrandStroke1,
|
|
53
|
+
'@media screen and (forced-colors: active)': {
|
|
54
|
+
backgroundColor: 'HighlightText',
|
|
55
|
+
color: 'Highlight',
|
|
56
|
+
forcedColorAdjust: 'none'
|
|
57
|
+
},
|
|
58
|
+
animationDuration: '1.5s',
|
|
59
|
+
animationIterationCount: 'infinite',
|
|
60
|
+
animationTimingFunction: 'linear',
|
|
61
|
+
animationName: {
|
|
62
|
+
'0%': {
|
|
63
|
+
transform: 'rotate(0deg)'
|
|
64
|
+
},
|
|
65
|
+
'100%': {
|
|
66
|
+
transform: 'rotate(360deg)'
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
'@media screen and (prefers-reduced-motion: reduce)': {
|
|
70
|
+
animationDuration: '1.8s'
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
// The spinner tail is rendered using two 135deg arc segments, behind a 105deg arc mask.
|
|
74
|
+
// The segments are rotated out from behind the mask to expand the visible arc from
|
|
75
|
+
// 30deg (min) to 255deg (max), and then back behind the mask again to shrink the arc.
|
|
76
|
+
// The tail and spinner itself also have 360deg rotation animations for the spin.
|
|
77
|
+
const useSpinnerTailBaseClassName = (0, _react.makeResetStyles)({
|
|
78
|
+
position: 'absolute',
|
|
79
|
+
display: 'block',
|
|
80
|
+
width: '100%',
|
|
81
|
+
height: '100%',
|
|
82
|
+
maskImage: 'conic-gradient(transparent 105deg, white 105deg)',
|
|
83
|
+
'&::before, &::after': {
|
|
84
|
+
content: '""',
|
|
85
|
+
position: 'absolute',
|
|
86
|
+
display: 'block',
|
|
87
|
+
width: '100%',
|
|
88
|
+
height: '100%',
|
|
89
|
+
animation: 'inherit',
|
|
90
|
+
backgroundImage: 'conic-gradient(currentcolor 135deg, transparent 135deg)'
|
|
91
|
+
},
|
|
92
|
+
animationDuration: '1.5s',
|
|
93
|
+
animationIterationCount: 'infinite',
|
|
94
|
+
animationTimingFunction: _reacttheme.tokens.curveEasyEase,
|
|
95
|
+
animationName: {
|
|
96
|
+
'0%': {
|
|
97
|
+
transform: 'rotate(-135deg)'
|
|
98
|
+
},
|
|
99
|
+
'50%': {
|
|
100
|
+
transform: 'rotate(0deg)'
|
|
101
|
+
},
|
|
102
|
+
'100%': {
|
|
103
|
+
transform: 'rotate(225deg)'
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
'&::before': {
|
|
107
|
+
animationName: {
|
|
108
|
+
'0%': {
|
|
109
|
+
transform: 'rotate(0deg)'
|
|
110
|
+
},
|
|
111
|
+
'50%': {
|
|
112
|
+
transform: 'rotate(105deg)'
|
|
113
|
+
},
|
|
114
|
+
'100%': {
|
|
115
|
+
transform: 'rotate(0deg)'
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
'&::after': {
|
|
120
|
+
animationName: {
|
|
121
|
+
'0%': {
|
|
122
|
+
transform: 'rotate(0deg)'
|
|
123
|
+
},
|
|
124
|
+
'50%': {
|
|
125
|
+
transform: 'rotate(225deg)'
|
|
126
|
+
},
|
|
127
|
+
'100%': {
|
|
128
|
+
transform: 'rotate(0deg)'
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
'@media screen and (prefers-reduced-motion: reduce)': {
|
|
133
|
+
animationIterationCount: '0',
|
|
134
|
+
backgroundImage: 'conic-gradient(transparent 120deg, currentcolor 360deg)',
|
|
135
|
+
'&::before, &::after': {
|
|
136
|
+
content: 'none'
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
const useSpinnerStyles = (0, _react.makeStyles)({
|
|
141
|
+
inverted: {
|
|
142
|
+
backgroundColor: _reacttheme.tokens.colorNeutralStrokeAlpha2,
|
|
143
|
+
color: _reacttheme.tokens.colorNeutralStrokeOnBrand2
|
|
144
|
+
},
|
|
145
|
+
rtlTail: {
|
|
146
|
+
maskImage: 'conic-gradient(white 255deg, transparent 255deg)',
|
|
147
|
+
'&::before, &::after': {
|
|
148
|
+
backgroundImage: 'conic-gradient(transparent 225deg, currentcolor 225deg)'
|
|
149
|
+
},
|
|
150
|
+
'@media screen and (prefers-reduced-motion: reduce)': {
|
|
151
|
+
backgroundImage: 'conic-gradient(currentcolor 0deg, transparent 240deg)'
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
'extra-tiny': {
|
|
155
|
+
height: '16px',
|
|
156
|
+
width: '16px',
|
|
157
|
+
[vars.strokeWidth]: _reacttheme.tokens.strokeWidthThick
|
|
158
|
+
},
|
|
159
|
+
tiny: {
|
|
160
|
+
height: '20px',
|
|
161
|
+
width: '20px',
|
|
162
|
+
[vars.strokeWidth]: _reacttheme.tokens.strokeWidthThick
|
|
163
|
+
},
|
|
164
|
+
'extra-small': {
|
|
165
|
+
height: '24px',
|
|
166
|
+
width: '24px',
|
|
167
|
+
[vars.strokeWidth]: _reacttheme.tokens.strokeWidthThick
|
|
168
|
+
},
|
|
169
|
+
small: {
|
|
170
|
+
height: '28px',
|
|
171
|
+
width: '28px',
|
|
172
|
+
[vars.strokeWidth]: _reacttheme.tokens.strokeWidthThick
|
|
173
|
+
},
|
|
174
|
+
medium: {
|
|
175
|
+
height: '32px',
|
|
176
|
+
width: '32px',
|
|
177
|
+
[vars.strokeWidth]: _reacttheme.tokens.strokeWidthThicker
|
|
178
|
+
},
|
|
179
|
+
large: {
|
|
180
|
+
height: '36px',
|
|
181
|
+
width: '36px',
|
|
182
|
+
[vars.strokeWidth]: _reacttheme.tokens.strokeWidthThicker
|
|
183
|
+
},
|
|
184
|
+
'extra-large': {
|
|
185
|
+
height: '40px',
|
|
186
|
+
width: '40px',
|
|
187
|
+
[vars.strokeWidth]: _reacttheme.tokens.strokeWidthThicker
|
|
188
|
+
},
|
|
189
|
+
huge: {
|
|
190
|
+
height: '44px',
|
|
191
|
+
width: '44px',
|
|
192
|
+
[vars.strokeWidth]: _reacttheme.tokens.strokeWidthThickest
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
const useLabelStyles = (0, _react.makeStyles)({
|
|
196
|
+
inverted: {
|
|
197
|
+
color: _reacttheme.tokens.colorNeutralForegroundStaticInverted
|
|
198
|
+
},
|
|
199
|
+
'extra-tiny': {
|
|
200
|
+
..._reacttheme.typographyStyles.body1
|
|
201
|
+
},
|
|
202
|
+
tiny: {
|
|
203
|
+
..._reacttheme.typographyStyles.body1
|
|
204
|
+
},
|
|
205
|
+
'extra-small': {
|
|
206
|
+
..._reacttheme.typographyStyles.body1
|
|
207
|
+
},
|
|
208
|
+
small: {
|
|
209
|
+
..._reacttheme.typographyStyles.body1
|
|
210
|
+
},
|
|
211
|
+
medium: {
|
|
212
|
+
..._reacttheme.typographyStyles.subtitle2
|
|
213
|
+
},
|
|
214
|
+
large: {
|
|
215
|
+
..._reacttheme.typographyStyles.subtitle2
|
|
216
|
+
},
|
|
217
|
+
'extra-large': {
|
|
218
|
+
..._reacttheme.typographyStyles.subtitle2
|
|
219
|
+
},
|
|
220
|
+
huge: {
|
|
221
|
+
..._reacttheme.typographyStyles.subtitle1
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
const useSpinnerStyles_unstable = (state)=>{
|
|
225
|
+
'use no memo';
|
|
226
|
+
const { labelPosition, size, appearance } = state;
|
|
227
|
+
const { dir } = (0, _reactsharedcontexts.useFluent_unstable)();
|
|
228
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
229
|
+
const rootStyles = useRootStyles();
|
|
230
|
+
const spinnerBaseClassName = useSpinnerBaseClassName();
|
|
231
|
+
const spinnerStyles = useSpinnerStyles();
|
|
232
|
+
const spinnerTailBaseClassName = useSpinnerTailBaseClassName();
|
|
233
|
+
const labelStyles = useLabelStyles();
|
|
234
|
+
state.root.className = (0, _react.mergeClasses)(spinnerClassNames.root, rootBaseClassName, (labelPosition === 'above' || labelPosition === 'below') && rootStyles.vertical, state.root.className);
|
|
235
|
+
if (state.spinner) {
|
|
236
|
+
state.spinner.className = (0, _react.mergeClasses)(spinnerClassNames.spinner, spinnerBaseClassName, spinnerStyles[size], appearance === 'inverted' && spinnerStyles.inverted, state.spinner.className);
|
|
237
|
+
}
|
|
238
|
+
if (state.spinnerTail) {
|
|
239
|
+
state.spinnerTail.className = (0, _react.mergeClasses)(spinnerClassNames.spinnerTail, spinnerTailBaseClassName, dir === 'rtl' && spinnerStyles.rtlTail, state.spinnerTail.className);
|
|
240
|
+
}
|
|
241
|
+
if (state.label) {
|
|
242
|
+
state.label.className = (0, _react.mergeClasses)(spinnerClassNames.label, labelStyles[size], appearance === 'inverted' && labelStyles.inverted, state.label.className);
|
|
243
|
+
}
|
|
244
|
+
return state;
|
|
245
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Spinner/useSpinnerStyles.styles.ts"],"sourcesContent":["import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SpinnerSlots, SpinnerState } from './Spinner.types';\n\nexport const spinnerClassNames: SlotClassNames<SpinnerSlots> = {\n root: 'fui-Spinner',\n spinner: 'fui-Spinner__spinner',\n spinnerTail: 'fui-Spinner__spinnerTail',\n label: 'fui-Spinner__label',\n};\n\n/**\n * CSS variables used internally by Spinner\n */\nconst vars = {\n strokeWidth: '--fui-Spinner--strokeWidth',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n lineHeight: '0',\n gap: '8px',\n overflow: 'hidden', // prevents height changes from rotating children\n});\n\nconst useRootStyles = makeStyles({\n vertical: {\n flexDirection: 'column',\n },\n});\n\nconst useSpinnerBaseClassName = makeResetStyles({\n position: 'relative',\n flexShrink: 0,\n\n // Use a mask to create the ring shape of the spinner.\n maskImage:\n `radial-gradient(closest-side, ` +\n `transparent calc(100% - var(${vars.strokeWidth}) - 1px), ` +\n `white calc(100% - var(${vars.strokeWidth})) calc(100% - 1px), ` +\n `transparent 100%)`,\n\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\n animationDuration: '1.5s',\n animationIterationCount: 'infinite',\n animationTimingFunction: 'linear',\n animationName: {\n '0%': { transform: 'rotate(0deg)' },\n '100%': { transform: 'rotate(360deg)' },\n },\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationDuration: '1.8s',\n },\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\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\n animationDuration: '1.5s',\n animationIterationCount: 'infinite',\n animationTimingFunction: tokens.curveEasyEase,\n animationName: {\n '0%': { transform: 'rotate(-135deg)' },\n '50%': { transform: 'rotate(0deg)' },\n '100%': { transform: 'rotate(225deg)' },\n },\n '&::before': {\n animationName: {\n '0%': { transform: 'rotate(0deg)' },\n '50%': { transform: 'rotate(105deg)' },\n '100%': { transform: 'rotate(0deg)' },\n },\n },\n '&::after': {\n animationName: {\n '0%': { transform: 'rotate(0deg)' },\n '50%': { transform: 'rotate(225deg)' },\n '100%': { transform: 'rotate(0deg)' },\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});\n\nconst useSpinnerStyles = makeStyles({\n inverted: {\n backgroundColor: tokens.colorNeutralStrokeAlpha2,\n color: tokens.colorNeutralStrokeOnBrand2,\n },\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\n 'extra-tiny': {\n height: '16px',\n width: '16px',\n [vars.strokeWidth]: tokens.strokeWidthThick,\n },\n\n tiny: {\n height: '20px',\n width: '20px',\n [vars.strokeWidth]: tokens.strokeWidthThick,\n },\n\n 'extra-small': {\n height: '24px',\n width: '24px',\n [vars.strokeWidth]: tokens.strokeWidthThick,\n },\n\n small: {\n height: '28px',\n width: '28px',\n [vars.strokeWidth]: tokens.strokeWidthThick,\n },\n\n medium: {\n height: '32px',\n width: '32px',\n [vars.strokeWidth]: tokens.strokeWidthThicker,\n },\n\n large: {\n height: '36px',\n width: '36px',\n [vars.strokeWidth]: tokens.strokeWidthThicker,\n },\n\n 'extra-large': {\n height: '40px',\n width: '40px',\n [vars.strokeWidth]: tokens.strokeWidthThicker,\n },\n\n huge: {\n height: '44px',\n width: '44px',\n [vars.strokeWidth]: tokens.strokeWidthThickest,\n },\n});\n\nconst useLabelStyles = makeStyles({\n inverted: {\n color: tokens.colorNeutralForegroundStaticInverted,\n },\n\n 'extra-tiny': {\n ...typographyStyles.body1,\n },\n\n tiny: {\n ...typographyStyles.body1,\n },\n\n 'extra-small': {\n ...typographyStyles.body1,\n },\n\n small: {\n ...typographyStyles.body1,\n },\n\n medium: {\n ...typographyStyles.subtitle2,\n },\n\n large: {\n ...typographyStyles.subtitle2,\n },\n\n 'extra-large': {\n ...typographyStyles.subtitle2,\n },\n\n huge: {\n ...typographyStyles.subtitle1,\n },\n});\n\n/**\n * Apply styling to the Spinner slots based on the state\n */\nexport const useSpinnerStyles_unstable = (state: SpinnerState): SpinnerState => {\n 'use no memo';\n\n const { labelPosition, size, appearance } = state;\n const { dir } = useFluent();\n\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\n state.root.className = mergeClasses(\n spinnerClassNames.root,\n rootBaseClassName,\n (labelPosition === 'above' || labelPosition === 'below') && rootStyles.vertical,\n state.root.className,\n );\n if (state.spinner) {\n state.spinner.className = mergeClasses(\n spinnerClassNames.spinner,\n spinnerBaseClassName,\n spinnerStyles[size],\n appearance === 'inverted' && spinnerStyles.inverted,\n state.spinner.className,\n );\n }\n if (state.spinnerTail) {\n state.spinnerTail.className = mergeClasses(\n spinnerClassNames.spinnerTail,\n spinnerTailBaseClassName,\n dir === 'rtl' && spinnerStyles.rtlTail,\n state.spinnerTail.className,\n );\n }\n if (state.label) {\n state.label.className = mergeClasses(\n spinnerClassNames.label,\n labelStyles[size],\n appearance === 'inverted' && labelStyles.inverted,\n state.label.className,\n );\n }\n\n return state;\n};\n"],"names":["spinnerClassNames","useSpinnerStyles_unstable","root","spinner","spinnerTail","label","vars","strokeWidth","useRootBaseClassName","makeResetStyles","display","alignItems","justifyContent","lineHeight","gap","overflow","useRootStyles","makeStyles","vertical","flexDirection","useSpinnerBaseClassName","position","flexShrink","maskImage","backgroundColor","tokens","colorBrandStroke2Contrast","color","colorBrandStroke1","forcedColorAdjust","animationDuration","animationIterationCount","animationTimingFunction","animationName","transform","useSpinnerTailBaseClassName","width","height","content","animation","backgroundImage","curveEasyEase","useSpinnerStyles","inverted","colorNeutralStrokeAlpha2","colorNeutralStrokeOnBrand2","rtlTail","strokeWidthThick","tiny","small","medium","strokeWidthThicker","large","huge","strokeWidthThickest","useLabelStyles","colorNeutralForegroundStaticInverted","typographyStyles","body1","subtitle2","subtitle1","state","labelPosition","size","appearance","dir","useFluent","rootBaseClassName","rootStyles","spinnerBaseClassName","spinnerStyles","spinnerTailBaseClassName","labelStyles","className","mergeCl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AACT,KAAK,EACjBC,eAAe,cAAcQ,YAAY7B,QAAQ,EACjDkB,MAAMxD,KAAK,CAACoE,SAAS;IAEzB;IAEA,OAAOZ;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-spinner",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.7.0",
|
|
4
4
|
"description": "Spinner component for Fluent UI React",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@fluentui/react-jsx-runtime": "^9.1.2",
|
|
22
|
-
"@fluentui/react-label": "^9.
|
|
22
|
+
"@fluentui/react-label": "^9.3.0",
|
|
23
23
|
"@fluentui/react-shared-contexts": "^9.24.0",
|
|
24
24
|
"@fluentui/react-theme": "^9.1.24",
|
|
25
25
|
"@fluentui/react-utilities": "^9.22.0",
|