@fluentui/react-spinner 9.1.3 → 9.1.5
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/.swcrc +30 -0
- package/CHANGELOG.json +73 -1
- package/CHANGELOG.md +27 -2
- package/lib/Spinner.js.map +1 -1
- package/lib/components/Spinner/DefaultSvg.js.map +1 -1
- package/lib/components/Spinner/Spinner.js.map +1 -1
- package/lib/components/Spinner/Spinner.types.js.map +1 -1
- package/lib/components/Spinner/index.js.map +1 -1
- package/lib/components/Spinner/renderSpinner.js +1 -9
- package/lib/components/Spinner/renderSpinner.js.map +1 -1
- package/lib/components/Spinner/useSpinner.js.map +1 -1
- package/lib/components/Spinner/useSpinnerStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Spinner.js +5 -4
- package/lib-commonjs/Spinner.js.map +1 -1
- package/lib-commonjs/components/Spinner/DefaultSvg.js +15 -12
- package/lib-commonjs/components/Spinner/DefaultSvg.js.map +1 -1
- package/lib-commonjs/components/Spinner/Spinner.js +19 -20
- package/lib-commonjs/components/Spinner/Spinner.js.map +1 -1
- package/lib-commonjs/components/Spinner/Spinner.types.js +3 -2
- package/lib-commonjs/components/Spinner/Spinner.types.js.map +1 -1
- package/lib-commonjs/components/Spinner/index.js +9 -8
- package/lib-commonjs/components/Spinner/index.js.map +1 -1
- package/lib-commonjs/components/Spinner/renderSpinner.js +14 -27
- package/lib-commonjs/components/Spinner/renderSpinner.js.map +1 -1
- package/lib-commonjs/components/Spinner/useSpinner.js +53 -65
- package/lib-commonjs/components/Spinner/useSpinner.js.map +1 -1
- package/lib-commonjs/components/Spinner/useSpinnerStyles.js +351 -233
- package/lib-commonjs/components/Spinner/useSpinnerStyles.js.map +1 -1
- package/lib-commonjs/index.js +16 -33
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +9 -8
- package/lib-amd/Spinner.js +0 -6
- package/lib-amd/Spinner.js.map +0 -1
- package/lib-amd/components/Spinner/DefaultSvg.js +0 -10
- package/lib-amd/components/Spinner/DefaultSvg.js.map +0 -1
- package/lib-amd/components/Spinner/Spinner.js +0 -17
- package/lib-amd/components/Spinner/Spinner.js.map +0 -1
- package/lib-amd/components/Spinner/Spinner.types.js +0 -5
- package/lib-amd/components/Spinner/Spinner.types.js.map +0 -1
- package/lib-amd/components/Spinner/index.js +0 -10
- package/lib-amd/components/Spinner/index.js.map +0 -1
- package/lib-amd/components/Spinner/renderSpinner.js +0 -18
- package/lib-amd/components/Spinner/renderSpinner.js.map +0 -1
- package/lib-amd/components/Spinner/useSpinner.js +0 -53
- package/lib-amd/components/Spinner/useSpinner.js.map +0 -1
- package/lib-amd/components/Spinner/useSpinnerStyles.js +0 -256
- package/lib-amd/components/Spinner/useSpinnerStyles.js.map +0 -1
- package/lib-amd/index.js +0 -11
- package/lib-amd/index.js.map +0 -1
|
@@ -1,70 +1,58 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useSpinner_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>useSpinner_unstable
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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,"
|
|
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"}
|