@fluentui/react-spinner 0.0.0-nightly-20231012-0415.1 → 0.0.0-nightly-20231016-0417.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.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui/react-spinner",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 12 Oct 2023 04:22:39 GMT",
6
- "tag": "@fluentui/react-spinner_v0.0.0-nightly-20231012-0415.1",
7
- "version": "0.0.0-nightly-20231012-0415.1",
5
+ "date": "Mon, 16 Oct 2023 04:24:35 GMT",
6
+ "tag": "@fluentui/react-spinner_v0.0.0-nightly-20231016-0417.1",
7
+ "version": "0.0.0-nightly-20231016-0417.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
@@ -16,44 +16,65 @@
16
16
  {
17
17
  "author": "beachball",
18
18
  "package": "@fluentui/react-spinner",
19
- "comment": "Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20231012-0415.1",
20
- "commit": "9540e996730ba65d980f1b0ab8eda151661020be"
19
+ "comment": "Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20231016-0417.1",
20
+ "commit": "9ae318a652ff9867244c91fc0c1e63ab1d2d756e"
21
21
  },
22
22
  {
23
23
  "author": "beachball",
24
24
  "package": "@fluentui/react-spinner",
25
- "comment": "Bump @fluentui/react-label to v0.0.0-nightly-20231012-0415.1",
26
- "commit": "9540e996730ba65d980f1b0ab8eda151661020be"
25
+ "comment": "Bump @fluentui/react-label to v0.0.0-nightly-20231016-0417.1",
26
+ "commit": "9ae318a652ff9867244c91fc0c1e63ab1d2d756e"
27
27
  },
28
28
  {
29
29
  "author": "beachball",
30
30
  "package": "@fluentui/react-spinner",
31
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20231012-0415.1",
32
- "commit": "9540e996730ba65d980f1b0ab8eda151661020be"
31
+ "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20231016-0417.1",
32
+ "commit": "9ae318a652ff9867244c91fc0c1e63ab1d2d756e"
33
33
  },
34
34
  {
35
35
  "author": "beachball",
36
36
  "package": "@fluentui/react-spinner",
37
- "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20231012-0415.1",
38
- "commit": "9540e996730ba65d980f1b0ab8eda151661020be"
37
+ "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20231016-0417.1",
38
+ "commit": "9ae318a652ff9867244c91fc0c1e63ab1d2d756e"
39
39
  },
40
40
  {
41
41
  "author": "beachball",
42
42
  "package": "@fluentui/react-spinner",
43
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20231012-0415.1",
44
- "commit": "9540e996730ba65d980f1b0ab8eda151661020be"
43
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20231016-0417.1",
44
+ "commit": "9ae318a652ff9867244c91fc0c1e63ab1d2d756e"
45
45
  },
46
46
  {
47
47
  "author": "beachball",
48
48
  "package": "@fluentui/react-spinner",
49
- "comment": "Bump @fluentui/react-conformance to v0.0.0-nightly-20231012-0415.1",
50
- "commit": "9540e996730ba65d980f1b0ab8eda151661020be"
49
+ "comment": "Bump @fluentui/react-conformance to v0.0.0-nightly-20231016-0417.1",
50
+ "commit": "9ae318a652ff9867244c91fc0c1e63ab1d2d756e"
51
51
  },
52
52
  {
53
53
  "author": "beachball",
54
54
  "package": "@fluentui/react-spinner",
55
- "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20231012-0415.1",
56
- "commit": "9540e996730ba65d980f1b0ab8eda151661020be"
55
+ "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20231016-0417.1",
56
+ "commit": "9ae318a652ff9867244c91fc0c1e63ab1d2d756e"
57
+ }
58
+ ]
59
+ }
60
+ },
61
+ {
62
+ "date": "Thu, 12 Oct 2023 14:55:44 GMT",
63
+ "tag": "@fluentui/react-spinner_v9.3.25",
64
+ "version": "9.3.25",
65
+ "comments": {
66
+ "patch": [
67
+ {
68
+ "author": "beachball",
69
+ "package": "@fluentui/react-spinner",
70
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.17",
71
+ "commit": "8178c3cae60005bc21137aa1f3e766e18cdb4a30"
72
+ },
73
+ {
74
+ "author": "beachball",
75
+ "package": "@fluentui/react-spinner",
76
+ "comment": "Bump @fluentui/react-label to v9.1.45",
77
+ "commit": "8178c3cae60005bc21137aa1f3e766e18cdb4a30"
57
78
  }
58
79
  ]
59
80
  }
package/CHANGELOG.md CHANGED
@@ -1,24 +1,34 @@
1
1
  # Change Log - @fluentui/react-spinner
2
2
 
3
- This log was last generated on Thu, 12 Oct 2023 04:22:39 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 16 Oct 2023 04:24:35 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20231012-0415.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v0.0.0-nightly-20231012-0415.1)
7
+ ## [0.0.0-nightly-20231016-0417.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v0.0.0-nightly-20231016-0417.1)
8
8
 
9
- Thu, 12 Oct 2023 04:22:39 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.3.24..@fluentui/react-spinner_v0.0.0-nightly-20231012-0415.1)
9
+ Mon, 16 Oct 2023 04:24:35 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.3.25..@fluentui/react-spinner_v0.0.0-nightly-20231016-0417.1)
11
11
 
12
12
  ### Changes
13
13
 
14
14
  - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20231012-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/9540e996730ba65d980f1b0ab8eda151661020be) by beachball)
16
- - Bump @fluentui/react-label to v0.0.0-nightly-20231012-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/9540e996730ba65d980f1b0ab8eda151661020be) by beachball)
17
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20231012-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/9540e996730ba65d980f1b0ab8eda151661020be) by beachball)
18
- - Bump @fluentui/react-theme to v0.0.0-nightly-20231012-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/9540e996730ba65d980f1b0ab8eda151661020be) by beachball)
19
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20231012-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/9540e996730ba65d980f1b0ab8eda151661020be) by beachball)
20
- - Bump @fluentui/react-conformance to v0.0.0-nightly-20231012-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/9540e996730ba65d980f1b0ab8eda151661020be) by beachball)
21
- - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20231012-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/9540e996730ba65d980f1b0ab8eda151661020be) by beachball)
15
+ - Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20231016-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/9ae318a652ff9867244c91fc0c1e63ab1d2d756e) by beachball)
16
+ - Bump @fluentui/react-label to v0.0.0-nightly-20231016-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/9ae318a652ff9867244c91fc0c1e63ab1d2d756e) by beachball)
17
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20231016-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/9ae318a652ff9867244c91fc0c1e63ab1d2d756e) by beachball)
18
+ - Bump @fluentui/react-theme to v0.0.0-nightly-20231016-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/9ae318a652ff9867244c91fc0c1e63ab1d2d756e) by beachball)
19
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20231016-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/9ae318a652ff9867244c91fc0c1e63ab1d2d756e) by beachball)
20
+ - Bump @fluentui/react-conformance to v0.0.0-nightly-20231016-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/9ae318a652ff9867244c91fc0c1e63ab1d2d756e) by beachball)
21
+ - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20231016-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/9ae318a652ff9867244c91fc0c1e63ab1d2d756e) by beachball)
22
+
23
+ ## [9.3.25](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.3.25)
24
+
25
+ Thu, 12 Oct 2023 14:55:44 GMT
26
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinner_v9.3.24..@fluentui/react-spinner_v9.3.25)
27
+
28
+ ### Patches
29
+
30
+ - Bump @fluentui/react-jsx-runtime to v9.0.17 ([PR #29513](https://github.com/microsoft/fluentui/pull/29513) by beachball)
31
+ - Bump @fluentui/react-label to v9.1.45 ([PR #29513](https://github.com/microsoft/fluentui/pull/29513) by beachball)
22
32
 
23
33
  ## [9.3.24](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinner_v9.3.24)
24
34
 
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { getNativeElementProps, useId, useTimeout, slot } from '@fluentui/react-utilities';
2
+ import { getIntrinsicElementProps, useId, useTimeout, slot } from '@fluentui/react-utilities';
3
3
  import { Label } from '@fluentui/react-label';
4
4
  import { DefaultSvg } from './DefaultSvg';
5
5
  import { useSpinnerContext } from '../../contexts/SpinnerContext';
@@ -17,8 +17,11 @@ import { useSpinnerContext } from '../../contexts/SpinnerContext';
17
17
  const { appearance = 'primary', labelPosition = 'after', size = contextSize !== null && contextSize !== void 0 ? contextSize : 'medium', delay = 0 } = props;
18
18
  const baseId = useId('spinner');
19
19
  const { role = 'progressbar', tabIndex, ...rest } = props;
20
- const nativeRoot = slot.always(getNativeElementProps('div', {
21
- ref,
20
+ const nativeRoot = slot.always(getIntrinsicElementProps('div', {
21
+ // FIXME:
22
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
23
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
24
+ ref: ref,
22
25
  role,
23
26
  ...rest
24
27
  }, [
@@ -1 +1 @@
1
- {"version":3,"sources":["useSpinner.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useId, useTimeout, slot } from '@fluentui/react-utilities';\nimport type { SpinnerProps, SpinnerState } from './Spinner.types';\nimport { Label } from '@fluentui/react-label';\nimport { DefaultSvg } from './DefaultSvg';\nimport { useSpinnerContext } from '../../contexts/SpinnerContext';\n\n/**\n * Create the state required to render Spinner.\n *\n * The returned state can be modified with hooks such as useSpinnerStyles_unstable,\n * before being passed to renderSpinner_unstable.\n *\n * @param props - props from this instance of Spinner\n * @param ref - reference to root HTMLElement of Spinner\n */\nexport const useSpinner_unstable = (props: SpinnerProps, ref: React.Ref<HTMLElement>): SpinnerState => {\n // Props\n const { size: contextSize } = useSpinnerContext();\n const { appearance = 'primary', labelPosition = 'after', size = contextSize ?? 'medium', delay = 0 } = props;\n const baseId = useId('spinner');\n\n const { role = 'progressbar', tabIndex, ...rest } = props;\n const nativeRoot = slot.always(getNativeElementProps('div', { ref, role, ...rest }, ['size']), {\n elementType: 'div',\n });\n const [isVisible, setIsVisible] = React.useState(true);\n const [setDelayTimeout, clearDelayTimeout] = useTimeout();\n React.useEffect(() => {\n if (delay <= 0) {\n return;\n }\n setIsVisible(false);\n setDelayTimeout(() => {\n setIsVisible(true);\n }, delay);\n return () => {\n clearDelayTimeout();\n };\n }, [setDelayTimeout, clearDelayTimeout, delay]);\n const labelShorthand = slot.optional(props.label, {\n defaultProps: { id: baseId },\n renderByDefault: false,\n elementType: Label,\n });\n const spinnerShortHand = slot.optional(props.spinner, {\n renderByDefault: true,\n defaultProps: { children: <DefaultSvg />, tabIndex },\n elementType: 'span',\n });\n if (labelShorthand && nativeRoot && !nativeRoot['aria-labelledby']) {\n nativeRoot['aria-labelledby'] = labelShorthand.id;\n }\n const state: SpinnerState = {\n appearance,\n delay,\n labelPosition,\n size,\n shouldRenderSpinner: isVisible,\n components: { root: 'div', spinner: 'span', label: Label },\n root: nativeRoot,\n spinner: spinnerShortHand,\n label: labelShorthand,\n };\n return state;\n};\n"],"names":["React","getNativeElementProps","useId","useTimeout","slot","Label","DefaultSvg","useSpinnerContext","useSpinner_unstable","props","ref","size","contextSize","appearance","labelPosition","delay","baseId","role","tabIndex","rest","nativeRoot","always","elementType","isVisible","setIsVisible","useState","setDelayTimeout","clearDelayTimeout","useEffect","labelShorthand","optional","label","defaultProps","id","renderByDefault","spinnerShortHand","spinner","children","state","shouldRenderSpinner","components","root"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,KAAK,EAAEC,UAAU,EAAEC,IAAI,QAAQ,4BAA4B;AAE3F,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE;;;;;;;;CAQC,GACD,OAAO,MAAMC,sBAAsB,CAACC,OAAqBC;IACvD,QAAQ;IACR,MAAM,EAAEC,MAAMC,WAAW,EAAE,GAAGL;IAC9B,MAAM,EAAEM,aAAa,SAAS,EAAEC,gBAAgB,OAAO,EAAEH,OAAOC,wBAAAA,yBAAAA,cAAe,QAAQ,EAAEG,QAAQ,CAAC,EAAE,GAAGN;IACvG,MAAMO,SAASd,MAAM;IAErB,MAAM,EAAEe,OAAO,aAAa,EAAEC,QAAQ,EAAE,GAAGC,MAAM,GAAGV;IACpD,MAAMW,aAAahB,KAAKiB,MAAM,CAACpB,sBAAsB,OAAO;QAAES;QAAKO;QAAM,GAAGE,IAAI;IAAC,GAAG;QAAC;KAAO,GAAG;QAC7FG,aAAa;IACf;IACA,MAAM,CAACC,WAAWC,aAAa,GAAGxB,MAAMyB,QAAQ,CAAC;IACjD,MAAM,CAACC,iBAAiBC,kBAAkB,GAAGxB;IAC7CH,MAAM4B,SAAS,CAAC;QACd,IAAIb,SAAS,GAAG;YACd;QACF;QACAS,aAAa;QACbE,gBAAgB;YACdF,aAAa;QACf,GAAGT;QACH,OAAO;YACLY;QACF;IACF,GAAG;QAACD;QAAiBC;QAAmBZ;KAAM;IAC9C,MAAMc,iBAAiBzB,KAAK0B,QAAQ,CAACrB,MAAMsB,KAAK,EAAE;QAChDC,cAAc;YAAEC,IAAIjB;QAAO;QAC3BkB,iBAAiB;QACjBZ,aAAajB;IACf;IACA,MAAM8B,mBAAmB/B,KAAK0B,QAAQ,CAACrB,MAAM2B,OAAO,EAAE;QACpDF,iBAAiB;QACjBF,cAAc;YAAEK,wBAAU,oBAAC/B;YAAeY;QAAS;QACnDI,aAAa;IACf;IACA,IAAIO,kBAAkBT,cAAc,CAACA,UAAU,CAAC,kBAAkB,EAAE;QAClEA,UAAU,CAAC,kBAAkB,GAAGS,eAAeI,EAAE;IACnD;IACA,MAAMK,QAAsB;QAC1BzB;QACAE;QACAD;QACAH;QACA4B,qBAAqBhB;QACrBiB,YAAY;YAAEC,MAAM;YAAOL,SAAS;YAAQL,OAAO1B;QAAM;QACzDoC,MAAMrB;QACNgB,SAASD;QACTJ,OAAOF;IACT;IACA,OAAOS;AACT,EAAE"}
1
+ {"version":3,"sources":["useSpinner.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useId, useTimeout, slot } from '@fluentui/react-utilities';\nimport type { SpinnerProps, SpinnerState } from './Spinner.types';\nimport { Label } from '@fluentui/react-label';\nimport { DefaultSvg } from './DefaultSvg';\nimport { useSpinnerContext } from '../../contexts/SpinnerContext';\n\n/**\n * Create the state required to render Spinner.\n *\n * The returned state can be modified with hooks such as useSpinnerStyles_unstable,\n * before being passed to renderSpinner_unstable.\n *\n * @param props - props from this instance of Spinner\n * @param ref - reference to root HTMLElement of Spinner\n */\nexport const useSpinner_unstable = (props: SpinnerProps, ref: React.Ref<HTMLElement>): SpinnerState => {\n // Props\n const { size: contextSize } = useSpinnerContext();\n const { appearance = 'primary', labelPosition = 'after', size = contextSize ?? 'medium', delay = 0 } = props;\n const baseId = useId('spinner');\n\n const { role = 'progressbar', tabIndex, ...rest } = props;\n const nativeRoot = slot.always(\n getIntrinsicElementProps(\n 'div',\n {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLDivElement>,\n role,\n ...rest,\n },\n ['size'],\n ),\n {\n elementType: 'div',\n },\n );\n const [isVisible, setIsVisible] = React.useState(true);\n const [setDelayTimeout, clearDelayTimeout] = useTimeout();\n React.useEffect(() => {\n if (delay <= 0) {\n return;\n }\n setIsVisible(false);\n setDelayTimeout(() => {\n setIsVisible(true);\n }, delay);\n return () => {\n clearDelayTimeout();\n };\n }, [setDelayTimeout, clearDelayTimeout, delay]);\n const labelShorthand = slot.optional(props.label, {\n defaultProps: { id: baseId },\n renderByDefault: false,\n elementType: Label,\n });\n const spinnerShortHand = slot.optional(props.spinner, {\n renderByDefault: true,\n defaultProps: { children: <DefaultSvg />, tabIndex },\n elementType: 'span',\n });\n if (labelShorthand && nativeRoot && !nativeRoot['aria-labelledby']) {\n nativeRoot['aria-labelledby'] = labelShorthand.id;\n }\n const state: SpinnerState = {\n appearance,\n delay,\n labelPosition,\n size,\n shouldRenderSpinner: isVisible,\n components: { root: 'div', spinner: 'span', label: Label },\n root: nativeRoot,\n spinner: spinnerShortHand,\n label: labelShorthand,\n };\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","useId","useTimeout","slot","Label","DefaultSvg","useSpinnerContext","useSpinner_unstable","props","ref","size","contextSize","appearance","labelPosition","delay","baseId","role","tabIndex","rest","nativeRoot","always","elementType","isVisible","setIsVisible","useState","setDelayTimeout","clearDelayTimeout","useEffect","labelShorthand","optional","label","defaultProps","id","renderByDefault","spinnerShortHand","spinner","children","state","shouldRenderSpinner","components","root"],"mappings":"AAAA,YAAYA,WAAW,QAA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;YAAEK,wBAAU,oBAAC/B;YAAeY;QAAS;QACnDI,aAAa;IACf;IACA,IAAIO,kBAAkBT,cAAc,CAACA,UAAU,CAAC,kBAAkB,EAAE;QAClEA,UAAU,CAAC,kBAAkB,GAAGS,eAAeI,EAAE;IACnD;IACA,MAAMK,QAAsB;QAC1BzB;QACAE;QACAD;QACAH;QACA4B,qBAAqBhB;QACrBiB,YAAY;YAAEC,MAAM;YAAOL,SAAS;YAAQL,OAAO1B;QAAM;QACzDoC,MAAMrB;QACNgB,SAASD;QACTJ,OAAOF;IACT;IACA,OAAOS;AACT,EAAE"}
@@ -20,8 +20,11 @@ const useSpinner_unstable = (props, ref)=>{
20
20
  const { appearance = 'primary', labelPosition = 'after', size = contextSize !== null && contextSize !== void 0 ? contextSize : 'medium', delay = 0 } = props;
21
21
  const baseId = (0, _reactutilities.useId)('spinner');
22
22
  const { role = 'progressbar', tabIndex, ...rest } = props;
23
- const nativeRoot = _reactutilities.slot.always((0, _reactutilities.getNativeElementProps)('div', {
24
- ref,
23
+ const nativeRoot = _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
24
+ // FIXME:
25
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
26
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
27
+ ref: ref,
25
28
  role,
26
29
  ...rest
27
30
  }, [
@@ -1 +1 @@
1
- {"version":3,"sources":["useSpinner.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useId, useTimeout, slot } from '@fluentui/react-utilities';\nimport { Label } from '@fluentui/react-label';\nimport { DefaultSvg } from './DefaultSvg';\nimport { useSpinnerContext } from '../../contexts/SpinnerContext';\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 */ export const useSpinner_unstable = (props, ref)=>{\n // Props\n const { size: contextSize } = useSpinnerContext();\n const { appearance = 'primary', labelPosition = 'after', size = contextSize !== null && contextSize !== void 0 ? contextSize : 'medium', delay = 0 } = props;\n const baseId = useId('spinner');\n const { role = 'progressbar', tabIndex, ...rest } = props;\n const nativeRoot = slot.always(getNativeElementProps('div', {\n ref,\n role,\n ...rest\n }, [\n 'size'\n ]), {\n elementType: 'div'\n });\n const [isVisible, setIsVisible] = React.useState(true);\n const [setDelayTimeout, clearDelayTimeout] = useTimeout();\n React.useEffect(()=>{\n if (delay <= 0) {\n return;\n }\n setIsVisible(false);\n setDelayTimeout(()=>{\n setIsVisible(true);\n }, delay);\n return ()=>{\n clearDelayTimeout();\n };\n }, [\n setDelayTimeout,\n clearDelayTimeout,\n delay\n ]);\n const labelShorthand = slot.optional(props.label, {\n defaultProps: {\n id: baseId\n },\n renderByDefault: false,\n elementType: Label\n });\n const spinnerShortHand = slot.optional(props.spinner, {\n renderByDefault: true,\n defaultProps: {\n children: /*#__PURE__*/ React.createElement(DefaultSvg, null),\n tabIndex\n },\n elementType: 'span'\n });\n if (labelShorthand && nativeRoot && !nativeRoot['aria-labelledby']) {\n nativeRoot['aria-labelledby'] = labelShorthand.id;\n }\n const state = {\n appearance,\n delay,\n labelPosition,\n size,\n shouldRenderSpinner: isVisible,\n components: {\n root: 'div',\n spinner: 'span',\n label: Label\n },\n root: nativeRoot,\n spinner: spinnerShortHand,\n label: labelShorthand\n };\n return state;\n};\n"],"names":["useSpinner_unstable","props","ref","size","contextSize","useSpinnerContext","appearance","labelPosition","delay","baseId","useId","role","tabIndex","rest","nativeRoot","slot","always","getNativeElementProps","elementType","isVisible","setIsVisible","React","useState","setDelayTimeout","clearDelayTimeout","useTimeout","useEffect","labelShorthand","optional","label","defaultProps","id","renderByDefault","Label","spinnerShortHand","spinner","children","createElement","DefaultSvg","state","shouldRenderSpinner","components","root"],"mappings":";;;;+BAaiBA;;;eAAAA;;;;iEAbM;gCACwC;4BACzC;4BACK;gCACO;AASvB,MAAMA,sBAAsB,C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Ga,eAAeI,EAAE;IACrD;IACA,MAAMQ,QAAQ;QACVjC;QACAE;QACAD;QACAJ;QACAqC,qBAAqBrB;QACrBsB,YAAY;YACRC,MAAM;YACNP,SAAS;YACTN,OAAOI,iBAAK;QAChB;QACAS,MAAM5B;QACNqB,SAASD;QACTL,OAAOF;IACX;IACA,OAAOY;AACX"}
1
+ {"version":3,"sources":["useSpinner.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useId, useTimeout, slot } from '@fluentui/react-utilities';\nimport { Label } from '@fluentui/react-label';\nimport { DefaultSvg } from './DefaultSvg';\nimport { useSpinnerContext } from '../../contexts/SpinnerContext';\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 */ export const useSpinner_unstable = (props, ref)=>{\n // Props\n const { size: contextSize } = useSpinnerContext();\n const { appearance = 'primary', labelPosition = 'after', size = contextSize !== null && contextSize !== void 0 ? contextSize : 'medium', delay = 0 } = props;\n const baseId = useId('spinner');\n const { role = 'progressbar', tabIndex, ...rest } = props;\n const nativeRoot = slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref,\n role,\n ...rest\n }, [\n 'size'\n ]), {\n elementType: 'div'\n });\n const [isVisible, setIsVisible] = React.useState(true);\n const [setDelayTimeout, clearDelayTimeout] = useTimeout();\n React.useEffect(()=>{\n if (delay <= 0) {\n return;\n }\n setIsVisible(false);\n setDelayTimeout(()=>{\n setIsVisible(true);\n }, delay);\n return ()=>{\n clearDelayTimeout();\n };\n }, [\n setDelayTimeout,\n clearDelayTimeout,\n delay\n ]);\n const labelShorthand = slot.optional(props.label, {\n defaultProps: {\n id: baseId\n },\n renderByDefault: false,\n elementType: Label\n });\n const spinnerShortHand = slot.optional(props.spinner, {\n renderByDefault: true,\n defaultProps: {\n children: /*#__PURE__*/ React.createElement(DefaultSvg, null),\n tabIndex\n },\n elementType: 'span'\n });\n if (labelShorthand && nativeRoot && !nativeRoot['aria-labelledby']) {\n nativeRoot['aria-labelledby'] = labelShorthand.id;\n }\n const state = {\n appearance,\n delay,\n labelPosition,\n size,\n shouldRenderSpinner: isVisible,\n components: {\n root: 'div',\n spinner: 'span',\n label: Label\n },\n root: nativeRoot,\n spinner: spinnerShortHand,\n label: labelShorthand\n };\n return state;\n};\n"],"names":["useSpinner_unstable","props","ref","size","contextSize","useSpinnerContext","appearance","labelPosition","delay","baseId","useId","role","tabIndex","rest","nativeRoot","slot","always","getIntrinsicElementProps","elementType","isVisible","setIsVisible","React","useState","setDelayTimeout","clearDelayTimeout","useTimeout","useEffect","labelShorthand","optional","label","defaultProps","id","renderByDefault","Label","spinnerShortHand","spinner","children","createElement","DefaultSvg","state","shouldRenderSpinner","components","root"],"mappings":";;;;+BAaiBA;;;eAAAA;;;;iEAbM;gCAC2C;4BAC5C;4BACK;gCACO;AASvB,MAAMA,sBAAsB,CAACC,OAAOC;IAC3C,QAAQ;IACR,MAAM,EAAEC,MAAMC,WAAW,EAAE,GAAGC,IAAAA,iCAAiB;IAC/C,MAAM,EAAEC,aAAa,SAAS,EAAEC,gBAAgB,OAAO,EAAEJ,OAAOC,gBAAgB,QAAQA,gBAAgB,KAAK,IAAIA,cAAc,QAAQ,EAAEI,QAAQ,CAAC,EAAE,GAAGP;IACvJ,MAAMQ,SAASC,IAAAA,qBAAK,EAAC;IACrB,MAAM,EAAEC,OAAO,aAAa,EAAEC,QAAQ,EAAE,GAAGC,MAAM,GAAGZ;IACpD,MAAMa,aAAaC,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;QAC3D,SAAS;QACT,4EAA4E;QAC5E,4FAA4F;QAC5Ff,KAAKA;QACLS;QACA,GAAGE,IAAI;IACX,GAAG;QACC;KACH,GAAG;QACAK,aAAa;IACjB;IACA,MAAM,CAACC,WAAWC,aAAa,GAAGC,OAAMC,QAAQ,CAAC;IACjD,MAAM,CAACC,iBAAiBC,kBAAkB,GAAGC,IAAAA,0BAAU;IACvDJ,OAAMK,SAAS,CAAC;QACZ,IAAIlB,SAAS,GAAG;YACZ;QACJ;QACAY,aAAa;QACbG,gBAAgB;YACZH,aAAa;QACjB,GAAGZ;QACH,OAAO;YACHgB;QACJ;IACJ,GAAG;QACCD;QACAC;QACAhB;KACH;IACD,MAAMmB,iBAAiBZ,oBAAI,CAACa,QAAQ,CAAC3B,MAAM4B,KAAK,EAAE;QAC9CC,cAAc;YACVC,IAAItB;QACR;QACAuB,iBAAiB;QACjBd,aAAae,iBAAK;IACtB;IACA,MAAMC,mBAAmBnB,oBAAI,CAACa,QAAQ,CAAC3B,MAAMkC,OAAO,EAAE;QAClDH,iBAAiB;QACjBF,cAAc;YACVM,UAAU,WAAW,GAAGf,OAAMgB,aAAa,CAACC,sBAAU,EAAE;YACxD1B;QACJ;QACAM,aAAa;IACjB;IACA,IAAIS,kBAAkBb,cAAc,CAACA,UAAU,CAAC,kBAAkB,EAAE;QAChEA,UAAU,CAAC,kBAAkB,GAAGa,eAAeI,EAAE;IACrD;IACA,MAAMQ,QAAQ;QACVjC;QACAE;QACAD;QACAJ;QACAqC,qBAAqBrB;QACrBsB,YAAY;YACRC,MAAM;YACNP,SAAS;YACTN,OAAOI,iBAAK;QAChB;QACAS,MAAM5B;QACNqB,SAASD;QACTL,OAAOF;IACX;IACA,OAAOY;AACX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-spinner",
3
- "version": "0.0.0-nightly-20231012-0415.1",
3
+ "version": "0.0.0-nightly-20231016-0417.1",
4
4
  "description": "Spinner component for Fluent UI React",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -27,17 +27,17 @@
27
27
  },
28
28
  "devDependencies": {
29
29
  "@fluentui/eslint-plugin": "*",
30
- "@fluentui/react-conformance": "0.0.0-nightly-20231012-0415.1",
31
- "@fluentui/react-conformance-griffel": "0.0.0-nightly-20231012-0415.1",
30
+ "@fluentui/react-conformance": "0.0.0-nightly-20231016-0417.1",
31
+ "@fluentui/react-conformance-griffel": "0.0.0-nightly-20231016-0417.1",
32
32
  "@fluentui/scripts-api-extractor": "*",
33
33
  "@fluentui/scripts-tasks": "*"
34
34
  },
35
35
  "dependencies": {
36
- "@fluentui/react-jsx-runtime": "0.0.0-nightly-20231012-0415.1",
37
- "@fluentui/react-label": "0.0.0-nightly-20231012-0415.1",
38
- "@fluentui/react-shared-contexts": "0.0.0-nightly-20231012-0415.1",
39
- "@fluentui/react-theme": "0.0.0-nightly-20231012-0415.1",
40
- "@fluentui/react-utilities": "0.0.0-nightly-20231012-0415.1",
36
+ "@fluentui/react-jsx-runtime": "0.0.0-nightly-20231016-0417.1",
37
+ "@fluentui/react-label": "0.0.0-nightly-20231016-0417.1",
38
+ "@fluentui/react-shared-contexts": "0.0.0-nightly-20231016-0417.1",
39
+ "@fluentui/react-theme": "0.0.0-nightly-20231016-0417.1",
40
+ "@fluentui/react-utilities": "0.0.0-nightly-20231016-0417.1",
41
41
  "@griffel/react": "^1.5.14",
42
42
  "@swc/helpers": "^0.5.1"
43
43
  },