@fluentui/react-spinner 9.6.2 → 9.7.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 CHANGED
@@ -1,12 +1,33 @@
1
1
  # Change Log - @fluentui/react-spinner
2
2
 
3
- This log was last generated on Thu, 26 Jun 2025 14:07:54 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 28 Jul 2025 18:44:12 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.7.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.7.1)
8
+
9
+ Mon, 28 Jul 2025 18:44:12 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.7.0..@fluentui/react-spinner_v9.7.1)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-jsx-runtime to v9.1.3 ([PR #34918](https://github.com/microsoft/fluentui/pull/34918) by beachball)
15
+ - Bump @fluentui/react-label to v9.3.1 ([PR #34918](https://github.com/microsoft/fluentui/pull/34918) by beachball)
16
+ - Bump @fluentui/react-utilities to v9.23.0 ([PR #34918](https://github.com/microsoft/fluentui/pull/34918) by beachball)
17
+
18
+ ## [9.7.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.7.0)
19
+
20
+ Thu, 17 Jul 2025 13:49:47 GMT
21
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.6.2..@fluentui/react-spinner_v9.7.0)
22
+
23
+ ### Minor changes
24
+
25
+ - feat: enable griffel raw styles ([PR #34853](https://github.com/microsoft/fluentui/pull/34853) by martinhochel@microsoft.com)
26
+ - Bump @fluentui/react-label to v9.3.0 ([PR #34862](https://github.com/microsoft/fluentui/pull/34862) by beachball)
27
+
7
28
  ## [9.6.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.6.2)
8
29
 
9
- Thu, 26 Jun 2025 14:07:54 GMT
30
+ Thu, 26 Jun 2025 14:11:55 GMT
10
31
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.6.1..@fluentui/react-spinner_v9.6.2)
11
32
 
12
33
  ### Patches
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Spinner.ts"],"sourcesContent":["export type { SpinnerProps, SpinnerSlots, SpinnerState } from './components/Spinner/index';\nexport {\n Spinner,\n renderSpinner_unstable,\n spinnerClassNames,\n useSpinnerStyles_unstable,\n useSpinner_unstable,\n} from './components/Spinner/index';\n"],"names":["Spinner","renderSpinner_unstable","spinnerClassNames","useSpinnerStyles_unstable","useSpinner_unstable"],"rangeMappings":"","mappings":"AACA,SACEA,OAAO,EACPC,sBAAsB,EACtBC,iBAAiB,EACjBC,yBAAyB,EACzBC,mBAAmB,QACd,6BAA6B"}
1
+ {"version":3,"sources":["../src/Spinner.ts"],"sourcesContent":["export type { SpinnerProps, SpinnerSlots, SpinnerState } from './components/Spinner/index';\nexport {\n Spinner,\n renderSpinner_unstable,\n spinnerClassNames,\n useSpinnerStyles_unstable,\n useSpinner_unstable,\n} from './components/Spinner/index';\n"],"names":["Spinner","renderSpinner_unstable","spinnerClassNames","useSpinnerStyles_unstable","useSpinner_unstable"],"mappings":"AACA,SACEA,OAAO,EACPC,sBAAsB,EACtBC,iBAAiB,EACjBC,yBAAyB,EACzBC,mBAAmB,QACd,6BAA6B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Spinner/Spinner.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useSpinner_unstable } from './useSpinner';\nimport { renderSpinner_unstable } from './renderSpinner';\nimport { useSpinnerStyles_unstable } from './useSpinnerStyles.styles';\nimport type { SpinnerProps } from './Spinner.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Converged Spinner component for the fluentui repo\n */\nexport const Spinner: ForwardRefComponent<SpinnerProps> = React.forwardRef((props, ref) => {\n const state = useSpinner_unstable(props, ref);\n\n useSpinnerStyles_unstable(state);\n\n useCustomStyleHook_unstable('useSpinnerStyles_unstable')(state);\n\n return renderSpinner_unstable(state);\n});\n\nSpinner.displayName = 'Spinner';\n"],"names":["React","useSpinner_unstable","renderSpinner_unstable","useSpinnerStyles_unstable","useCustomStyleHook_unstable","Spinner","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,yBAAyB,QAAQ,4BAA4B;AAGtE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,wBAA6CL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACjF,MAAMC,QAAQR,oBAAoBM,OAAOC;IAEzCL,0BAA0BM;IAE1BL,4BAA4B,6BAA6BK;IAEzD,OAAOP,uBAAuBO;AAChC,GAAG;AAEHJ,QAAQK,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/Spinner/Spinner.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useSpinner_unstable } from './useSpinner';\nimport { renderSpinner_unstable } from './renderSpinner';\nimport { useSpinnerStyles_unstable } from './useSpinnerStyles.styles';\nimport type { SpinnerProps } from './Spinner.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Converged Spinner component for the fluentui repo\n */\nexport const Spinner: ForwardRefComponent<SpinnerProps> = React.forwardRef((props, ref) => {\n const state = useSpinner_unstable(props, ref);\n\n useSpinnerStyles_unstable(state);\n\n useCustomStyleHook_unstable('useSpinnerStyles_unstable')(state);\n\n return renderSpinner_unstable(state);\n});\n\nSpinner.displayName = 'Spinner';\n"],"names":["React","useSpinner_unstable","renderSpinner_unstable","useSpinnerStyles_unstable","useCustomStyleHook_unstable","Spinner","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,yBAAyB,QAAQ,4BAA4B;AAGtE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,wBAA6CL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACjF,MAAMC,QAAQR,oBAAoBM,OAAOC;IAEzCL,0BAA0BM;IAE1BL,4BAA4B,6BAA6BK;IAEzD,OAAOP,uBAAuBO;AAChC,GAAG;AAEHJ,QAAQK,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Spinner/Spinner.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { Label } from '@fluentui/react-label';\n\nexport type SpinnerSlots = {\n /**\n * The root of the Spinner.\n * The root slot receives the `className` and `style` specified directly on the `<Spinner>`.\n */\n root: NonNullable<Slot<'div', 'span'>>;\n\n /**\n * The animated spinning ring.\n */\n spinner?: Slot<'span'>;\n\n /**\n * The part of the spinner that rotates.\n */\n spinnerTail?: NonNullable<Slot<'span'>>;\n\n /**\n * An optional label for the Spinner.\n */\n label?: Slot<typeof Label>;\n};\n\n/**\n * Spinner Props\n */\nexport type SpinnerProps = Omit<ComponentProps<SpinnerSlots>, 'size'> & {\n /**\n * The appearance of the Spinner.\n * @default 'primary'\n */\n appearance?: 'primary' | 'inverted';\n\n /**\n * Time in milliseconds after component mount before spinner is visible.\n * @default 0\n */\n delay?: number;\n\n /**\n * Where the label is positioned relative to the Spinner\n * @default 'after'\n */\n labelPosition?: 'above' | 'below' | 'before' | 'after';\n\n /**\n * The size of the spinner.\n * @default 'medium'\n */\n size?: 'extra-tiny' | 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large' | 'huge';\n};\n\n/**\n * State used in rendering Spinner\n */\nexport type SpinnerState = ComponentState<SpinnerSlots> &\n Required<Pick<SpinnerProps, 'appearance' | 'delay' | 'labelPosition' | 'size'>> & {\n /**\n * Should the spinner be rendered in the DOM\n */\n shouldRenderSpinner: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AAuDA;;CAEC,GACD,WAMI"}
1
+ {"version":3,"sources":["../src/components/Spinner/Spinner.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { Label } from '@fluentui/react-label';\n\nexport type SpinnerSlots = {\n /**\n * The root of the Spinner.\n * The root slot receives the `className` and `style` specified directly on the `<Spinner>`.\n */\n root: NonNullable<Slot<'div', 'span'>>;\n\n /**\n * The animated spinning ring.\n */\n spinner?: Slot<'span'>;\n\n /**\n * The part of the spinner that rotates.\n */\n spinnerTail?: NonNullable<Slot<'span'>>;\n\n /**\n * An optional label for the Spinner.\n */\n label?: Slot<typeof Label>;\n};\n\n/**\n * Spinner Props\n */\nexport type SpinnerProps = Omit<ComponentProps<SpinnerSlots>, 'size'> & {\n /**\n * The appearance of the Spinner.\n * @default 'primary'\n */\n appearance?: 'primary' | 'inverted';\n\n /**\n * Time in milliseconds after component mount before spinner is visible.\n * @default 0\n */\n delay?: number;\n\n /**\n * Where the label is positioned relative to the Spinner\n * @default 'after'\n */\n labelPosition?: 'above' | 'below' | 'before' | 'after';\n\n /**\n * The size of the spinner.\n * @default 'medium'\n */\n size?: 'extra-tiny' | 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large' | 'huge';\n};\n\n/**\n * State used in rendering Spinner\n */\nexport type SpinnerState = ComponentState<SpinnerSlots> &\n Required<Pick<SpinnerProps, 'appearance' | 'delay' | 'labelPosition' | 'size'>> & {\n /**\n * Should the spinner be rendered in the DOM\n */\n shouldRenderSpinner: boolean;\n };\n"],"names":[],"mappings":"AAuDA;;CAEC,GACD,WAMI"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Spinner/index.ts"],"sourcesContent":["export { Spinner } from './Spinner';\nexport type { SpinnerProps, SpinnerSlots, SpinnerState } from './Spinner.types';\nexport { renderSpinner_unstable } from './renderSpinner';\nexport { useSpinner_unstable } from './useSpinner';\nexport { spinnerClassNames, useSpinnerStyles_unstable } from './useSpinnerStyles.styles';\n"],"names":["Spinner","renderSpinner_unstable","useSpinner_unstable","spinnerClassNames","useSpinnerStyles_unstable"],"rangeMappings":";;;","mappings":"AAAA,SAASA,OAAO,QAAQ,YAAY;AAEpC,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,iBAAiB,EAAEC,yBAAyB,QAAQ,4BAA4B"}
1
+ {"version":3,"sources":["../src/components/Spinner/index.ts"],"sourcesContent":["export { Spinner } from './Spinner';\nexport type { SpinnerProps, SpinnerSlots, SpinnerState } from './Spinner.types';\nexport { renderSpinner_unstable } from './renderSpinner';\nexport { useSpinner_unstable } from './useSpinner';\nexport { spinnerClassNames, useSpinnerStyles_unstable } from './useSpinnerStyles.styles';\n"],"names":["Spinner","renderSpinner_unstable","useSpinner_unstable","spinnerClassNames","useSpinnerStyles_unstable"],"mappings":"AAAA,SAASA,OAAO,QAAQ,YAAY;AAEpC,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,iBAAiB,EAAEC,yBAAyB,QAAQ,4BAA4B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Spinner/renderSpinner.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { 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"],"rangeMappings":";;;;;;;;;;;;;;;;","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
+ {"version":3,"sources":["../src/components/Spinner/renderSpinner.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { 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 +1 @@
1
- {"version":3,"sources":["../src/components/Spinner/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', ...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 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","rest","nativeRoot","always","elementType","isShownAfterDelay","setIsShownAfterDelay","useState","setDelayTimeout","clearDelayTimeout","useEffect","labelShorthand","optional","label","defaultProps","id","renderByDefault","spinnerShortHand","spinner","state","shouldRenderSpinner","components","root","spinnerTail"],"rangeMappings":";;;;;;;;;;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B,QAAQ,CAACpB,MAAM0B,OAAO,EAAE;QACpDF,iBAAiB;QACjBZ,aAAa;IACf;IACA,IAAIO,kBAAkBT,cAAc,CAACA,UAAU,CAAC,kBAAkB,EAAE;QAClEA,UAAU,CAAC,kBAAkB,GAAGS,eAAeI,EAAE;IACnD;IACA,MAAMI,QAAsB;QAC1BvB;QACAE;QACAD;QACAH;QACA0B,qBAAqB,CAACtB,SAASO;QAC/BgB,YAAY;YAAEC,MAAM;YAAOJ,SAAS;YAAQK,aAAa;YAAQV,OAAOxB;QAAM;QAC9EiC,MAAMpB;QACNgB,SAASD;QACTM,aAAanC,KAAKe,MAAM,CAACX,MAAM+B,WAAW,EAAE;YAAEnB,aAAa;QAAO;QAClES,OAAOF;IACT;IACA,OAAOQ;AACT,EAAE"}
1
+ {"version":3,"sources":["../src/components/Spinner/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', ...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 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","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,GAA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,KAAKe,MAAM,CAACX,MAAM+B,WAAW,EAAE;YAAEnB,aAAa;QAAO;QAClES,OAAOF;IACT;IACA,OAAOQ;AACT,EAAE"}
@@ -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"],"mappings":"AAAA,SAASA,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AAEjE,SAASC,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG3E,OAAO,MAAMC,oBAAkD;IAC7DC,MAAM;IACNC,SAAS;IACTC,aAAa;IACbC,OAAO;AACT,EAAE;AAEF;;CAEC,GACD,MAAMC,OAAO;IACXC,aAAa;AACf;AAEA,MAAMC,uBAAuBV,gBAAgB;IAC3CW,SAAS;IACTC,YAAY;IACZC,gBAAgB;IAChBC,YAAY;IACZC,KAAK;IACLC,UAAU;AACZ;AAEA,MAAMC,gBAAgBhB,WAAW;IAC/BiB,UAAU;QACRC,eAAe;IACjB;AACF;AAEA,MAAMC,0BAA0BpB,gBAAgB;IAC9CqB,UAAU;IACVC,YAAY;IAEZ,sDAAsD;IACtD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S;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"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contexts/SpinnerContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { SpinnerProps } from '../components/Spinner/Spinner.types';\n\nconst SpinnerContext = React.createContext<SpinnerContextValue | undefined>(undefined);\n\n/**\n * @internal\n */\nexport type SpinnerContextValue = Pick<SpinnerProps, 'size'>;\n\nconst SpinnerContextDefaultValue: SpinnerContextValue = {};\n\n/**\n * @internal\n */\nexport const SpinnerContextProvider = SpinnerContext.Provider;\n\n/**\n * @internal\n */\nexport const useSpinnerContext = () => React.useContext(SpinnerContext) ?? SpinnerContextDefaultValue;\n"],"names":["React","SpinnerContext","createContext","undefined","SpinnerContextDefaultValue","SpinnerContextProvider","Provider","useSpinnerContext","useContext"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,MAAMC,iBAAiBD,MAAME,aAAa,CAAkCC;AAO5E,MAAMC,6BAAkD,CAAC;AAEzD;;CAEC,GACD,OAAO,MAAMC,yBAAyBJ,eAAeK,QAAQ,CAAC;AAE9D;;CAEC,GACD,OAAO,MAAMC,oBAAoB;QAAMP;WAAAA,CAAAA,oBAAAA,MAAMQ,UAAU,CAACP,6BAAjBD,+BAAAA,oBAAoCI;AAAyB,EAAE"}
1
+ {"version":3,"sources":["../src/contexts/SpinnerContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { SpinnerProps } from '../components/Spinner/Spinner.types';\n\nconst SpinnerContext = React.createContext<SpinnerContextValue | undefined>(undefined);\n\n/**\n * @internal\n */\nexport type SpinnerContextValue = Pick<SpinnerProps, 'size'>;\n\nconst SpinnerContextDefaultValue: SpinnerContextValue = {};\n\n/**\n * @internal\n */\nexport const SpinnerContextProvider = SpinnerContext.Provider;\n\n/**\n * @internal\n */\nexport const useSpinnerContext = () => React.useContext(SpinnerContext) ?? SpinnerContextDefaultValue;\n"],"names":["React","SpinnerContext","createContext","undefined","SpinnerContextDefaultValue","SpinnerContextProvider","Provider","useSpinnerContext","useContext"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,MAAMC,iBAAiBD,MAAME,aAAa,CAAkCC;AAO5E,MAAMC,6BAAkD,CAAC;AAEzD;;CAEC,GACD,OAAO,MAAMC,yBAAyBJ,eAAeK,QAAQ,CAAC;AAE9D;;CAEC,GACD,OAAO,MAAMC,oBAAoB;QAAMP;WAAAA,CAAAA,oBAAAA,MAAMQ,UAAU,CAACP,6BAAjBD,+BAAAA,oBAAoCI;EAA2B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contexts/index.ts"],"sourcesContent":["export type { SpinnerContextValue } from './SpinnerContext';\nexport { SpinnerContextProvider, useSpinnerContext } from './SpinnerContext';\n"],"names":["SpinnerContextProvider","useSpinnerContext"],"rangeMappings":"","mappings":"AACA,SAASA,sBAAsB,EAAEC,iBAAiB,QAAQ,mBAAmB"}
1
+ {"version":3,"sources":["../src/contexts/index.ts"],"sourcesContent":["export type { SpinnerContextValue } from './SpinnerContext';\nexport { SpinnerContextProvider, useSpinnerContext } from './SpinnerContext';\n"],"names":["SpinnerContextProvider","useSpinnerContext"],"mappings":"AACA,SAASA,sBAAsB,EAAEC,iBAAiB,QAAQ,mBAAmB"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Spinner,\n spinnerClassNames,\n renderSpinner_unstable,\n useSpinner_unstable,\n useSpinnerStyles_unstable,\n} from './Spinner';\nexport type { SpinnerProps, SpinnerSlots, SpinnerState } from './Spinner';\nexport { SpinnerContextProvider, useSpinnerContext } from './contexts/index';\nexport type { SpinnerContextValue } from './contexts/index';\n"],"names":["Spinner","spinnerClassNames","renderSpinner_unstable","useSpinner_unstable","useSpinnerStyles_unstable","SpinnerContextProvider","useSpinnerContext"],"rangeMappings":";","mappings":"AAAA,SACEA,OAAO,EACPC,iBAAiB,EACjBC,sBAAsB,EACtBC,mBAAmB,EACnBC,yBAAyB,QACpB,YAAY;AAEnB,SAASC,sBAAsB,EAAEC,iBAAiB,QAAQ,mBAAmB"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Spinner,\n spinnerClassNames,\n renderSpinner_unstable,\n useSpinner_unstable,\n useSpinnerStyles_unstable,\n} from './Spinner';\nexport type { SpinnerProps, SpinnerSlots, SpinnerState } from './Spinner';\nexport { SpinnerContextProvider, useSpinnerContext } from './contexts/index';\nexport type { SpinnerContextValue } from './contexts/index';\n"],"names":["Spinner","spinnerClassNames","renderSpinner_unstable","useSpinner_unstable","useSpinnerStyles_unstable","SpinnerContextProvider","useSpinnerContext"],"mappings":"AAAA,SACEA,OAAO,EACPC,iBAAiB,EACjBC,sBAAsB,EACtBC,mBAAmB,EACnBC,yBAAyB,QACpB,YAAY;AAEnB,SAASC,sBAAsB,EAAEC,iBAAiB,QAAQ,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Spinner.ts"],"sourcesContent":["export type { SpinnerProps, SpinnerSlots, SpinnerState } from './components/Spinner/index';\nexport {\n Spinner,\n renderSpinner_unstable,\n spinnerClassNames,\n useSpinnerStyles_unstable,\n useSpinner_unstable,\n} from './components/Spinner/index';\n"],"names":["Spinner","renderSpinner_unstable","spinnerClassNames","useSpinnerStyles_unstable","useSpinner_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEEA,OAAO;eAAPA,cAAO;;IACPC,sBAAsB;eAAtBA,6BAAsB;;IACtBC,iBAAiB;eAAjBA,wBAAiB;;IACjBC,yBAAyB;eAAzBA,gCAAyB;;IACzBC,mBAAmB;eAAnBA,0BAAmB;;;uBACd"}
1
+ {"version":3,"sources":["../src/Spinner.ts"],"sourcesContent":["export type { SpinnerProps, SpinnerSlots, SpinnerState } from './components/Spinner/index';\nexport {\n Spinner,\n renderSpinner_unstable,\n spinnerClassNames,\n useSpinnerStyles_unstable,\n useSpinner_unstable,\n} from './components/Spinner/index';\n"],"names":["Spinner","renderSpinner_unstable","spinnerClassNames","useSpinnerStyles_unstable","useSpinner_unstable"],"mappings":";;;;;;;;;;;;eAEEA,cAAO;;;eACPC,6BAAsB;;;eACtBC,wBAAiB;;;eACjBC,gCAAyB;;;eACzBC,0BAAmB;;;uBACd,6BAA6B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Spinner/Spinner.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useSpinner_unstable } from './useSpinner';\nimport { renderSpinner_unstable } from './renderSpinner';\nimport { useSpinnerStyles_unstable } from './useSpinnerStyles.styles';\nimport type { SpinnerProps } from './Spinner.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Converged Spinner component for the fluentui repo\n */\nexport const Spinner: ForwardRefComponent<SpinnerProps> = React.forwardRef((props, ref) => {\n const state = useSpinner_unstable(props, ref);\n\n useSpinnerStyles_unstable(state);\n\n useCustomStyleHook_unstable('useSpinnerStyles_unstable')(state);\n\n return renderSpinner_unstable(state);\n});\n\nSpinner.displayName = 'Spinner';\n"],"names":["Spinner","React","forwardRef","props","ref","state","useSpinner_unstable","useSpinnerStyles_unstable","useCustomStyleHook_unstable","renderSpinner_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;4BACa;+BACG;wCACG;qCAGE;AAKrC,MAAMA,UAAAA,WAAAA,GAA6CC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACjF,MAAMC,QAAQC,IAAAA,+BAAAA,EAAoBH,OAAOC;IAEzCG,IAAAA,iDAAAA,EAA0BF;IAE1BG,IAAAA,gDAAAA,EAA4B,6BAA6BH;IAEzD,OAAOI,IAAAA,qCAAAA,EAAuBJ;AAChC;AAEAL,QAAQU,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/Spinner/Spinner.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useSpinner_unstable } from './useSpinner';\nimport { renderSpinner_unstable } from './renderSpinner';\nimport { useSpinnerStyles_unstable } from './useSpinnerStyles.styles';\nimport type { SpinnerProps } from './Spinner.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Converged Spinner component for the fluentui repo\n */\nexport const Spinner: ForwardRefComponent<SpinnerProps> = React.forwardRef((props, ref) => {\n const state = useSpinner_unstable(props, ref);\n\n useSpinnerStyles_unstable(state);\n\n useCustomStyleHook_unstable('useSpinnerStyles_unstable')(state);\n\n return renderSpinner_unstable(state);\n});\n\nSpinner.displayName = 'Spinner';\n"],"names":["React","useSpinner_unstable","renderSpinner_unstable","useSpinnerStyles_unstable","useCustomStyleHook_unstable","Spinner","forwardRef","props","ref","state","displayName"],"mappings":";;;;+BAWaK;;;;;;;iEAXU,QAAQ;4BACK,eAAe;+BACZ,kBAAkB;wCACf,4BAA4B;qCAG1B,kCAAkC;AAKvE,gBAAMA,WAAAA,GAA6CL,OAAMM,UAAU,CAAC,CAACC,OAAOC;IACjF,MAAMC,QAAQR,mCAAAA,EAAoBM,OAAOC;QAEzCL,iDAAAA,EAA0BM;QAE1BL,gDAAAA,EAA4B,6BAA6BK;IAEzD,WAAOP,qCAAAA,EAAuBO;AAChC,GAAG;AAEHJ,QAAQK,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Spinner/Spinner.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { Label } from '@fluentui/react-label';\n\nexport type SpinnerSlots = {\n /**\n * The root of the Spinner.\n * The root slot receives the `className` and `style` specified directly on the `<Spinner>`.\n */\n root: NonNullable<Slot<'div', 'span'>>;\n\n /**\n * The animated spinning ring.\n */\n spinner?: Slot<'span'>;\n\n /**\n * The part of the spinner that rotates.\n */\n spinnerTail?: NonNullable<Slot<'span'>>;\n\n /**\n * An optional label for the Spinner.\n */\n label?: Slot<typeof Label>;\n};\n\n/**\n * Spinner Props\n */\nexport type SpinnerProps = Omit<ComponentProps<SpinnerSlots>, 'size'> & {\n /**\n * The appearance of the Spinner.\n * @default 'primary'\n */\n appearance?: 'primary' | 'inverted';\n\n /**\n * Time in milliseconds after component mount before spinner is visible.\n * @default 0\n */\n delay?: number;\n\n /**\n * Where the label is positioned relative to the Spinner\n * @default 'after'\n */\n labelPosition?: 'above' | 'below' | 'before' | 'after';\n\n /**\n * The size of the spinner.\n * @default 'medium'\n */\n size?: 'extra-tiny' | 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large' | 'huge';\n};\n\n/**\n * State used in rendering Spinner\n */\nexport type SpinnerState = ComponentState<SpinnerSlots> &\n Required<Pick<SpinnerProps, 'appearance' | 'delay' | 'labelPosition' | 'size'>> & {\n /**\n * Should the spinner be rendered in the DOM\n */\n shouldRenderSpinner: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AAuDA;;CAEC"}
1
+ {"version":3,"sources":["../src/components/Spinner/Spinner.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { Label } from '@fluentui/react-label';\n\nexport type SpinnerSlots = {\n /**\n * The root of the Spinner.\n * The root slot receives the `className` and `style` specified directly on the `<Spinner>`.\n */\n root: NonNullable<Slot<'div', 'span'>>;\n\n /**\n * The animated spinning ring.\n */\n spinner?: Slot<'span'>;\n\n /**\n * The part of the spinner that rotates.\n */\n spinnerTail?: NonNullable<Slot<'span'>>;\n\n /**\n * An optional label for the Spinner.\n */\n label?: Slot<typeof Label>;\n};\n\n/**\n * Spinner Props\n */\nexport type SpinnerProps = Omit<ComponentProps<SpinnerSlots>, 'size'> & {\n /**\n * The appearance of the Spinner.\n * @default 'primary'\n */\n appearance?: 'primary' | 'inverted';\n\n /**\n * Time in milliseconds after component mount before spinner is visible.\n * @default 0\n */\n delay?: number;\n\n /**\n * Where the label is positioned relative to the Spinner\n * @default 'after'\n */\n labelPosition?: 'above' | 'below' | 'before' | 'after';\n\n /**\n * The size of the spinner.\n * @default 'medium'\n */\n size?: 'extra-tiny' | 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large' | 'huge';\n};\n\n/**\n * State used in rendering Spinner\n */\nexport type SpinnerState = ComponentState<SpinnerSlots> &\n Required<Pick<SpinnerProps, 'appearance' | 'delay' | 'labelPosition' | 'size'>> & {\n /**\n * Should the spinner be rendered in the DOM\n */\n shouldRenderSpinner: boolean;\n };\n"],"names":[],"mappings":"AAuDA;;CAEC,GACD,WAMI"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Spinner/index.ts"],"sourcesContent":["export { Spinner } from './Spinner';\nexport type { SpinnerProps, SpinnerSlots, SpinnerState } from './Spinner.types';\nexport { renderSpinner_unstable } from './renderSpinner';\nexport { useSpinner_unstable } from './useSpinner';\nexport { spinnerClassNames, useSpinnerStyles_unstable } from './useSpinnerStyles.styles';\n"],"names":["Spinner","renderSpinner_unstable","spinnerClassNames","useSpinnerStyles_unstable","useSpinner_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,OAAO;eAAPA,gBAAO;;IAEPC,sBAAsB;eAAtBA,qCAAsB;;IAEtBC,iBAAiB;eAAjBA,yCAAiB;;IAAEC,yBAAyB;eAAzBA,iDAAyB;;IAD5CC,mBAAmB;eAAnBA,+BAAmB;;;yBAHJ;+BAEe;4BACH;wCACyB"}
1
+ {"version":3,"sources":["../src/components/Spinner/index.ts"],"sourcesContent":["export { Spinner } from './Spinner';\nexport type { SpinnerProps, SpinnerSlots, SpinnerState } from './Spinner.types';\nexport { renderSpinner_unstable } from './renderSpinner';\nexport { useSpinner_unstable } from './useSpinner';\nexport { spinnerClassNames, useSpinnerStyles_unstable } from './useSpinnerStyles.styles';\n"],"names":["Spinner","renderSpinner_unstable","useSpinner_unstable","spinnerClassNames","useSpinnerStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,gBAAO;;;eAEPC,qCAAsB;;;eAEtBE,yCAAiB;;;eAAEC,iDAAyB;;;eAD5CF,+BAAmB;;;yBAHJ,YAAY;+BAEG,kBAAkB;4BACrB,eAAe;wCACU,4BAA4B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Spinner/renderSpinner.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { 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":["renderSpinner_unstable","state","assertSlots","labelPosition","shouldRenderSpinner","_jsxs","root","label","_jsx","spinner","spinnerTail"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,yBAAyB,CAACC;IACrCC,IAAAA,2BAAAA,EAA0BD;IAC1B,MAAM,EAAEE,aAAa,EAAEC,mBAAmB,EAAE,GAAGH;IAC/C,OAAA,WAAA,GACEI,IAAAA,gBAAA,EAACJ,MAAMK,IAAI,EAAA;;YACRL,MAAMM,KAAK,IAAIH,uBAAwBD,CAAAA,kBAAkB,WAAWA,kBAAkB,QAAA,KAAO,WAAA,GAC5FK,IAAAA,eAAA,EAACP,MAAMM,KAAK,EAAA,CAAA;YAEbN,MAAMQ,OAAO,IAAIL,uBAAAA,WAAAA,GAChBI,IAAAA,eAAA,EAACP,MAAMQ,OAAO,EAAA;0BAAER,MAAMS,WAAW,IAAA,WAAA,GAAIF,IAAAA,eAAA,EAACP,MAAMS,WAAW,EAAA,CAAA;;YAExDT,MAAMM,KAAK,IAAIH,uBAAwBD,CAAAA,kBAAkB,WAAWA,kBAAkB,OAAA,KAAM,WAAA,GAC3FK,IAAAA,eAAA,EAACP,MAAMM,KAAK,EAAA,CAAA;;;AAIpB"}
1
+ {"version":3,"sources":["../src/components/Spinner/renderSpinner.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { 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":";;;;+BASaC;;;;;;4BARb,iCAAiD;gCAErB,4BAA4B;AAMjD,+BAA+B,CAACC;QACrCF,2BAAAA,EAA0BE;IAC1B,MAAM,EAAEC,aAAa,EAAEC,mBAAmB,EAAE,GAAGF;IAC/C,OAAA,WAAA,OACE,gBAAA,EAACA,MAAMG,IAAI,EAAA;;YACRH,MAAMI,KAAK,IAAIF,uBAAwBD,CAAAA,kBAAkB,WAAWA,kBAAkB,QAAA,CAAO,IAAA,WAAA,OAC5F,eAAA,EAACD,MAAMI,KAAK,EAAA,CAAA;YAEbJ,MAAMK,OAAO,IAAIH,uBAAAA,WAAAA,OAChB,eAAA,EAACF,MAAMK,OAAO,EAAA;0BAAEL,MAAMM,WAAW,IAAA,WAAA,OAAI,eAAA,EAACN,MAAMM,WAAW,EAAA,CAAA;;YAExDN,MAAMI,KAAK,IAAIF,uBAAwBD,CAAAA,kBAAkB,WAAWA,kBAAkB,OAAA,CAAM,IAAA,WAAA,OAC3F,eAAA,EAACD,MAAMI,KAAK,EAAA,CAAA;;;AAIpB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Spinner/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', ...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 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":["useSpinner_unstable","props","ref","size","contextSize","useSpinnerContext","appearance","labelPosition","delay","baseId","useId","role","rest","nativeRoot","slot","always","getIntrinsicElementProps","elementType","isShownAfterDelay","setIsShownAfterDelay","React","useState","setDelayTimeout","clearDelayTimeout","useTimeout","useEffect","labelShorthand","optional","label","defaultProps","id","renderByDefault","Label","spinnerShortHand","spinner","state","shouldRenderSpinner","components","root","spinnerTail"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAeaA;;;eAAAA;;;;iEAfU;gCAC2C;4BAE5C;gCACY;AAW3B,MAAMA,sBAAsB,CAACC,OAAqBC;IACvD,QAAQ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ACAJ;QACAiC,qBAAqB,CAAC5B,SAASU;QAC/BmB,YAAY;YAAEC,MAAM;YAAOJ,SAAS;YAAQK,aAAa;YAAQX,OAAOI,iBAAAA;QAAM;QAC9EM,MAAMzB;QACNqB,SAASD;QACTM,aAAazB,oBAAAA,CAAKC,MAAM,CAACd,MAAMsC,WAAW,EAAE;YAAEtB,aAAa;QAAO;QAClEW,OAAOF;IACT;IACA,OAAOS;AACT"}
1
+ {"version":3,"sources":["../src/components/Spinner/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', ...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 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","rest","nativeRoot","always","elementType","isShownAfterDelay","setIsShownAfterDelay","useState","setDelayTimeout","clearDelayTimeout","useEffect","labelShorthand","optional","label","defaultProps","id","renderByDefault","spinnerShortHand","spinner","state","shouldRenderSpinner","components","root","spinnerTail"],"mappings":";;;;+BAeaO;;;;;;;iEAfU,QAAQ;gCACmC,4BAA4B;4BAExE,wBAAwB;gCACZ,gCAAgC;AAW3D,4BAA4B,CAACC,OAAqBC;IACvD,QAAQ;IACR,MAAM,EAAEC,MAAMC,WAAW,EAAE,OAAGL,iCAAAA;IAC9B,MAAM,EAAEM,aAAa,SAAS,EAAEC,gBAAgB,OAAO,EAAEH,OAAOC,gBAAAA,QAAAA,gBAAAA,KAAAA,IAAAA,cAAe,QAAQ,EAAEG,QAAQ,CAAC,EAAE,GAAGN;IACvG,MAAMO,aAASb,qBAAAA,EAAM;IAErB,MAAM,EAAEc,OAAO,aAAa,EAAE,GAAGC,MAAM,GAAGT;IAC1C,MAAMU,aAAad,oBAAAA,CAAKe,MAAM,KAC5BlB,wCAAAA,EACE,OACA;QACE,SAAS;QACT,4EAA4E;QAC5E,4FAA4F;QAC5FQ,KAAKA;QACLO;QACA,GAAGC,IAAI;IACT,GACA;QAAC;KAAO,GAEV;QACEG,aAAa;IACf;IAEF,MAAM,CAACC,mBAAmBC,qBAAqB,GAAGtB,OAAMuB,QAAQ,CAAC;IACjE,MAAM,CAACC,iBAAiBC,kBAAkB,OAAGtB,0BAAAA;IAC7CH,OAAM0B,SAAS,CAAC;QACd,IAAIZ,SAAS,GAAG;YACd;QACF;QACAU,gBAAgB;YACdF,qBAAqB;QACvB,GAAGR;QACH,OAAO;YACLW;QACF;IACF,GAAG;QAACD;QAAiBC;QAAmBX;KAAM;IAC9C,MAAMa,iBAAiBvB,oBAAAA,CAAKwB,QAAQ,CAACpB,MAAMqB,KAAK,EAAE;QAChDC,cAAc;YAAEC,IAAIhB;QAAO;QAC3BiB,iBAAiB;QACjBZ,aAAaf,iBAAAA;IACf;IACA,MAAM4B,mBAAmB7B,oBAAAA,CAAKwB,QAAQ,CAACpB,MAAM0B,OAAO,EAAE;QACpDF,iBAAiB;QACjBZ,aAAa;IACf;IACA,IAAIO,kBAAkBT,cAAc,CAACA,UAAU,CAAC,kBAAkB,EAAE;QAClEA,UAAU,CAAC,kBAAkB,GAAGS,eAAeI,EAAE;IACnD;IACA,MAAMI,QAAsB;QAC1BvB;QACAE;QACAD;QACAH;QACA0B,qBAAqB,CAACtB,SAASO;QAC/BgB,YAAY;YAAEC,MAAM;YAAOJ,SAAS;YAAQK,aAAa;YAAQV,OAAOxB,iBAAAA;QAAM;QAC9EiC,MAAMpB;QACNgB,SAASD;QACTM,aAAanC,oBAAAA,CAAKe,MAAM,CAACX,MAAM+B,WAAW,EAAE;YAAEnB,aAAa;QAAO;QAClES,OAAOF;IACT;IACA,OAAOQ;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"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 overflow: 'hidden'\n});\nconst useRootStyles = makeStyles({\n vertical: {\n flexDirection: 'column'\n }\n});\nconst useSpinnerBaseClassName = makeResetStyles({\n position: 'relative',\n flexShrink: 0,\n // Use a mask to create the ring shape of the spinner.\n maskImage: `radial-gradient(closest-side, ` + `transparent calc(100% - var(${vars.strokeWidth}) - 1px), ` + `white calc(100% - var(${vars.strokeWidth})) calc(100% - 1px), ` + `transparent 100%)`,\n backgroundColor: tokens.colorBrandStroke2Contrast,\n color: tokens.colorBrandStroke1,\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'HighlightText',\n color: 'Highlight',\n forcedColorAdjust: 'none'\n },\n animationDuration: '1.5s',\n animationIterationCount: 'infinite',\n animationTimingFunction: 'linear',\n animationName: {\n '0%': {\n transform: 'rotate(0deg)'\n },\n '100%': {\n transform: 'rotate(360deg)'\n }\n },\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationDuration: '1.8s'\n }\n});\n// The spinner tail is rendered using two 135deg arc segments, behind a 105deg arc mask.\n// The segments are rotated out from behind the mask to expand the visible arc from\n// 30deg (min) to 255deg (max), and then back behind the mask again to shrink the arc.\n// The tail and spinner itself also have 360deg rotation animations for the spin.\nconst useSpinnerTailBaseClassName = makeResetStyles({\n position: 'absolute',\n display: 'block',\n width: '100%',\n height: '100%',\n maskImage: 'conic-gradient(transparent 105deg, white 105deg)',\n '&::before, &::after': {\n content: '\"\"',\n position: 'absolute',\n display: 'block',\n width: '100%',\n height: '100%',\n animation: 'inherit',\n backgroundImage: 'conic-gradient(currentcolor 135deg, transparent 135deg)'\n },\n animationDuration: '1.5s',\n animationIterationCount: 'infinite',\n animationTimingFunction: tokens.curveEasyEase,\n animationName: {\n '0%': {\n transform: 'rotate(-135deg)'\n },\n '50%': {\n transform: 'rotate(0deg)'\n },\n '100%': {\n transform: 'rotate(225deg)'\n }\n },\n '&::before': {\n animationName: {\n '0%': {\n transform: 'rotate(0deg)'\n },\n '50%': {\n transform: 'rotate(105deg)'\n },\n '100%': {\n transform: 'rotate(0deg)'\n }\n }\n },\n '&::after': {\n animationName: {\n '0%': {\n transform: 'rotate(0deg)'\n },\n '50%': {\n transform: 'rotate(225deg)'\n },\n '100%': {\n transform: 'rotate(0deg)'\n }\n }\n },\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationIterationCount: '0',\n backgroundImage: 'conic-gradient(transparent 120deg, currentcolor 360deg)',\n '&::before, &::after': {\n content: 'none'\n }\n }\n});\nconst useSpinnerStyles = makeStyles({\n inverted: {\n backgroundColor: tokens.colorNeutralStrokeAlpha2,\n color: tokens.colorNeutralStrokeOnBrand2\n },\n rtlTail: {\n maskImage: 'conic-gradient(white 255deg, transparent 255deg)',\n '&::before, &::after': {\n backgroundImage: 'conic-gradient(transparent 225deg, currentcolor 225deg)'\n },\n '@media screen and (prefers-reduced-motion: reduce)': {\n backgroundImage: 'conic-gradient(currentcolor 0deg, transparent 240deg)'\n }\n },\n 'extra-tiny': {\n height: '16px',\n width: '16px',\n [vars.strokeWidth]: tokens.strokeWidthThick\n },\n tiny: {\n height: '20px',\n width: '20px',\n [vars.strokeWidth]: tokens.strokeWidthThick\n },\n 'extra-small': {\n height: '24px',\n width: '24px',\n [vars.strokeWidth]: tokens.strokeWidthThick\n },\n small: {\n height: '28px',\n width: '28px',\n [vars.strokeWidth]: tokens.strokeWidthThick\n },\n medium: {\n height: '32px',\n width: '32px',\n [vars.strokeWidth]: tokens.strokeWidthThicker\n },\n large: {\n height: '36px',\n width: '36px',\n [vars.strokeWidth]: tokens.strokeWidthThicker\n },\n 'extra-large': {\n height: '40px',\n width: '40px',\n [vars.strokeWidth]: tokens.strokeWidthThicker\n },\n huge: {\n height: '44px',\n width: '44px',\n [vars.strokeWidth]: tokens.strokeWidthThickest\n }\n});\nconst useLabelStyles = makeStyles({\n inverted: {\n color: tokens.colorNeutralForegroundStaticInverted\n },\n 'extra-tiny': {\n ...typographyStyles.body1\n },\n tiny: {\n ...typographyStyles.body1\n },\n 'extra-small': {\n ...typographyStyles.body1\n },\n small: {\n ...typographyStyles.body1\n },\n medium: {\n ...typographyStyles.subtitle2\n },\n large: {\n ...typographyStyles.subtitle2\n },\n 'extra-large': {\n ...typographyStyles.subtitle2\n },\n huge: {\n ...typographyStyles.subtitle1\n }\n});\n/**\n * Apply styling to the Spinner slots based on the state\n */ export const useSpinnerStyles_unstable = (state)=>{\n 'use no memo';\n const { labelPosition, size, appearance } = state;\n const { dir } = useFluent();\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n const spinnerBaseClassName = useSpinnerBaseClassName();\n const spinnerStyles = useSpinnerStyles();\n const spinnerTailBaseClassName = useSpinnerTailBaseClassName();\n const labelStyles = useLabelStyles();\n state.root.className = mergeClasses(spinnerClassNames.root, rootBaseClassName, (labelPosition === 'above' || labelPosition === 'below') && rootStyles.vertical, state.root.className);\n if (state.spinner) {\n state.spinner.className = mergeClasses(spinnerClassNames.spinner, spinnerBaseClassName, spinnerStyles[size], appearance === 'inverted' && spinnerStyles.inverted, state.spinner.className);\n }\n if (state.spinnerTail) {\n state.spinnerTail.className = mergeClasses(spinnerClassNames.spinnerTail, spinnerTailBaseClassName, dir === 'rtl' && spinnerStyles.rtlTail, state.spinnerTail.className);\n }\n if (state.label) {\n state.label.className = mergeClasses(spinnerClassNames.label, labelStyles[size], appearance === 'inverted' && labelStyles.inverted, state.label.className);\n }\n return state;\n};\n"],"names":["spinnerClassNames","useSpinnerStyles_unstable","root","spinner","spinnerTail","label","vars","strokeWidth","useRootBaseClassName","__resetStyles","useRootStyles","__styles","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","state","labelPosition","size","appearance","dir","useFluent","rootBaseClassName","rootStyles","spinnerBaseClassName","spinnerStyles","spinnerTailBaseClassName","labelStyles","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAGaA,iBAAiB;eAAjBA;;IA4MIC,yBAAyB;eAAzBA;;;qCA/M+B;uBAEU;AACnD,MAAMD,oBAAoB;IAC7BE,MAAM;IACNC,SAAS;IACTC,aAAa;IACbC,OAAO;AACX;AACA;;CAEA,GAAI,MAAMC,OAAO;IACbC,aAAa;AACjB;AACA,MAAMC,uBAAoB,WAAA,GAAGC,IAAAA,oBAAA,EAAA,WAAA,MAAA;IAAA;CAO5B;AACD,MAAMC,gBAAa,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAC,UAAA;QAAAC,SAAA;IAAA;AAAA,GAAA;IAAAC,GAAA;QAAA;KAAA;AAAA;AAKtB,MAAMC,0BAAuB,WAAA,GAAGN,IAAAA,oBAAA,EAAA,WAAA,YAAA;IAAAO,GAAA;QAAA;QAAA;QAAA;QAAA;KAAA;IAAAC,GAAA;QAAA;QAAA;QA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tC,OAAO,CAACkD,SAAS,GAAGC,IAAAA,mBAAY,EAACtD,kBAAkBG,OAAO,EAAE8C,sBAAsBC,aAAa,CAACP,KAAK,EAAEC,eAAe,cAAcM,cAAc9B,QAAQ,EAAEqB,MAAMtC,OAAO,CAACkD,SAAS;IAC7L;IACA,IAAIZ,MAAMrC,WAAW,EAAE;QACnBqC,MAAMrC,WAAW,CAACiD,SAAS,GAAGC,IAAAA,mBAAY,EAACtD,kBAAkBI,WAAW,EAAE+C,0BAA0BN,QAAQ,SAASK,cAAc3B,OAAO,EAAEkB,MAAMrC,WAAW,CAACiD,SAAS;IAC3K;IACA,IAAIZ,MAAMpC,KAAK,EAAE;QACboC,MAAMpC,KAAK,CAACgD,SAAS,GAAGC,IAAAA,mBAAY,EAACtD,kBAAkBK,KAAK,EAAE+C,WAAW,CAACT,KAAK,EAAEC,eAAe,cAAcQ,YAAYhC,QAAQ,EAAEqB,MAAMpC,KAAK,CAACgD,SAAS;IAC7J;IACA,OAAOZ;AACX"}
1
+ {"version":3,"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 overflow: 'hidden'\n});\nconst useRootStyles = makeStyles({\n vertical: {\n flexDirection: 'column'\n }\n});\nconst useSpinnerBaseClassName = makeResetStyles({\n position: 'relative',\n flexShrink: 0,\n // Use a mask to create the ring shape of the spinner.\n maskImage: `radial-gradient(closest-side, ` + `transparent calc(100% - var(${vars.strokeWidth}) - 1px), ` + `white calc(100% - var(${vars.strokeWidth})) calc(100% - 1px), ` + `transparent 100%)`,\n backgroundColor: tokens.colorBrandStroke2Contrast,\n color: tokens.colorBrandStroke1,\n '@media screen and (forced-colors: active)': {\n backgroundColor: 'HighlightText',\n color: 'Highlight',\n forcedColorAdjust: 'none'\n },\n animationDuration: '1.5s',\n animationIterationCount: 'infinite',\n animationTimingFunction: 'linear',\n animationName: {\n '0%': {\n transform: 'rotate(0deg)'\n },\n '100%': {\n transform: 'rotate(360deg)'\n }\n },\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationDuration: '1.8s'\n }\n});\n// The spinner tail is rendered using two 135deg arc segments, behind a 105deg arc mask.\n// The segments are rotated out from behind the mask to expand the visible arc from\n// 30deg (min) to 255deg (max), and then back behind the mask again to shrink the arc.\n// The tail and spinner itself also have 360deg rotation animations for the spin.\nconst useSpinnerTailBaseClassName = makeResetStyles({\n position: 'absolute',\n display: 'block',\n width: '100%',\n height: '100%',\n maskImage: 'conic-gradient(transparent 105deg, white 105deg)',\n '&::before, &::after': {\n content: '\"\"',\n position: 'absolute',\n display: 'block',\n width: '100%',\n height: '100%',\n animation: 'inherit',\n backgroundImage: 'conic-gradient(currentcolor 135deg, transparent 135deg)'\n },\n animationDuration: '1.5s',\n animationIterationCount: 'infinite',\n animationTimingFunction: tokens.curveEasyEase,\n animationName: {\n '0%': {\n transform: 'rotate(-135deg)'\n },\n '50%': {\n transform: 'rotate(0deg)'\n },\n '100%': {\n transform: 'rotate(225deg)'\n }\n },\n '&::before': {\n animationName: {\n '0%': {\n transform: 'rotate(0deg)'\n },\n '50%': {\n transform: 'rotate(105deg)'\n },\n '100%': {\n transform: 'rotate(0deg)'\n }\n }\n },\n '&::after': {\n animationName: {\n '0%': {\n transform: 'rotate(0deg)'\n },\n '50%': {\n transform: 'rotate(225deg)'\n },\n '100%': {\n transform: 'rotate(0deg)'\n }\n }\n },\n '@media screen and (prefers-reduced-motion: reduce)': {\n animationIterationCount: '0',\n backgroundImage: 'conic-gradient(transparent 120deg, currentcolor 360deg)',\n '&::before, &::after': {\n content: 'none'\n }\n }\n});\nconst useSpinnerStyles = makeStyles({\n inverted: {\n backgroundColor: tokens.colorNeutralStrokeAlpha2,\n color: tokens.colorNeutralStrokeOnBrand2\n },\n rtlTail: {\n maskImage: 'conic-gradient(white 255deg, transparent 255deg)',\n '&::before, &::after': {\n backgroundImage: 'conic-gradient(transparent 225deg, currentcolor 225deg)'\n },\n '@media screen and (prefers-reduced-motion: reduce)': {\n backgroundImage: 'conic-gradient(currentcolor 0deg, transparent 240deg)'\n }\n },\n 'extra-tiny': {\n height: '16px',\n width: '16px',\n [vars.strokeWidth]: tokens.strokeWidthThick\n },\n tiny: {\n height: '20px',\n width: '20px',\n [vars.strokeWidth]: tokens.strokeWidthThick\n },\n 'extra-small': {\n height: '24px',\n width: '24px',\n [vars.strokeWidth]: tokens.strokeWidthThick\n },\n small: {\n height: '28px',\n width: '28px',\n [vars.strokeWidth]: tokens.strokeWidthThick\n },\n medium: {\n height: '32px',\n width: '32px',\n [vars.strokeWidth]: tokens.strokeWidthThicker\n },\n large: {\n height: '36px',\n width: '36px',\n [vars.strokeWidth]: tokens.strokeWidthThicker\n },\n 'extra-large': {\n height: '40px',\n width: '40px',\n [vars.strokeWidth]: tokens.strokeWidthThicker\n },\n huge: {\n height: '44px',\n width: '44px',\n [vars.strokeWidth]: tokens.strokeWidthThickest\n }\n});\nconst useLabelStyles = makeStyles({\n inverted: {\n color: tokens.colorNeutralForegroundStaticInverted\n },\n 'extra-tiny': {\n ...typographyStyles.body1\n },\n tiny: {\n ...typographyStyles.body1\n },\n 'extra-small': {\n ...typographyStyles.body1\n },\n small: {\n ...typographyStyles.body1\n },\n medium: {\n ...typographyStyles.subtitle2\n },\n large: {\n ...typographyStyles.subtitle2\n },\n 'extra-large': {\n ...typographyStyles.subtitle2\n },\n huge: {\n ...typographyStyles.subtitle1\n }\n});\n/**\n * Apply styling to the Spinner slots based on the state\n */ export const useSpinnerStyles_unstable = (state)=>{\n 'use no memo';\n const { labelPosition, size, appearance } = state;\n const { dir } = useFluent();\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n const spinnerBaseClassName = useSpinnerBaseClassName();\n const spinnerStyles = useSpinnerStyles();\n const spinnerTailBaseClassName = useSpinnerTailBaseClassName();\n const labelStyles = useLabelStyles();\n state.root.className = mergeClasses(spinnerClassNames.root, rootBaseClassName, (labelPosition === 'above' || labelPosition === 'below') && rootStyles.vertical, state.root.className);\n if (state.spinner) {\n state.spinner.className = mergeClasses(spinnerClassNames.spinner, spinnerBaseClassName, spinnerStyles[size], appearance === 'inverted' && spinnerStyles.inverted, state.spinner.className);\n }\n if (state.spinnerTail) {\n state.spinnerTail.className = mergeClasses(spinnerClassNames.spinnerTail, spinnerTailBaseClassName, dir === 'rtl' && spinnerStyles.rtlTail, state.spinnerTail.className);\n }\n if (state.label) {\n state.label.className = mergeClasses(spinnerClassNames.label, labelStyles[size], appearance === 'inverted' && labelStyles.inverted, state.label.className);\n }\n return state;\n};\n"],"names":["useFluent_unstable","useFluent","tokens","typographyStyles","__resetStyles","__styles","mergeClasses","spinnerClassNames","root","spinner","spinnerTail","label","vars","strokeWidth","useRootBaseClassName","useRootStyles","vertical","Beiy3e4","d","useSpinnerBaseClassName","r","s","useSpinnerTailBaseClassName","useSpinnerStyles","inverted","De3pzq","sj55zd","rtlTail","btxmck","gb5jj2","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"],"mappings":";;;;;;;;;;;IAGaO,iBAAiB;;;6BA4MY;eAAzBsC;;;qCA/M+B,iCAAiC;uBAEvB,gBAAgB;AACnE,0BAA0B;I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ACtC,IAAI,CAACiD,SAAS,CAAC;IACrL,IAAIX,KAAK,CAACrC,OAAO,EAAE;QACfqC,KAAK,CAACrC,OAAO,CAACgD,SAAS,OAAGnD,mBAAY,EAACC,iBAAiB,CAACE,OAAO,EAAE4C,oBAAoB,EAAEC,aAAa,CAACN,IAAI,CAAC,EAAEC,UAAU,KAAK,UAAU,IAAIK,aAAa,CAAC9B,QAAQ,EAAEsB,KAAK,CAACrC,OAAO,CAACgD,SAAS,CAAC;IAC9L;IACA,IAAIX,KAAK,CAACpC,WAAW,EAAE;QACnBoC,KAAK,CAACpC,WAAW,CAAC+C,SAAS,GAAGnD,uBAAY,EAACC,iBAAiB,CAACG,WAAW,EAAE6C,wBAAwB,EAAEL,GAAG,KAAK,KAAK,IAAII,aAAa,CAAC3B,OAAO,EAAEmB,KAAK,CAACpC,WAAW,CAAC+C,SAAS,CAAC;IAC5K;IACA,IAAIX,KAAK,CAACnC,KAAK,EAAE;QACbmC,KAAK,CAACnC,KAAK,CAAC8C,SAAS,OAAGnD,mBAAY,EAACC,iBAAiB,CAACI,KAAK,EAAE6C,WAAW,CAACR,IAAI,CAAC,EAAEC,UAAU,KAAK,UAAU,IAAIO,WAAW,CAAChC,QAAQ,EAAEsB,KAAK,CAACnC,KAAK,CAAC8C,SAAS,CAAC;IAC9J;IACA,OAAOX,KAAK;AAChB,CAAC"}
@@ -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":["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"],"mappings":";;;;;;;;;;;IAMaO,iBAAAA;;;6BA2NAwD;eAAAA;;;qCAjOmC,kCAAkC;4BACzC,wBAAwB;uBAEP,iBAAiB;AAGpE,0BAAwD;IAC7DvD,MAAM;IACNC,SAAS;IACTC,aAAa;IACbC,OAAO;AACT,EAAE;AAEF;;CAEC,GACD,MAAMC,OAAO;IACXC,aAAa;AACf;AAEA,MAAMC,2BAAuBV,sBAAAA,EAAgB;IAC3CW,SAAS;IACTC,YAAY;IACZC,gBAAgB;IAChBC,YAAY;IACZC,KAAK;IACLC,UAAU;AACZ;AAEA,MAAMC,oBAAgBhB,iBAAAA,EAAW;IAC/BiB,UAAU;QACRC,eAAe;IACjB;AACF;AAEA,MAAMC,8BAA0BpB,sBAAAA,EAAgB;IAC9CqB,UAAU;IACVC,YAAY;IAEZ,sDAAsD;IACtDC,WACE,CAAC,8BAA8B,CAAC,GAChC,CAAC,4BAA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AAW,EAAE;QACrBsD,MAAMtD,WAAW,CAACiE,SAAS,OAAGrE,mBAAAA,EAC5BC,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,OAAGrE,mBAAAA,EACtBC,kBAAkBI,KAAK,EACvB+D,WAAW,CAACR,KAAK,EACjBC,eAAe,cAAcO,YAAY5B,QAAQ,EACjDkB,MAAMrD,KAAK,CAACgE,SAAS;IAEzB;IAEA,OAAOX;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contexts/SpinnerContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { SpinnerProps } from '../components/Spinner/Spinner.types';\n\nconst SpinnerContext = React.createContext<SpinnerContextValue | undefined>(undefined);\n\n/**\n * @internal\n */\nexport type SpinnerContextValue = Pick<SpinnerProps, 'size'>;\n\nconst SpinnerContextDefaultValue: SpinnerContextValue = {};\n\n/**\n * @internal\n */\nexport const SpinnerContextProvider = SpinnerContext.Provider;\n\n/**\n * @internal\n */\nexport const useSpinnerContext = () => React.useContext(SpinnerContext) ?? SpinnerContextDefaultValue;\n"],"names":["SpinnerContextProvider","useSpinnerContext","SpinnerContext","React","createContext","undefined","SpinnerContextDefaultValue","Provider","useContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAeaA,sBAAAA;eAAAA;;IAKAC,iBAAAA;eAAAA;;;;iEApBU;AAGvB,MAAMC,+BAAiBC,OAAMC,aAAa,CAAkCC;AAO5E,MAAMC,6BAAkD,CAAC;AAKlD,MAAMN,yBAAyBE,eAAeK,QAAQ;AAKtD,MAAMN,oBAAoB;QAAME;WAAAA,CAAAA,oBAAAA,OAAMK,UAAU,CAACN,eAAAA,MAAAA,QAAjBC,sBAAAA,KAAAA,IAAAA,oBAAoCG;AAAyB"}
1
+ {"version":3,"sources":["../src/contexts/SpinnerContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { SpinnerProps } from '../components/Spinner/Spinner.types';\n\nconst SpinnerContext = React.createContext<SpinnerContextValue | undefined>(undefined);\n\n/**\n * @internal\n */\nexport type SpinnerContextValue = Pick<SpinnerProps, 'size'>;\n\nconst SpinnerContextDefaultValue: SpinnerContextValue = {};\n\n/**\n * @internal\n */\nexport const SpinnerContextProvider = SpinnerContext.Provider;\n\n/**\n * @internal\n */\nexport const useSpinnerContext = () => React.useContext(SpinnerContext) ?? SpinnerContextDefaultValue;\n"],"names":["React","SpinnerContext","createContext","undefined","SpinnerContextDefaultValue","SpinnerContextProvider","Provider","useSpinnerContext","useContext"],"mappings":";;;;;;;;;;;IAeaK,sBAAAA;;;qBAKAE;;;;;iEApBU,QAAQ;AAG/B,MAAMN,+BAAiBD,OAAME,aAAa,CAAkCC;AAO5E,MAAMC,6BAAkD,CAAC;AAKlD,+BAA+BH,eAAeK,QAAQ,CAAC;AAKvD,MAAMC,oBAAoB;QAAMP;WAAAA,CAAAA,oBAAAA,OAAMQ,UAAU,CAACP,eAAAA,MAAAA,QAAjBD,sBAAAA,KAAAA,IAAAA,oBAAoCI;EAA2B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contexts/index.ts"],"sourcesContent":["export type { SpinnerContextValue } from './SpinnerContext';\nexport { SpinnerContextProvider, useSpinnerContext } from './SpinnerContext';\n"],"names":["SpinnerContextProvider","useSpinnerContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACSA,sBAAsB;eAAtBA,sCAAsB;;IAAEC,iBAAiB;eAAjBA,iCAAiB;;;gCAAQ"}
1
+ {"version":3,"sources":["../src/contexts/index.ts"],"sourcesContent":["export type { SpinnerContextValue } from './SpinnerContext';\nexport { SpinnerContextProvider, useSpinnerContext } from './SpinnerContext';\n"],"names":["SpinnerContextProvider","useSpinnerContext"],"mappings":";;;;;;;;;;;;eACSA,sCAAsB;;;eAAEC,iCAAiB;;;gCAAQ,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Spinner,\n spinnerClassNames,\n renderSpinner_unstable,\n useSpinner_unstable,\n useSpinnerStyles_unstable,\n} from './Spinner';\nexport type { SpinnerProps, SpinnerSlots, SpinnerState } from './Spinner';\nexport { SpinnerContextProvider, useSpinnerContext } from './contexts/index';\nexport type { SpinnerContextValue } from './contexts/index';\n"],"names":["Spinner","SpinnerContextProvider","renderSpinner_unstable","spinnerClassNames","useSpinnerContext","useSpinnerStyles_unstable","useSpinner_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,OAAO;eAAPA,gBAAO;;IAOAC,sBAAsB;eAAtBA,6BAAsB;;IAL7BC,sBAAsB;eAAtBA,+BAAsB;;IADtBC,iBAAiB;eAAjBA,0BAAiB;;IAMcC,iBAAiB;eAAjBA,wBAAiB;;IAHhDC,yBAAyB;eAAzBA,kCAAyB;;IADzBC,mBAAmB;eAAnBA,4BAAmB;;;yBAEd;uBAEmD"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Spinner,\n spinnerClassNames,\n renderSpinner_unstable,\n useSpinner_unstable,\n useSpinnerStyles_unstable,\n} from './Spinner';\nexport type { SpinnerProps, SpinnerSlots, SpinnerState } from './Spinner';\nexport { SpinnerContextProvider, useSpinnerContext } from './contexts/index';\nexport type { SpinnerContextValue } from './contexts/index';\n"],"names":["Spinner","spinnerClassNames","renderSpinner_unstable","useSpinner_unstable","useSpinnerStyles_unstable","SpinnerContextProvider","useSpinnerContext"],"mappings":";;;;;;;;;;;;eACEA,gBAAO;;;eAOAK,6BAAsB;;;eAL7BH,+BAAsB;;;eADtBD,0BAAiB;;;eAMcK,wBAAiB;;;eAHhDF,kCAAyB;;;eADzBD,4BAAmB;;;yBAEd,YAAY;uBAEuC,mBAAmB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-spinner",
3
- "version": "9.6.2",
3
+ "version": "9.7.1",
4
4
  "description": "Spinner component for Fluent UI React",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -18,11 +18,11 @@
18
18
  "@fluentui/scripts-api-extractor": "*"
19
19
  },
20
20
  "dependencies": {
21
- "@fluentui/react-jsx-runtime": "^9.1.2",
22
- "@fluentui/react-label": "^9.2.2",
21
+ "@fluentui/react-jsx-runtime": "^9.1.3",
22
+ "@fluentui/react-label": "^9.3.1",
23
23
  "@fluentui/react-shared-contexts": "^9.24.0",
24
24
  "@fluentui/react-theme": "^9.1.24",
25
- "@fluentui/react-utilities": "^9.22.0",
25
+ "@fluentui/react-utilities": "^9.23.0",
26
26
  "@griffel/react": "^1.5.22",
27
27
  "@swc/helpers": "^0.5.1"
28
28
  },