@fluentui/react-spinner 9.1.4 → 9.1.6

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.
Files changed (50) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +73 -1
  3. package/CHANGELOG.md +27 -2
  4. package/lib/Spinner.js.map +1 -1
  5. package/lib/components/Spinner/DefaultSvg.js.map +1 -1
  6. package/lib/components/Spinner/Spinner.js.map +1 -1
  7. package/lib/components/Spinner/Spinner.types.js.map +1 -1
  8. package/lib/components/Spinner/index.js.map +1 -1
  9. package/lib/components/Spinner/renderSpinner.js +1 -9
  10. package/lib/components/Spinner/renderSpinner.js.map +1 -1
  11. package/lib/components/Spinner/useSpinner.js.map +1 -1
  12. package/lib/components/Spinner/useSpinnerStyles.js.map +1 -1
  13. package/lib/index.js.map +1 -1
  14. package/lib-commonjs/Spinner.js +5 -4
  15. package/lib-commonjs/Spinner.js.map +1 -1
  16. package/lib-commonjs/components/Spinner/DefaultSvg.js +15 -12
  17. package/lib-commonjs/components/Spinner/DefaultSvg.js.map +1 -1
  18. package/lib-commonjs/components/Spinner/Spinner.js +19 -20
  19. package/lib-commonjs/components/Spinner/Spinner.js.map +1 -1
  20. package/lib-commonjs/components/Spinner/Spinner.types.js +3 -2
  21. package/lib-commonjs/components/Spinner/Spinner.types.js.map +1 -1
  22. package/lib-commonjs/components/Spinner/index.js +9 -8
  23. package/lib-commonjs/components/Spinner/index.js.map +1 -1
  24. package/lib-commonjs/components/Spinner/renderSpinner.js +14 -27
  25. package/lib-commonjs/components/Spinner/renderSpinner.js.map +1 -1
  26. package/lib-commonjs/components/Spinner/useSpinner.js +53 -65
  27. package/lib-commonjs/components/Spinner/useSpinner.js.map +1 -1
  28. package/lib-commonjs/components/Spinner/useSpinnerStyles.js +351 -233
  29. package/lib-commonjs/components/Spinner/useSpinnerStyles.js.map +1 -1
  30. package/lib-commonjs/index.js +16 -33
  31. package/lib-commonjs/index.js.map +1 -1
  32. package/package.json +9 -8
  33. package/lib-amd/Spinner.js +0 -6
  34. package/lib-amd/Spinner.js.map +0 -1
  35. package/lib-amd/components/Spinner/DefaultSvg.js +0 -10
  36. package/lib-amd/components/Spinner/DefaultSvg.js.map +0 -1
  37. package/lib-amd/components/Spinner/Spinner.js +0 -17
  38. package/lib-amd/components/Spinner/Spinner.js.map +0 -1
  39. package/lib-amd/components/Spinner/Spinner.types.js +0 -5
  40. package/lib-amd/components/Spinner/Spinner.types.js.map +0 -1
  41. package/lib-amd/components/Spinner/index.js +0 -10
  42. package/lib-amd/components/Spinner/index.js.map +0 -1
  43. package/lib-amd/components/Spinner/renderSpinner.js +0 -18
  44. package/lib-amd/components/Spinner/renderSpinner.js.map +0 -1
  45. package/lib-amd/components/Spinner/useSpinner.js +0 -53
  46. package/lib-amd/components/Spinner/useSpinner.js.map +0 -1
  47. package/lib-amd/components/Spinner/useSpinnerStyles.js +0 -256
  48. package/lib-amd/components/Spinner/useSpinnerStyles.js.map +0 -1
  49. package/lib-amd/index.js +0 -11
  50. package/lib-amd/index.js.map +0 -1
@@ -1,70 +1,58 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useSpinner_unstable", {
6
+ enumerable: true,
7
+ get: ()=>useSpinner_unstable
5
8
  });
6
- exports.useSpinner_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
- const react_label_1 = /*#__PURE__*/require("@fluentui/react-label");
10
- const DefaultSvg_1 = /*#__PURE__*/require("./DefaultSvg");
11
- /**
12
- * Create the state required to render Spinner.
13
- *
14
- * The returned state can be modified with hooks such as useSpinnerStyles_unstable,
15
- * before being passed to renderSpinner_unstable.
16
- *
17
- * @param props - props from this instance of Spinner
18
- * @param ref - reference to root HTMLElement of Spinner
19
- */
20
- const useSpinner_unstable = (props, ref) => {
21
- // Props
22
- const {
23
- appearance = 'primary',
24
- labelPosition = 'after',
25
- size = 'medium'
26
- } = props;
27
- const baseId = react_utilities_1.useId('spinner');
28
- const {
29
- role = 'progressbar',
30
- tabIndex,
31
- ...rest
32
- } = props;
33
- const nativeRoot = react_utilities_1.getNativeElementProps('div', {
34
- ref,
35
- role,
36
- ...rest
37
- }, ['size']);
38
- const labelShorthand = react_utilities_1.resolveShorthand(props.label, {
39
- defaultProps: {
40
- id: baseId
41
- },
42
- required: false
43
- });
44
- const spinnerShortHand = react_utilities_1.resolveShorthand(props.spinner, {
45
- required: true,
46
- defaultProps: {
47
- children: React.createElement(DefaultSvg_1.DefaultSvg, null),
48
- tabIndex
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactUtilities = require("@fluentui/react-utilities");
12
+ const _reactLabel = require("@fluentui/react-label");
13
+ const _defaultSvg = require("./DefaultSvg");
14
+ const useSpinner_unstable = (props, ref)=>{
15
+ // Props
16
+ const { appearance ='primary' , labelPosition ='after' , size ='medium' } = props;
17
+ const baseId = (0, _reactUtilities.useId)('spinner');
18
+ const { role ='progressbar' , tabIndex , ...rest } = props;
19
+ const nativeRoot = (0, _reactUtilities.getNativeElementProps)('div', {
20
+ ref,
21
+ role,
22
+ ...rest
23
+ }, [
24
+ 'size'
25
+ ]);
26
+ const labelShorthand = (0, _reactUtilities.resolveShorthand)(props.label, {
27
+ defaultProps: {
28
+ id: baseId
29
+ },
30
+ required: false
31
+ });
32
+ const spinnerShortHand = (0, _reactUtilities.resolveShorthand)(props.spinner, {
33
+ required: true,
34
+ defaultProps: {
35
+ children: /*#__PURE__*/ _react.createElement(_defaultSvg.DefaultSvg, null),
36
+ tabIndex
37
+ }
38
+ });
39
+ if (labelShorthand && nativeRoot && !nativeRoot['aria-labelledby']) {
40
+ nativeRoot['aria-labelledby'] = labelShorthand.id;
49
41
  }
50
- });
51
- if (labelShorthand && nativeRoot && !nativeRoot['aria-labelledby']) {
52
- nativeRoot['aria-labelledby'] = labelShorthand.id;
53
- }
54
- const state = {
55
- appearance,
56
- labelPosition,
57
- size,
58
- components: {
59
- root: 'div',
60
- spinner: 'span',
61
- label: react_label_1.Label
62
- },
63
- root: nativeRoot,
64
- spinner: spinnerShortHand,
65
- label: labelShorthand
66
- };
67
- return state;
68
- };
69
- exports.useSpinner_unstable = useSpinner_unstable;
42
+ const state = {
43
+ appearance,
44
+ labelPosition,
45
+ size,
46
+ components: {
47
+ root: 'div',
48
+ spinner: 'span',
49
+ label: _reactLabel.Label
50
+ },
51
+ root: nativeRoot,
52
+ spinner: spinnerShortHand,
53
+ label: labelShorthand
54
+ };
55
+ return state;
56
+ }; //# sourceMappingURL=useSpinner.js.map
57
+
70
58
  //# sourceMappingURL=useSpinner.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","react_utilities_1","react_label_1","DefaultSvg_1","useSpinner_unstable","props","ref","appearance","labelPosition","size","baseId","useId","role","tabIndex","rest","nativeRoot","getNativeElementProps","labelShorthand","resolveShorthand","label","defaultProps","id","required","spinnerShortHand","spinner","children","createElement","DefaultSvg","state","components","root","Label","exports"],"sources":["../src/packages/react-components/react-spinner/src/components/Spinner/useSpinner.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport type { SpinnerProps, SpinnerState } from './Spinner.types';\nimport { Label } from '@fluentui/react-label';\nimport { DefaultSvg } from './DefaultSvg';\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 { appearance = 'primary', labelPosition = 'after', size = 'medium' } = props;\n const baseId = useId('spinner');\n\n const { role = 'progressbar', tabIndex, ...rest } = props;\n const nativeRoot = getNativeElementProps('div', { ref, role, ...rest }, ['size']);\n\n const labelShorthand = resolveShorthand(props.label, {\n defaultProps: {\n id: baseId,\n },\n required: false,\n });\n\n const spinnerShortHand = resolveShorthand(props.spinner, {\n required: true,\n defaultProps: {\n children: <DefaultSvg />,\n tabIndex,\n },\n });\n\n if (labelShorthand && nativeRoot && !nativeRoot['aria-labelledby']) {\n nativeRoot['aria-labelledby'] = labelShorthand.id;\n }\n\n const state: SpinnerState = {\n appearance,\n labelPosition,\n size,\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"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAEA,MAAAE,aAAA,gBAAAF,OAAA;AACA,MAAAG,YAAA,gBAAAH,OAAA;AAEA;;;;;;;;;AASO,MAAMI,mBAAmB,GAAGA,CAACC,KAAmB,EAAEC,GAA2B,KAAkB;EACpG;EACA,MAAM;IAAEC,UAAU,GAAG,SAAS;IAAEC,aAAa,GAAG,OAAO;IAAEC,IAAI,GAAG;EAAQ,CAAE,GAAGJ,KAAK;EAClF,MAAMK,MAAM,GAAGT,iBAAA,CAAAU,KAAK,CAAC,SAAS,CAAC;EAE/B,MAAM;IAAEC,IAAI,GAAG,aAAa;IAAEC,QAAQ;IAAE,GAAGC;EAAI,CAAE,GAAGT,KAAK;EACzD,MAAMU,UAAU,GAAGd,iBAAA,CAAAe,qBAAqB,CAAC,KAAK,EAAE;IAAEV,GAAG;IAAEM,IAAI;IAAE,GAAGE;EAAI,CAAE,EAAE,CAAC,MAAM,CAAC,CAAC;EAEjF,MAAMG,cAAc,GAAGhB,iBAAA,CAAAiB,gBAAgB,CAACb,KAAK,CAACc,KAAK,EAAE;IACnDC,YAAY,EAAE;MACZC,EAAE,EAAEX;KACL;IACDY,QAAQ,EAAE;GACX,CAAC;EAEF,MAAMC,gBAAgB,GAAGtB,iBAAA,CAAAiB,gBAAgB,CAACb,KAAK,CAACmB,OAAO,EAAE;IACvDF,QAAQ,EAAE,IAAI;IACdF,YAAY,EAAE;MACZK,QAAQ,EAAE1B,KAAA,CAAA2B,aAAA,CAACvB,YAAA,CAAAwB,UAAU,OAAG;MACxBd;;GAEH,CAAC;EAEF,IAAII,cAAc,IAAIF,UAAU,IAAI,CAACA,UAAU,CAAC,iBAAiB,CAAC,EAAE;IAClEA,UAAU,CAAC,iBAAiB,CAAC,GAAGE,cAAc,CAACI,EAAE;;EAGnD,MAAMO,KAAK,GAAiB;IAC1BrB,UAAU;IACVC,aAAa;IACbC,IAAI;IACJoB,UAAU,EAAE;MACVC,IAAI,EAAE,KAAK;MACXN,OAAO,EAAE,MAAM;MACfL,KAAK,EAAEjB,aAAA,CAAA6B;KACR;IACDD,IAAI,EAAEf,UAAU;IAChBS,OAAO,EAAED,gBAAgB;IACzBJ,KAAK,EAAEF;GACR;EACD,OAAOW,KAAK;AACd,CAAC;AAzCYI,OAAA,CAAA5B,mBAAmB,GAAAA,mBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Spinner/useSpinner.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { Label } from '@fluentui/react-label';\nimport { DefaultSvg } from './DefaultSvg';\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, ref) => {\n // Props\n const {\n appearance = 'primary',\n labelPosition = 'after',\n size = 'medium'\n } = props;\n const baseId = useId('spinner');\n const {\n role = 'progressbar',\n tabIndex,\n ...rest\n } = props;\n const nativeRoot = getNativeElementProps('div', {\n ref,\n role,\n ...rest\n }, ['size']);\n const labelShorthand = resolveShorthand(props.label, {\n defaultProps: {\n id: baseId\n },\n required: false\n });\n const spinnerShortHand = resolveShorthand(props.spinner, {\n required: true,\n defaultProps: {\n children: /*#__PURE__*/React.createElement(DefaultSvg, null),\n tabIndex\n }\n });\n if (labelShorthand && nativeRoot && !nativeRoot['aria-labelledby']) {\n nativeRoot['aria-labelledby'] = labelShorthand.id;\n }\n const state = {\n appearance,\n labelPosition,\n size,\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//# sourceMappingURL=useSpinner.js.map"],"names":["useSpinner_unstable","props","ref","appearance","labelPosition","size","baseId","useId","role","tabIndex","rest","nativeRoot","getNativeElementProps","labelShorthand","resolveShorthand","label","defaultProps","id","required","spinnerShortHand","spinner","children","React","createElement","DefaultSvg","state","components","root","Label"],"mappings":";;;;+BAaaA;;aAAAA;;;6DAbU;gCACwC;4BACzC;4BACK;AAUpB,MAAMA,sBAAsB,CAACC,OAAOC,MAAQ;IACjD,QAAQ;IACR,MAAM,EACJC,YAAa,UAAS,EACtBC,eAAgB,QAAO,EACvBC,MAAO,SAAQ,EAChB,GAAGJ;IACJ,MAAMK,SAASC,IAAAA,qBAAK,EAAC;IACrB,MAAM,EACJC,MAAO,cAAa,EACpBC,SAAQ,EACR,GAAGC,MACJ,GAAGT;IACJ,MAAMU,aAAaC,IAAAA,qCAAqB,EAAC,OAAO;QAC9CV;QACAM;QACA,GAAGE,IAAI;IACT,GAAG;QAAC;KAAO;IACX,MAAMG,iBAAiBC,IAAAA,gCAAgB,EAACb,MAAMc,KAAK,EAAE;QACnDC,cAAc;YACZC,IAAIX;QACN;QACAY,UAAU,KAAK;IACjB;IACA,MAAMC,mBAAmBL,IAAAA,gCAAgB,EAACb,MAAMmB,OAAO,EAAE;QACvDF,UAAU,IAAI;QACdF,cAAc;YACZK,UAAU,WAAW,GAAEC,OAAMC,aAAa,CAACC,sBAAU,EAAE,IAAI;YAC3Df;QACF;IACF;IACA,IAAII,kBAAkBF,cAAc,CAACA,UAAU,CAAC,kBAAkB,EAAE;QAClEA,UAAU,CAAC,kBAAkB,GAAGE,eAAeI,EAAE;IACnD,CAAC;IACD,MAAMQ,QAAQ;QACZtB;QACAC;QACAC;QACAqB,YAAY;YACVC,MAAM;YACNP,SAAS;YACTL,OAAOa,iBAAK;QACd;QACAD,MAAMhB;QACNS,SAASD;QACTJ,OAAOF;IACT;IACA,OAAOY;AACT,GACA,sCAAsC"}