@fluentui/react-spinner 9.3.43 → 9.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -2
- package/dist/index.d.ts +6 -5
- package/lib/components/Spinner/Spinner.types.js +3 -1
- package/lib/components/Spinner/Spinner.types.js.map +1 -1
- package/lib/components/Spinner/renderSpinner.js +3 -1
- package/lib/components/Spinner/renderSpinner.js.map +1 -1
- package/lib/components/Spinner/useSpinner.js +4 -2
- package/lib/components/Spinner/useSpinner.js.map +1 -1
- package/lib/components/Spinner/useSpinnerStyles.styles.js +72 -158
- package/lib/components/Spinner/useSpinnerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Spinner/Spinner.types.js +3 -1
- package/lib-commonjs/components/Spinner/Spinner.types.js.map +1 -1
- package/lib-commonjs/components/Spinner/renderSpinner.js +3 -1
- package/lib-commonjs/components/Spinner/renderSpinner.js.map +1 -1
- package/lib-commonjs/components/Spinner/useSpinner.js +4 -2
- package/lib-commonjs/components/Spinner/useSpinner.js.map +1 -1
- package/lib-commonjs/components/Spinner/useSpinnerStyles.styles.js +121 -248
- package/lib-commonjs/components/Spinner/useSpinnerStyles.styles.js.map +1 -1
- package/lib-commonjs/index.js +9 -9
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +6 -6
- package/lib/components/Spinner/DefaultSvg.js +0 -8
- package/lib/components/Spinner/DefaultSvg.js.map +0 -1
- package/lib-commonjs/components/Spinner/DefaultSvg.js +0 -19
- package/lib-commonjs/components/Spinner/DefaultSvg.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-spinner
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 15 Mar 2024 21:37:57 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.4.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.4.1)
|
|
8
|
+
|
|
9
|
+
Fri, 15 Mar 2024 21:37:57 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.4.0..@fluentui/react-spinner_v9.4.1)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.33 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
|
|
15
|
+
- Bump @fluentui/react-label to v9.1.65 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
|
|
16
|
+
- Bump @fluentui/react-shared-contexts to v9.15.1 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
|
|
17
|
+
- Bump @fluentui/react-theme to v9.1.18 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
|
|
18
|
+
- Bump @fluentui/react-utilities to v9.18.4 ([PR #30740](https://github.com/microsoft/fluentui/pull/30740) by beachball)
|
|
19
|
+
|
|
20
|
+
## [9.4.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.4.0)
|
|
21
|
+
|
|
22
|
+
Thu, 07 Mar 2024 19:33:25 GMT
|
|
23
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.3.43..@fluentui/react-spinner_v9.4.0)
|
|
24
|
+
|
|
25
|
+
### Minor changes
|
|
26
|
+
|
|
27
|
+
- chore: Rewrite Spinner animation using only rotation transforms. ([PR #30567](https://github.com/microsoft/fluentui/pull/30567) by behowell@microsoft.com)
|
|
28
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.32 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
|
|
29
|
+
- Bump @fluentui/react-label to v9.1.64 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
|
|
30
|
+
- Bump @fluentui/react-shared-contexts to v9.15.0 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
|
|
31
|
+
- Bump @fluentui/react-theme to v9.1.17 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
|
|
32
|
+
- Bump @fluentui/react-utilities to v9.18.3 ([PR #30687](https://github.com/microsoft/fluentui/pull/30687) by beachball)
|
|
33
|
+
|
|
7
34
|
## [9.3.43](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.3.43)
|
|
8
35
|
|
|
9
|
-
Wed, 28 Feb 2024 02:
|
|
36
|
+
Wed, 28 Feb 2024 02:34:19 GMT
|
|
10
37
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.3.42..@fluentui/react-spinner_v9.3.43)
|
|
11
38
|
|
|
12
39
|
### Patches
|
package/dist/index.d.ts
CHANGED
|
@@ -61,14 +61,15 @@ export declare type SpinnerSlots = {
|
|
|
61
61
|
*/
|
|
62
62
|
root: NonNullable<Slot<'div'>>;
|
|
63
63
|
/**
|
|
64
|
-
* The
|
|
65
|
-
* The spinner slot receives the `className` and `style` that handles the spinning animation.
|
|
66
|
-
* An svg is also rendered as a child of this slot
|
|
64
|
+
* The animated spinning ring.
|
|
67
65
|
*/
|
|
68
66
|
spinner?: Slot<'span'>;
|
|
69
67
|
/**
|
|
70
|
-
* The
|
|
71
|
-
|
|
68
|
+
* The part of the spinner that rotates.
|
|
69
|
+
*/
|
|
70
|
+
spinnerTail?: NonNullable<Slot<'span'>>;
|
|
71
|
+
/**
|
|
72
|
+
* An optional label for the Spinner.
|
|
72
73
|
*/
|
|
73
74
|
label?: Slot<typeof Label>;
|
|
74
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["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'>>;\n /**\n * The
|
|
1
|
+
{"version":3,"sources":["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'>>;\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":"AAuDA;;CAEC,GACD,WAMI"}
|
|
@@ -8,7 +8,9 @@ import { assertSlots } from '@fluentui/react-utilities';
|
|
|
8
8
|
return /*#__PURE__*/ _jsxs(state.root, {
|
|
9
9
|
children: [
|
|
10
10
|
state.label && shouldRenderSpinner && (labelPosition === 'above' || labelPosition === 'before') && /*#__PURE__*/ _jsx(state.label, {}),
|
|
11
|
-
state.spinner && shouldRenderSpinner && /*#__PURE__*/ _jsx(state.spinner, {
|
|
11
|
+
state.spinner && shouldRenderSpinner && /*#__PURE__*/ _jsx(state.spinner, {
|
|
12
|
+
children: state.spinnerTail && /*#__PURE__*/ _jsx(state.spinnerTail, {})
|
|
13
|
+
}),
|
|
12
14
|
state.label && shouldRenderSpinner && (labelPosition === 'below' || labelPosition === 'after') && /*#__PURE__*/ _jsx(state.label, {})
|
|
13
15
|
]
|
|
14
16
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderSpinner.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { SpinnerState, SpinnerSlots } from './Spinner.types';\n\n/**\n * Render the final JSX of Spinner\n */\nexport const renderSpinner_unstable = (state: SpinnerState) => {\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
|
|
1
|
+
{"version":3,"sources":["renderSpinner.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { SpinnerState, SpinnerSlots } from './Spinner.types';\n\n/**\n * Render the final JSX of Spinner\n */\nexport const renderSpinner_unstable = (state: SpinnerState) => {\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;AAGxD;;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,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { getIntrinsicElementProps, useId, useTimeout, slot } from '@fluentui/react-utilities';
|
|
3
3
|
import { Label } from '@fluentui/react-label';
|
|
4
|
-
import { DefaultSvg } from './DefaultSvg';
|
|
5
4
|
import { useSpinnerContext } from '../../contexts/SpinnerContext';
|
|
6
5
|
/**
|
|
7
6
|
* Create the state required to render Spinner.
|
|
@@ -56,7 +55,6 @@ import { useSpinnerContext } from '../../contexts/SpinnerContext';
|
|
|
56
55
|
const spinnerShortHand = slot.optional(props.spinner, {
|
|
57
56
|
renderByDefault: true,
|
|
58
57
|
defaultProps: {
|
|
59
|
-
children: /*#__PURE__*/ React.createElement(DefaultSvg, null),
|
|
60
58
|
tabIndex
|
|
61
59
|
},
|
|
62
60
|
elementType: 'span'
|
|
@@ -73,10 +71,14 @@ import { useSpinnerContext } from '../../contexts/SpinnerContext';
|
|
|
73
71
|
components: {
|
|
74
72
|
root: 'div',
|
|
75
73
|
spinner: 'span',
|
|
74
|
+
spinnerTail: 'span',
|
|
76
75
|
label: Label
|
|
77
76
|
},
|
|
78
77
|
root: nativeRoot,
|
|
79
78
|
spinner: spinnerShortHand,
|
|
79
|
+
spinnerTail: slot.always(props.spinnerTail, {
|
|
80
|
+
elementType: 'span'
|
|
81
|
+
}),
|
|
80
82
|
label: labelShorthand
|
|
81
83
|
};
|
|
82
84
|
return state;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSpinner.tsx"],"sourcesContent":["import * 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 {
|
|
1
|
+
{"version":3,"sources":["useSpinner.tsx"],"sourcesContent":["import * 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 // Props\n const { size: contextSize } = useSpinnerContext();\n const { appearance = 'primary', labelPosition = 'after', size = contextSize ?? 'medium', delay = 0 } = props;\n const baseId = useId('spinner');\n\n const { role = 'progressbar', tabIndex, ...rest } = props;\n const nativeRoot = slot.always(\n getIntrinsicElementProps(\n 'div',\n {\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 ['size'],\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 defaultProps: { tabIndex },\n elementType: 'span',\n });\n if (labelShorthand && nativeRoot && !nativeRoot['aria-labelledby']) {\n nativeRoot['aria-labelledby'] = labelShorthand.id;\n }\n const state: SpinnerState = {\n appearance,\n delay,\n labelPosition,\n size,\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","labelPosition","delay","baseId","role","tabIndex","rest","nativeRoot","always","elementType","isShownAfterDelay","setIsShownAfterDelay","useState","setDelayTimeout","clearDelayTimeout","useEffect","labelShorthand","optional","label","defaultProps","id","renderByDefault","spinnerShortHand","spinner","state","shouldRenderSpinner","components","root","spinnerTail"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,KAAK,EAAEC,UAAU,EAAEC,IAAI,QAAQ,4BAA4B;AAE9F,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE;;;;;;;;CAQC,GACD,OAAO,MAAMC,sBAAsB,CAACC,OAAqBC;IACvD,QAAQ;IACR,MAAM,EAAEC,MAAMC,WAAW,EAAE,GAAGL;IAC9B,MAAM,EAAEM,aA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ASD;QACTM,aAAapC,KAAKgB,MAAM,CAACZ,MAAMgC,WAAW,EAAE;YAAEnB,aAAa;QAAO;QAClES,OAAOF;IACT;IACA,OAAOQ;AACT,EAAE"}
|
|
@@ -1,192 +1,98 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
|
|
2
2
|
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
3
|
+
import { __resetStyles, __styles, mergeClasses } from '@griffel/react';
|
|
3
4
|
export const spinnerClassNames = {
|
|
4
5
|
root: 'fui-Spinner',
|
|
5
6
|
spinner: 'fui-Spinner__spinner',
|
|
7
|
+
spinnerTail: 'fui-Spinner__spinnerTail',
|
|
6
8
|
label: 'fui-Spinner__label'
|
|
7
9
|
};
|
|
8
|
-
/*
|
|
9
|
-
* TODO: Update with proper tokens when added
|
|
10
|
-
* Radii for the Spinner circles
|
|
11
|
-
*/
|
|
12
|
-
const rValues = {
|
|
13
|
-
extraTiny: '7px',
|
|
14
|
-
tiny: '9px',
|
|
15
|
-
extraSmall: '11px',
|
|
16
|
-
small: '13px',
|
|
17
|
-
medium: '14.5px',
|
|
18
|
-
large: '16.5px',
|
|
19
|
-
extraLarge: '18.5px',
|
|
20
|
-
huge: '20px'
|
|
21
|
-
};
|
|
22
|
-
/*
|
|
23
|
-
* TODO: Update with proper tokens when added
|
|
24
|
-
* Sizes for the Spinner
|
|
25
|
-
*/
|
|
26
|
-
const spinnnerSizes = {
|
|
27
|
-
extraTiny: '16px',
|
|
28
|
-
tiny: '20px',
|
|
29
|
-
extraSmall: '24px',
|
|
30
|
-
small: '28px',
|
|
31
|
-
medium: '32px',
|
|
32
|
-
large: '36px',
|
|
33
|
-
extraLarge: '40px',
|
|
34
|
-
huge: '44px'
|
|
35
|
-
};
|
|
36
|
-
/*
|
|
37
|
-
* TODO: Update with proper tokens when added
|
|
38
|
-
* Animation for Spinner
|
|
39
|
-
*/
|
|
40
|
-
const spinnerAnimation = {
|
|
41
|
-
container: {
|
|
42
|
-
animationDuration: '3s',
|
|
43
|
-
animationIterationCount: 'infinite',
|
|
44
|
-
animationTimingFunction: 'linear',
|
|
45
|
-
backgroundColor: 'transparent'
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
10
|
/**
|
|
49
|
-
*
|
|
11
|
+
* CSS variables used internally by Spinner
|
|
50
12
|
*/
|
|
13
|
+
const vars = {
|
|
14
|
+
strokeWidth: '--fui-Spinner--strokeWidth'
|
|
15
|
+
};
|
|
16
|
+
const useRootBaseClassName = /*#__PURE__*/__resetStyles("r1k3z50n", null, [".r1k3z50n{display:flex;align-items:center;justify-content:center;line-height:0;gap:8px;}"]);
|
|
51
17
|
const useRootStyles = /*#__PURE__*/__styles({
|
|
52
|
-
root: {
|
|
53
|
-
mc9l5x: "f22iagw",
|
|
54
|
-
Bt984gj: "f122n59",
|
|
55
|
-
Brf1p80: "f4d9j23",
|
|
56
|
-
Bg96gwp: "fez10in",
|
|
57
|
-
i8kkvl: "f4px1ci",
|
|
58
|
-
Belr9w4: "fn67r4l"
|
|
59
|
-
},
|
|
60
|
-
horizontal: {
|
|
61
|
-
Beiy3e4: "f1063pyq"
|
|
62
|
-
},
|
|
63
18
|
vertical: {
|
|
64
19
|
Beiy3e4: "f1vx9l62"
|
|
65
20
|
}
|
|
66
21
|
}, {
|
|
67
|
-
d: [".
|
|
22
|
+
d: [".f1vx9l62{flex-direction:column;}"]
|
|
68
23
|
});
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
24
|
+
const useSpinnerBaseClassName = /*#__PURE__*/__resetStyles("rvgcg50", "r15nd2jo", {
|
|
25
|
+
r: [".rvgcg50{position:relative;flex-shrink:0;-webkit-mask-image:radial-gradient(closest-side, transparent calc(100% - var(--fui-Spinner--strokeWidth) - 1px), white calc(100% - var(--fui-Spinner--strokeWidth)) calc(100% - 1px), transparent 100%);mask-image:radial-gradient(closest-side, transparent calc(100% - var(--fui-Spinner--strokeWidth) - 1px), white calc(100% - var(--fui-Spinner--strokeWidth)) calc(100% - 1px), transparent 100%);background-color:var(--colorBrandStroke2Contrast);color:var(--colorBrandStroke1);animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear;animation-name:rb7n1on;}", "@keyframes rb7n1on{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}", ".r15nd2jo{position:relative;flex-shrink:0;-webkit-mask-image:radial-gradient(closest-side, transparent calc(100% - var(--fui-Spinner--strokeWidth) - 1px), white calc(100% - var(--fui-Spinner--strokeWidth)) calc(100% - 1px), transparent 100%);mask-image:radial-gradient(closest-side, transparent calc(100% - var(--fui-Spinner--strokeWidth) - 1px), white calc(100% - var(--fui-Spinner--strokeWidth)) calc(100% - 1px), transparent 100%);background-color:var(--colorBrandStroke2Contrast);color:var(--colorBrandStroke1);animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear;animation-name:r1gx3jof;}", "@keyframes r1gx3jof{0%{transform:rotate(0deg);}100%{transform:rotate(-360deg);}}"],
|
|
26
|
+
s: ["@media screen and (forced-colors: active){.rvgcg50{background-color:HighlightText;color:Highlight;forced-color-adjust:none;}}", "@media screen and (prefers-reduced-motion: reduce){.rvgcg50{animation-duration:1.8s;}}", "@media screen and (forced-colors: active){.r15nd2jo{background-color:HighlightText;color:Highlight;forced-color-adjust:none;}}", "@media screen and (prefers-reduced-motion: reduce){.r15nd2jo{animation-duration:1.8s;}}"]
|
|
27
|
+
});
|
|
28
|
+
// The spinner tail is rendered using two 135deg arc segments, behind a 105deg arc mask.
|
|
29
|
+
// The segments are rotated out from behind the mask to expand the visible arc from
|
|
30
|
+
// 30deg (min) to 255deg (max), and then back behind the mask again to shrink the arc.
|
|
31
|
+
// The tail and spinner itself also have 360deg rotation animations for the spin.
|
|
32
|
+
const useSpinnerTailBaseClassName = /*#__PURE__*/__resetStyles("r1lregi5", "rxq293c", {
|
|
33
|
+
r: [".r1lregi5{position:absolute;width:100%;height:100%;-webkit-mask-image:conic-gradient(transparent 105deg, white 105deg);mask-image:conic-gradient(transparent 105deg, white 105deg);animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:var(--curveEasyEase);animation-name:r15mim6k;}", ".r1lregi5::before,.r1lregi5::after{content:\"\";position:absolute;width:100%;height:100%;animation:inherit;background-image:conic-gradient(currentcolor 135deg, transparent 135deg);}", "@keyframes r15mim6k{0%{transform:rotate(-135deg);}50%{transform:rotate(0deg);}100%{transform:rotate(225deg);}}", ".r1lregi5::before{animation-name:r18vhmn8;}", "@keyframes r18vhmn8{0%{transform:rotate(0deg);}50%{transform:rotate(105deg);}100%{transform:rotate(0deg);}}", ".r1lregi5::after{animation-name:rkgrvoi;}", "@keyframes rkgrvoi{0%{transform:rotate(0deg);}50%{transform:rotate(225deg);}100%{transform:rotate(0deg);}}", ".rxq293c{position:absolute;width:100%;height:100%;-webkit-mask-image:conic-gradient(transparent 105deg, white 105deg);mask-image:conic-gradient(transparent 105deg, white 105deg);animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:var(--curveEasyEase);animation-name:r109gmi5;}", ".rxq293c::before,.rxq293c::after{content:\"\";position:absolute;width:100%;height:100%;animation:inherit;background-image:conic-gradient(currentcolor 135deg, transparent 135deg);}", "@keyframes r109gmi5{0%{transform:rotate(135deg);}50%{transform:rotate(0deg);}100%{transform:rotate(-225deg);}}", ".rxq293c::before{animation-name:r17whflh;}", "@keyframes r17whflh{0%{transform:rotate(0deg);}50%{transform:rotate(-105deg);}100%{transform:rotate(0deg);}}", ".rxq293c::after{animation-name:re4odhl;}", "@keyframes re4odhl{0%{transform:rotate(0deg);}50%{transform:rotate(-225deg);}100%{transform:rotate(0deg);}}"],
|
|
34
|
+
s: ["@media screen and (prefers-reduced-motion: reduce){.r1lregi5{animation-iteration-count:0;background-image:conic-gradient(transparent 120deg, currentcolor 360deg);}.r1lregi5::before,.r1lregi5::after{content:none;}}", "@media screen and (prefers-reduced-motion: reduce){.rxq293c{animation-iteration-count:0;background-image:conic-gradient(transparent 120deg, currentcolor 360deg);}.rxq293c::before,.rxq293c::after{content:none;}}"]
|
|
35
|
+
});
|
|
36
|
+
const useSpinnerStyles = /*#__PURE__*/__styles({
|
|
37
|
+
inverted: {
|
|
38
|
+
De3pzq: "fr407j0",
|
|
39
|
+
sj55zd: "f1f7voed"
|
|
40
|
+
},
|
|
41
|
+
rtlTail: {
|
|
42
|
+
btxmck: "f179dep3",
|
|
43
|
+
gb5jj2: "fbz9ihp",
|
|
44
|
+
Br2kee7: "f1wkkxo7"
|
|
84
45
|
},
|
|
85
46
|
"extra-tiny": {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
B807ibg: "f1oebb0s"
|
|
47
|
+
Bqenvij: "fd461yt",
|
|
48
|
+
a9b677: "fjw5fx7",
|
|
49
|
+
qmp6fs: "f1v3ph3m"
|
|
90
50
|
},
|
|
91
51
|
tiny: {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
B807ibg: "fngtx1d"
|
|
52
|
+
Bqenvij: "fjamq6b",
|
|
53
|
+
a9b677: "f64fuq3",
|
|
54
|
+
qmp6fs: "f1v3ph3m"
|
|
96
55
|
},
|
|
97
56
|
"extra-small": {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
B807ibg: "fadawes"
|
|
57
|
+
Bqenvij: "frvgh55",
|
|
58
|
+
a9b677: "fq4mcun",
|
|
59
|
+
qmp6fs: "f1v3ph3m"
|
|
102
60
|
},
|
|
103
61
|
small: {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
B807ibg: "f1xqyyrl"
|
|
62
|
+
Bqenvij: "fxldao9",
|
|
63
|
+
a9b677: "f1w9dchk",
|
|
64
|
+
qmp6fs: "f1v3ph3m"
|
|
108
65
|
},
|
|
109
66
|
medium: {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
B807ibg: "f1u06hy7"
|
|
67
|
+
Bqenvij: "f1d2rq10",
|
|
68
|
+
a9b677: "f1szoe96",
|
|
69
|
+
qmp6fs: "fb52u90"
|
|
114
70
|
},
|
|
115
71
|
large: {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
B807ibg: "f13pmvhl"
|
|
72
|
+
Bqenvij: "f8ljn23",
|
|
73
|
+
a9b677: "fpdz1er",
|
|
74
|
+
qmp6fs: "fb52u90"
|
|
120
75
|
},
|
|
121
76
|
"extra-large": {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
B807ibg: "fmn74v6"
|
|
77
|
+
Bqenvij: "fbhnoac",
|
|
78
|
+
a9b677: "feqmc2u",
|
|
79
|
+
qmp6fs: "fb52u90"
|
|
126
80
|
},
|
|
127
81
|
huge: {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
B807ibg: "f1fr1izd"
|
|
132
|
-
}
|
|
133
|
-
}, {
|
|
134
|
-
f: [".f1or16p5:focus{outline-width:3px;}", ".f1grzc83:focus{outline-style:solid;}", ".f19shzzi:focus{outline-color:transparent;}"],
|
|
135
|
-
k: ["@keyframes fb7n1on{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}", "@keyframes f1gx3jof{0%{transform:rotate(0deg);}100%{transform:rotate(-360deg);}}"],
|
|
136
|
-
d: [".f5tbecn>svg{animation-name:fb7n1on;}", ".f15qb8s7>svg{animation-name:f1gx3jof;}", ".fn4mtlg>svg{animation-duration:3s;}", ".f1y80fxs>svg{animation-iteration-count:infinite;}", ".f1r2crtq>svg{animation-timing-function:linear;}", ".f1wsi8sr>svg{background-color:transparent;}", ".f1da2vov>svg>circle{cx:50%;}", ".f11rfva0>svg>circle{cy:50%;}", ".f1exc66>svg>circle{fill:none;}", ".f1x2gjcb>svg{height:16px;}", ".f1vjiaua>svg{width:16px;}", ".fv1u54w>svg>circle{stroke-width:var(--strokeWidthThick);}", ".f1oebb0s>svg>circle{r:7px;}", ".f1j4wmu2>svg{height:20px;}", ".f1vppzuq>svg{width:20px;}", ".fngtx1d>svg>circle{r:9px;}", ".fmpqlna>svg{height:24px;}", ".f15z5jzu>svg{width:24px;}", ".fadawes>svg>circle{r:11px;}", ".fo52gbo>svg{height:28px;}", ".f1b41i3v>svg{width:28px;}", ".f1xqyyrl>svg>circle{r:13px;}", ".f1aiqagr>svg{height:32px;}", ".f1wtx80b>svg{width:32px;}", ".f1flujpd>svg>circle{stroke-width:var(--strokeWidthThicker);}", ".f1u06hy7>svg>circle{r:14.5px;}", ".f1trdq7b>svg{height:36px;}", ".f9e0mc5>svg{width:36px;}", ".f13pmvhl>svg>circle{r:16.5px;}", ".f89rf2a>svg{height:40px;}", ".f1w2xg3q>svg{width:40px;}", ".fmn74v6>svg>circle{r:18.5px;}", ".f1rx7k5y>svg{height:44px;}", ".f1vtyt49>svg{width:44px;}", ".f1owbg48>svg>circle{stroke-width:var(--strokeWidthThickest);}", ".f1fr1izd>svg>circle{r:20px;}"],
|
|
137
|
-
m: [["@media screen and (prefers-reduced-motion: reduce){.f1bkm2qd>svg{animation-duration:0.01ms;}}", {
|
|
138
|
-
m: "screen and (prefers-reduced-motion: reduce)"
|
|
139
|
-
}], ["@media screen and (prefers-reduced-motion: reduce){.f1urqz7h>svg{animation-iteration-count:1;}}", {
|
|
140
|
-
m: "screen and (prefers-reduced-motion: reduce)"
|
|
141
|
-
}]]
|
|
142
|
-
});
|
|
143
|
-
const useTrackStyles = /*#__PURE__*/__styles({
|
|
144
|
-
inverted: {
|
|
145
|
-
gwg7kz: "f1jvpmnu",
|
|
146
|
-
Bvrehnu: "fq8a5sv",
|
|
147
|
-
Bidp6o: "f1b4lwqj",
|
|
148
|
-
cq3kgi: "f1najlst",
|
|
149
|
-
Btwiser: "fjxod4",
|
|
150
|
-
B8001xd: "fu3xdw0",
|
|
151
|
-
Bdordwa: ["f1ttdh6v", "fmyjox0"],
|
|
152
|
-
Bo2mdfu: "f1eseayc",
|
|
153
|
-
E10nrc: "folzdkc",
|
|
154
|
-
Bwl7w15: "fhlfkde",
|
|
155
|
-
Bksq7rz: "f1esql28"
|
|
156
|
-
},
|
|
157
|
-
primary: {
|
|
158
|
-
gwg7kz: "f11ditju",
|
|
159
|
-
B8k2rxp: "f1m9nikz",
|
|
160
|
-
Bvrehnu: "fq8a5sv",
|
|
161
|
-
Bidp6o: "f1b4lwqj",
|
|
162
|
-
cq3kgi: "f1najlst",
|
|
163
|
-
Btwiser: "fjxod4",
|
|
164
|
-
B8001xd: "fu3xdw0",
|
|
165
|
-
Bdordwa: ["f1ttdh6v", "fmyjox0"],
|
|
166
|
-
Bo2mdfu: "f1eseayc",
|
|
167
|
-
E10nrc: "folzdkc",
|
|
168
|
-
Bwl7w15: "fhlfkde",
|
|
169
|
-
Bksq7rz: "f13qeqtg",
|
|
170
|
-
y14cdu: "flglbw1"
|
|
82
|
+
Bqenvij: "f1ft4266",
|
|
83
|
+
a9b677: "fksc0bp",
|
|
84
|
+
qmp6fs: "fa3u9ii"
|
|
171
85
|
}
|
|
172
86
|
}, {
|
|
173
|
-
d: [".
|
|
174
|
-
|
|
175
|
-
m: [["@media screen and (prefers-reduced-motion: reduce){.folzdkc>svg>circle.fui-Spinner__Tail{animation-duration:0.01ms;}}", {
|
|
87
|
+
d: [".fr407j0{background-color:var(--colorNeutralStrokeAlpha2);}", ".f1f7voed{color:var(--colorNeutralStrokeOnBrand2);}", ".f179dep3{-webkit-mask-image:conic-gradient(white 255deg, transparent 255deg);mask-image:conic-gradient(white 255deg, transparent 255deg);}", ".fbz9ihp::before,.fbz9ihp::after{background-image:conic-gradient(transparent 225deg, currentcolor 225deg);}", ".fd461yt{height:16px;}", ".fjw5fx7{width:16px;}", ".f1v3ph3m{--fui-Spinner--strokeWidth:var(--strokeWidthThick);}", ".fjamq6b{height:20px;}", ".f64fuq3{width:20px;}", ".frvgh55{height:24px;}", ".fq4mcun{width:24px;}", ".fxldao9{height:28px;}", ".f1w9dchk{width:28px;}", ".f1d2rq10{height:32px;}", ".f1szoe96{width:32px;}", ".fb52u90{--fui-Spinner--strokeWidth:var(--strokeWidthThicker);}", ".f8ljn23{height:36px;}", ".fpdz1er{width:36px;}", ".fbhnoac{height:40px;}", ".feqmc2u{width:40px;}", ".f1ft4266{height:44px;}", ".fksc0bp{width:44px;}", ".fa3u9ii{--fui-Spinner--strokeWidth:var(--strokeWidthThickest);}"],
|
|
88
|
+
m: [["@media screen and (prefers-reduced-motion: reduce){.f1wkkxo7{background-image:conic-gradient(currentcolor 0deg, transparent 240deg);}}", {
|
|
176
89
|
m: "screen and (prefers-reduced-motion: reduce)"
|
|
177
|
-
}], ["@media screen and (prefers-reduced-motion: reduce){.fhlfkde>svg>circle.fui-Spinner__Tail{animation-iteration-count:1;}}", {
|
|
178
|
-
m: "screen and (prefers-reduced-motion: reduce)"
|
|
179
|
-
}], ["@media screen and (forced-colors: active){.f1m9nikz>svg>circle.fui-Spinner__Tail{stroke:var(--colorNeutralStrokeOnBrand2);}}", {
|
|
180
|
-
m: "screen and (forced-colors: active)"
|
|
181
|
-
}], ["@media screen and (forced-colors: active){.flglbw1>svg>circle.fui-Spinner__Track{stroke:var(--colorNeutralBackgroundInverted);}}", {
|
|
182
|
-
m: "screen and (forced-colors: active)"
|
|
183
90
|
}]]
|
|
184
91
|
});
|
|
185
92
|
const useLabelStyles = /*#__PURE__*/__styles({
|
|
186
93
|
inverted: {
|
|
187
|
-
sj55zd: "
|
|
94
|
+
sj55zd: "fonrgv7"
|
|
188
95
|
},
|
|
189
|
-
primary: {},
|
|
190
96
|
"extra-tiny": {
|
|
191
97
|
Bahqtrf: "fk6fouc",
|
|
192
98
|
Be2twd7: "fkhj508",
|
|
@@ -236,7 +142,7 @@ const useLabelStyles = /*#__PURE__*/__styles({
|
|
|
236
142
|
Bg96gwp: "f106mvju"
|
|
237
143
|
}
|
|
238
144
|
}, {
|
|
239
|
-
d: [".
|
|
145
|
+
d: [".fonrgv7{color:var(--colorNeutralForegroundStaticInverted);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".f1pp30po{font-size:var(--fontSizeBase500);}", ".f106mvju{line-height:var(--lineHeightBase500);}"]
|
|
240
146
|
});
|
|
241
147
|
/**
|
|
242
148
|
* Apply styling to the Spinner slots based on the state
|
|
@@ -245,18 +151,26 @@ export const useSpinnerStyles_unstable = state => {
|
|
|
245
151
|
const {
|
|
246
152
|
labelPosition,
|
|
247
153
|
size,
|
|
248
|
-
appearance
|
|
154
|
+
appearance
|
|
249
155
|
} = state;
|
|
156
|
+
const {
|
|
157
|
+
dir
|
|
158
|
+
} = useFluent();
|
|
159
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
250
160
|
const rootStyles = useRootStyles();
|
|
251
|
-
const
|
|
161
|
+
const spinnerBaseClassName = useSpinnerBaseClassName();
|
|
162
|
+
const spinnerStyles = useSpinnerStyles();
|
|
163
|
+
const spinnerTailBaseClassName = useSpinnerTailBaseClassName();
|
|
252
164
|
const labelStyles = useLabelStyles();
|
|
253
|
-
|
|
254
|
-
state.root.className = mergeClasses(spinnerClassNames.root, rootStyles.root, (labelPosition === 'above' || labelPosition === 'below') && rootStyles.vertical, (labelPosition === 'before' || labelPosition === 'after') && rootStyles.horizontal, state.root.className);
|
|
165
|
+
state.root.className = mergeClasses(spinnerClassNames.root, rootBaseClassName, (labelPosition === 'above' || labelPosition === 'below') && rootStyles.vertical, state.root.className);
|
|
255
166
|
if (state.spinner) {
|
|
256
|
-
state.spinner.className = mergeClasses(spinnerClassNames.spinner,
|
|
167
|
+
state.spinner.className = mergeClasses(spinnerClassNames.spinner, spinnerBaseClassName, spinnerStyles[size], appearance === 'inverted' && spinnerStyles.inverted, state.spinner.className);
|
|
168
|
+
}
|
|
169
|
+
if (state.spinnerTail) {
|
|
170
|
+
state.spinnerTail.className = mergeClasses(spinnerClassNames.spinnerTail, spinnerTailBaseClassName, dir === 'rtl' && spinnerStyles.rtlTail, state.spinnerTail.className);
|
|
257
171
|
}
|
|
258
172
|
if (state.label) {
|
|
259
|
-
state.label.className = mergeClasses(spinnerClassNames.label, labelStyles[size], labelStyles
|
|
173
|
+
state.label.className = mergeClasses(spinnerClassNames.label, labelStyles[size], appearance === 'inverted' && labelStyles.inverted, state.label.className);
|
|
260
174
|
}
|
|
261
175
|
return state;
|
|
262
176
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","spinnerClassNames","root","spinner","label","rValues","extraTiny","tiny","extraSmall","small","medium","large","extraLarge","huge","spinnnerSizes","spinnerAnimation","container","animationDuration","animationIterationCount","animationTimingFunction","backgroundColor","useRootStyles","mc9l5x","Bt984gj","Brf1p80","Bg96gwp","i8kkvl","Belr9w4","horizontal","Beiy3e4","vertical","d","useLoaderStyles","spinnerSVG","B3aqqti","Brovlpu","Bxa1mx5","Bwaue66","fyp1ls","ag6ruv","osj692","aq5vjd","tlu9e1","J3u96z","d32isg","Bsvqbuc","b3s3i5","Bah9ito","ut6tcf","B7p06xz","B807ibg","f","k","m","useTrackStyles","inverted","gwg7kz","Bvrehnu","Bidp6o","cq3kgi","Btwiser","B8001xd","Bdordwa","Bo2mdfu","E10nrc","Bwl7w15","Bksq7rz","primary","B8k2rxp","y14cdu","useLabelStyles","sj55zd","Bahqtrf","Be2twd7","Bhrd7zp","useSpinnerStyles_unstable","state","labelPosition","size","appearance","rootStyles","spinnerStyles","labelStyles","trackStyles","className"],"sources":["useSpinnerStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const spinnerClassNames = {\n root: 'fui-Spinner',\n spinner: 'fui-Spinner__spinner',\n label: 'fui-Spinner__label'\n};\n/*\n * TODO: Update with proper tokens when added\n * Radii for the Spinner circles\n */ const rValues = {\n extraTiny: '7px',\n tiny: '9px',\n extraSmall: '11px',\n small: '13px',\n medium: '14.5px',\n large: '16.5px',\n extraLarge: '18.5px',\n huge: '20px'\n};\n/*\n * TODO: Update with proper tokens when added\n * Sizes for the Spinner\n */ const spinnnerSizes = {\n extraTiny: '16px',\n tiny: '20px',\n extraSmall: '24px',\n small: '28px',\n medium: '32px',\n large: '36px',\n extraLarge: '40px',\n huge: '44px'\n};\n/*\n * TODO: Update with proper tokens when added\n * Animation for Spinner\n */ const spinnerAnimation = {\n container: {\n animationDuration: '3s',\n animationIterationCount: 'infinite',\n animationTimingFunction: 'linear',\n backgroundColor: 'transparent'\n }\n};\n/**\n * Styles for the root slot\n */ const useRootStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n lineHeight: '0',\n ...shorthands.gap('8px')\n },\n horizontal: {\n flexDirection: 'row'\n },\n vertical: {\n flexDirection: 'column'\n }\n});\nconst useLoaderStyles = makeStyles({\n // global SVG class\n spinnerSVG: {\n ':focus': {\n ...shorthands.outline('3px', 'solid', 'transparent')\n },\n ['& > svg']: {\n animationName: {\n '0%': {\n transform: 'rotate(0deg)'\n },\n '100%': {\n transform: 'rotate(360deg)'\n }\n },\n ...spinnerAnimation.container,\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationDuration: '0.01ms',\n animationIterationCount: '1'\n }\n },\n ['& > svg > circle']: {\n cx: '50%',\n cy: '50%',\n fill: 'none'\n }\n },\n 'extra-tiny': {\n ['& > svg']: {\n height: spinnnerSizes.extraTiny,\n width: spinnnerSizes.extraTiny\n },\n ['& > svg > circle']: {\n strokeWidth: tokens.strokeWidthThick,\n r: rValues.extraTiny\n }\n },\n tiny: {\n ['& > svg']: {\n height: spinnnerSizes.tiny,\n width: spinnnerSizes.tiny\n },\n ['& > svg > circle']: {\n strokeWidth: tokens.strokeWidthThick,\n r: rValues.tiny\n }\n },\n 'extra-small': {\n ['& > svg']: {\n height: spinnnerSizes.extraSmall,\n width: spinnnerSizes.extraSmall\n },\n ['& > svg > circle']: {\n strokeWidth: tokens.strokeWidthThick,\n r: rValues.extraSmall\n }\n },\n small: {\n ['& > svg']: {\n height: spinnnerSizes.small,\n width: spinnnerSizes.small\n },\n ['& > svg > circle']: {\n strokeWidth: tokens.strokeWidthThick,\n r: rValues.small\n }\n },\n medium: {\n ['& > svg']: {\n height: spinnnerSizes.medium,\n width: spinnnerSizes.medium\n },\n ['& > svg > circle']: {\n strokeWidth: tokens.strokeWidthThicker,\n r: rValues.medium\n }\n },\n large: {\n ['& > svg']: {\n height: spinnnerSizes.large,\n width: spinnnerSizes.large\n },\n ['& > svg > circle']: {\n strokeWidth: tokens.strokeWidthThicker,\n r: rValues.large\n }\n },\n 'extra-large': {\n ['& > svg']: {\n height: spinnnerSizes.extraLarge,\n width: spinnnerSizes.extraLarge\n },\n ['& > svg > circle']: {\n strokeWidth: tokens.strokeWidthThicker,\n r: rValues.extraLarge\n }\n },\n huge: {\n ['& > svg']: {\n height: spinnnerSizes.huge,\n width: spinnnerSizes.huge\n },\n ['& > svg > circle']: {\n strokeWidth: tokens.strokeWidthThickest,\n r: rValues.huge\n }\n }\n});\nconst useTrackStyles = makeStyles({\n inverted: {\n ['& > svg > circle.fui-Spinner__Tail']: {\n stroke: tokens.colorNeutralStrokeOnBrand2,\n animationName: {\n '0%': {\n strokeDasharray: '1,150',\n strokeDashoffset: '0'\n },\n '50%': {\n strokeDasharray: '90,150',\n strokeDashoffset: '-35'\n },\n '100%': {\n strokeDasharray: '90,150',\n strokeDashoffset: '-124'\n }\n },\n animationDuration: '1.5s',\n animationIterationCount: 'infinite',\n animationTimingFunction: tokens.curveEasyEase,\n strokeLinecap: 'round',\n transform: 'rotate(-90deg)',\n transformOrigin: '50% 50%',\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationDuration: '0.01ms',\n animationIterationCount: '1'\n }\n },\n ['& > svg > circle.fui-Spinner__Track']: {\n stroke: 'rgba(255, 255, 255, 0.2)'\n }\n },\n primary: {\n ['& > svg > circle.fui-Spinner__Tail']: {\n stroke: tokens.colorBrandStroke1,\n '@media screen and (forced-colors: active)': {\n stroke: tokens.colorNeutralStrokeOnBrand2\n },\n animationName: {\n '0%': {\n strokeDasharray: '1,150',\n strokeDashoffset: '0'\n },\n '50%': {\n strokeDasharray: '90,150',\n strokeDashoffset: '-35'\n },\n '100%': {\n strokeDasharray: '90,150',\n strokeDashoffset: '-124'\n }\n },\n animationDuration: '1.5s',\n animationIterationCount: 'infinite',\n animationTimingFunction: tokens.curveEasyEase,\n strokeLinecap: 'round',\n transform: 'rotate(-90deg)',\n transformOrigin: '50% 50%',\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationDuration: '0.01ms',\n animationIterationCount: '1'\n }\n },\n ['& > svg > circle.fui-Spinner__Track']: {\n stroke: tokens.colorBrandStroke2Contrast,\n '@media screen and (forced-colors: active)': {\n stroke: tokens.colorNeutralBackgroundInverted\n }\n }\n }\n});\nconst useLabelStyles = makeStyles({\n // style for label\n inverted: {\n color: 'rgba(255, 255, 255, 1)'\n },\n primary: {},\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 = 'primary' } = state;\n const rootStyles = useRootStyles();\n const spinnerStyles = useLoaderStyles();\n const labelStyles = useLabelStyles();\n const trackStyles = useTrackStyles();\n state.root.className = mergeClasses(spinnerClassNames.root, rootStyles.root, (labelPosition === 'above' || labelPosition === 'below') && rootStyles.vertical, (labelPosition === 'before' || labelPosition === 'after') && rootStyles.horizontal, state.root.className);\n if (state.spinner) {\n state.spinner.className = mergeClasses(spinnerClassNames.spinner, spinnerStyles.spinnerSVG, spinnerStyles[size], trackStyles[appearance], state.spinner.className);\n }\n if (state.label) {\n state.label.className = mergeClasses(spinnerClassNames.label, labelStyles[size], labelStyles[appearance], state.label.className);\n }\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,OAAO,MAAMC,iBAAiB,GAAG;EAC7BC,IAAI,EAAE,aAAa;EACnBC,OAAO,EAAE,sBAAsB;EAC/BC,KAAK,EAAE;AACX,CAAC;AACD;AACA;AACA;AACA;AAAI,MAAMC,OAAO,GAAG;EAChBC,SAAS,EAAE,KAAK;EAChBC,IAAI,EAAE,KAAK;EACXC,UAAU,EAAE,MAAM;EAClBC,KAAK,EAAE,MAAM;EACbC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,QAAQ;EACfC,UAAU,EAAE,QAAQ;EACpBC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AACA;AAAI,MAAMC,aAAa,GAAG;EACtBR,SAAS,EAAE,MAAM;EACjBC,IAAI,EAAE,MAAM;EACZC,UAAU,EAAE,MAAM;EAClBC,KAAK,EAAE,MAAM;EACbC,MAAM,EAAE,MAAM;EACdC,KAAK,EAAE,MAAM;EACbC,UAAU,EAAE,MAAM;EAClBC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AACA;AAAI,MAAME,gBAAgB,GAAG;EACzBC,SAAS,EAAE;IACPC,iBAAiB,EAAE,IAAI;IACvBC,uBAAuB,EAAE,UAAU;IACnCC,u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okens","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","Br2kee7","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":["import { 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});\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 width: '100%',\n height: '100%',\n maskImage: 'conic-gradient(transparent 105deg, white 105deg)',\n '&::before, &::after': {\n content: '\"\"',\n position: 'absolute',\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 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,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,+GAM5B,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,CA4DnC,CAAC;AACF,MAAME,gBAAgB,gBAAGlB,QAAA;EAAAmB,QAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC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AAS,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["Spinner.types.js"],"sourcesContent":["/**\n * State used in rendering Spinner\n */ export { };\n"],"names":[],"mappings":"AAAA;;CAEC"}
|
|
@@ -16,7 +16,9 @@ const renderSpinner_unstable = (state)=>{
|
|
|
16
16
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
|
|
17
17
|
children: [
|
|
18
18
|
state.label && shouldRenderSpinner && (labelPosition === 'above' || labelPosition === 'before') && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.label, {}),
|
|
19
|
-
state.spinner && shouldRenderSpinner && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.spinner, {
|
|
19
|
+
state.spinner && shouldRenderSpinner && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.spinner, {
|
|
20
|
+
children: state.spinnerTail && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.spinnerTail, {})
|
|
21
|
+
}),
|
|
20
22
|
state.label && shouldRenderSpinner && (labelPosition === 'below' || labelPosition === 'after') && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.label, {})
|
|
21
23
|
]
|
|
22
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderSpinner.js"],"sourcesContent":[" import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of Spinner\n */ export const renderSpinner_unstable = (state)=>{\n assertSlots(state);\n const { labelPosition, shouldRenderSpinner } = state;\n return /*#__PURE__*/ _jsxs(state.root, {\n children: [\n state.label && shouldRenderSpinner && (labelPosition === 'above' || labelPosition === 'before') && /*#__PURE__*/ _jsx(state.label, {}),\n state.spinner && shouldRenderSpinner && /*#__PURE__*/ _jsx(state.spinner, {}),\n state.label && shouldRenderSpinner && (labelPosition === 'below' || labelPosition === 'after') && /*#__PURE__*/ _jsx(state.label, {})\n ]\n });\n};\n"],"names":["renderSpinner_unstable","state","assertSlots","labelPosition","shouldRenderSpinner","_jsxs","root","children","label","_jsx","spinner"],"mappings":";;;;+BAIiBA;;;eAAAA;;;4BAJ4B;gCACjB;AAGjB,MAAMA,yBAAyB,CAACC;IACvCC,IAAAA,2BAAW,EAACD;IACZ,MAAM,EAAEE,aAAa,EAAEC,mBAAmB,EAAE,GAAGH;IAC/C,OAAO,WAAW,GAAGI,IAAAA,gBAAK,EAACJ,MAAMK,IAAI,EAAE;QACnCC,UAAU;YACNN,MAAMO,KAAK,IAAIJ,uBAAwBD,CAAAA,kBAAkB,WAAWA,kBAAkB,QAAO,KAAM,WAAW,GAAGM,IAAAA,eAAI,EAACR,MAAMO,KAAK,EAAE,CAAC;YACpIP,MAAMS,OAAO,IAAIN,uBAAuB,WAAW,GAAGK,IAAAA,eAAI,EAACR,MAAMS,OAAO,EAAE,CAAC;
|
|
1
|
+
{"version":3,"sources":["renderSpinner.js"],"sourcesContent":[" import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of Spinner\n */ export const renderSpinner_unstable = (state)=>{\n assertSlots(state);\n const { labelPosition, shouldRenderSpinner } = state;\n return /*#__PURE__*/ _jsxs(state.root, {\n children: [\n state.label && shouldRenderSpinner && (labelPosition === 'above' || labelPosition === 'before') && /*#__PURE__*/ _jsx(state.label, {}),\n state.spinner && shouldRenderSpinner && /*#__PURE__*/ _jsx(state.spinner, {\n children: state.spinnerTail && /*#__PURE__*/ _jsx(state.spinnerTail, {})\n }),\n state.label && shouldRenderSpinner && (labelPosition === 'below' || labelPosition === 'after') && /*#__PURE__*/ _jsx(state.label, {})\n ]\n });\n};\n"],"names":["renderSpinner_unstable","state","assertSlots","labelPosition","shouldRenderSpinner","_jsxs","root","children","label","_jsx","spinner","spinnerTail"],"mappings":";;;;+BAIiBA;;;eAAAA;;;4BAJ4B;gCACjB;AAGjB,MAAMA,yBAAyB,CAACC;IACvCC,IAAAA,2BAAW,EAACD;IACZ,MAAM,EAAEE,aAAa,EAAEC,mBAAmB,EAAE,GAAGH;IAC/C,OAAO,WAAW,GAAGI,IAAAA,gBAAK,EAACJ,MAAMK,IAAI,EAAE;QACnCC,UAAU;YACNN,MAAMO,KAAK,IAAIJ,uBAAwBD,CAAAA,kBAAkB,WAAWA,kBAAkB,QAAO,KAAM,WAAW,GAAGM,IAAAA,eAAI,EAACR,MAAMO,KAAK,EAAE,CAAC;YACpIP,MAAMS,OAAO,IAAIN,uBAAuB,WAAW,GAAGK,IAAAA,eAAI,EAACR,MAAMS,OAAO,EAAE;gBACtEH,UAAUN,MAAMU,WAAW,IAAI,WAAW,GAAGF,IAAAA,eAAI,EAACR,MAAMU,WAAW,EAAE,CAAC;YAC1E;YACAV,MAAMO,KAAK,IAAIJ,uBAAwBD,CAAAA,kBAAkB,WAAWA,kBAAkB,OAAM,KAAM,WAAW,GAAGM,IAAAA,eAAI,EAACR,MAAMO,KAAK,EAAE,CAAC;SACtI;IACL;AACJ"}
|
|
@@ -12,7 +12,6 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
|
|
|
12
12
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
13
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
14
14
|
const _reactlabel = require("@fluentui/react-label");
|
|
15
|
-
const _DefaultSvg = require("./DefaultSvg");
|
|
16
15
|
const _SpinnerContext = require("../../contexts/SpinnerContext");
|
|
17
16
|
const useSpinner_unstable = (props, ref)=>{
|
|
18
17
|
// Props
|
|
@@ -59,7 +58,6 @@ const useSpinner_unstable = (props, ref)=>{
|
|
|
59
58
|
const spinnerShortHand = _reactutilities.slot.optional(props.spinner, {
|
|
60
59
|
renderByDefault: true,
|
|
61
60
|
defaultProps: {
|
|
62
|
-
children: /*#__PURE__*/ _react.createElement(_DefaultSvg.DefaultSvg, null),
|
|
63
61
|
tabIndex
|
|
64
62
|
},
|
|
65
63
|
elementType: 'span'
|
|
@@ -76,10 +74,14 @@ const useSpinner_unstable = (props, ref)=>{
|
|
|
76
74
|
components: {
|
|
77
75
|
root: 'div',
|
|
78
76
|
spinner: 'span',
|
|
77
|
+
spinnerTail: 'span',
|
|
79
78
|
label: _reactlabel.Label
|
|
80
79
|
},
|
|
81
80
|
root: nativeRoot,
|
|
82
81
|
spinner: spinnerShortHand,
|
|
82
|
+
spinnerTail: _reactutilities.slot.always(props.spinnerTail, {
|
|
83
|
+
elementType: 'span'
|
|
84
|
+
}),
|
|
83
85
|
label: labelShorthand
|
|
84
86
|
};
|
|
85
87
|
return state;
|