@fluentui/react-progress 9.1.7 → 9.1.8
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +30 -3
- package/CHANGELOG.md +15 -4
- package/lib/components/ProgressBar/useProgressBar.js +9 -2
- package/lib/components/ProgressBar/useProgressBar.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/useProgressBar.js +13 -2
- package/lib-commonjs/components/ProgressBar/useProgressBar.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,34 @@
|
|
2
2
|
"name": "@fluentui/react-progress",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Thu, 06 Apr 2023 23:59:49 GMT",
|
6
|
+
"tag": "@fluentui/react-progress_v9.1.8",
|
7
|
+
"version": "9.1.8",
|
8
|
+
"comments": {
|
9
|
+
"patch": [
|
10
|
+
{
|
11
|
+
"author": "behowell@microsoft.com",
|
12
|
+
"package": "@fluentui/react-progress",
|
13
|
+
"commit": "eee5716e76dc6a5bef9316546a352694bbe5750a",
|
14
|
+
"comment": "chore: Update package version of react-field"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "behowell@microsoft.com",
|
18
|
+
"package": "@fluentui/react-progress",
|
19
|
+
"commit": "5a8d7a29645b3b500eb7145d2e42ac34fcafc4c6",
|
20
|
+
"comment": "chore: Hook up FieldContext for use inside a Field"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "beachball",
|
24
|
+
"package": "@fluentui/react-progress",
|
25
|
+
"comment": "Bump @fluentui/react-field to v9.0.0-beta.1",
|
26
|
+
"commit": "7a46cab3d31a233b89b7188e994b24712af5393c"
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"date": "Tue, 04 Apr 2023 18:44:50 GMT",
|
6
33
|
"tag": "@fluentui/react-progress_v9.1.7",
|
7
34
|
"version": "9.1.7",
|
8
35
|
"comments": {
|
@@ -11,13 +38,13 @@
|
|
11
38
|
"author": "beachball",
|
12
39
|
"package": "@fluentui/react-progress",
|
13
40
|
"comment": "Bump @fluentui/react-field to v9.0.0-alpha.29",
|
14
|
-
"commit": "
|
41
|
+
"commit": "6778d76bbbad7e1975c151c797f28c2708cde2ce"
|
15
42
|
},
|
16
43
|
{
|
17
44
|
"author": "beachball",
|
18
45
|
"package": "@fluentui/react-progress",
|
19
46
|
"comment": "Bump @fluentui/react-utilities to v9.7.3",
|
20
|
-
"commit": "
|
47
|
+
"commit": "6778d76bbbad7e1975c151c797f28c2708cde2ce"
|
21
48
|
}
|
22
49
|
]
|
23
50
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,18 +1,29 @@
|
|
1
1
|
# Change Log - @fluentui/react-progress
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Thu, 06 Apr 2023 23:59:49 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.1.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.1.8)
|
8
|
+
|
9
|
+
Thu, 06 Apr 2023 23:59:49 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.1.7..@fluentui/react-progress_v9.1.8)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- chore: Update package version of react-field ([PR #27458](https://github.com/microsoft/fluentui/pull/27458) by behowell@microsoft.com)
|
15
|
+
- chore: Hook up FieldContext for use inside a Field ([PR #27399](https://github.com/microsoft/fluentui/pull/27399) by behowell@microsoft.com)
|
16
|
+
- Bump @fluentui/react-field to v9.0.0-beta.1 ([PR #27420](https://github.com/microsoft/fluentui/pull/27420) by beachball)
|
17
|
+
|
7
18
|
## [9.1.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.1.7)
|
8
19
|
|
9
|
-
Tue, 04 Apr 2023 18:
|
20
|
+
Tue, 04 Apr 2023 18:44:50 GMT
|
10
21
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.1.5..@fluentui/react-progress_v9.1.7)
|
11
22
|
|
12
23
|
### Patches
|
13
24
|
|
14
|
-
- Bump @fluentui/react-field to v9.0.0-alpha.29 ([PR #
|
15
|
-
- Bump @fluentui/react-utilities to v9.7.3 ([PR #
|
25
|
+
- Bump @fluentui/react-field to v9.0.0-alpha.29 ([PR #27434](https://github.com/microsoft/fluentui/pull/27434) by beachball)
|
26
|
+
- Bump @fluentui/react-utilities to v9.7.3 ([PR #27434](https://github.com/microsoft/fluentui/pull/27434) by beachball)
|
16
27
|
|
17
28
|
## [9.1.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.1.5)
|
18
29
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
+
import { useFieldContext_unstable } from '@fluentui/react-field';
|
2
3
|
import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
|
3
4
|
import { clampValue, clampMax } from '../../utils/index';
|
4
5
|
/**
|
@@ -11,9 +12,10 @@ import { clampValue, clampMax } from '../../utils/index';
|
|
11
12
|
* @param ref - reference to root HTMLElement of ProgressBar
|
12
13
|
*/
|
13
14
|
export const useProgressBar_unstable = (props, ref) => {
|
14
|
-
|
15
|
+
const field = useFieldContext_unstable();
|
16
|
+
const fieldState = field === null || field === void 0 ? void 0 : field.validationState;
|
15
17
|
const {
|
16
|
-
color = 'brand',
|
18
|
+
color = fieldState === 'error' || fieldState === 'warning' || fieldState === 'success' ? fieldState : 'brand',
|
17
19
|
shape = 'rounded',
|
18
20
|
thickness = 'medium'
|
19
21
|
} = props;
|
@@ -26,8 +28,13 @@ export const useProgressBar_unstable = (props, ref) => {
|
|
26
28
|
'aria-valuemin': value !== undefined ? 0 : undefined,
|
27
29
|
'aria-valuemax': value !== undefined ? max : undefined,
|
28
30
|
'aria-valuenow': value,
|
31
|
+
'aria-labelledby': field === null || field === void 0 ? void 0 : field.labelId,
|
29
32
|
...props
|
30
33
|
});
|
34
|
+
if (field && (field.validationMessageId || field.hintId)) {
|
35
|
+
// Prepend the field's validation message and/or hint to the user's aria-describedby
|
36
|
+
root['aria-describedby'] = [field === null || field === void 0 ? void 0 : field.validationMessageId, field === null || field === void 0 ? void 0 : field.hintId, root['aria-describedby']].filter(Boolean).join(' ');
|
37
|
+
}
|
31
38
|
const bar = resolveShorthand(props.bar, {
|
32
39
|
required: true
|
33
40
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","getNativeElementProps","resolveShorthand","clampValue","clampMax","useProgressBar_unstable","props","ref","color","shape","thickness","_props_max","max","value","root","role","undefined","bar","required","state","components"],"sources":["../../../src/components/ProgressBar/useProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { clampValue, clampMax } from '../../utils/index';\nimport type { ProgressBarProps, ProgressBarState } from './ProgressBar.types';\n\n/**\n * Create the state required to render ProgressBar.\n *\n * The returned state can be modified with hooks such as useProgressBarStyles_unstable,\n * before being passed to renderProgressBar_unstable.\n *\n * @param props - props from this instance of ProgressBar\n * @param ref - reference to root HTMLElement of ProgressBar\n */\nexport const useProgressBar_unstable = (props: ProgressBarProps, ref: React.Ref<HTMLElement>): ProgressBarState => {\n
|
1
|
+
{"version":3,"names":["React","useFieldContext_unstable","getNativeElementProps","resolveShorthand","clampValue","clampMax","useProgressBar_unstable","props","ref","field","fieldState","validationState","color","shape","thickness","_props_max","max","value","root","role","undefined","labelId","validationMessageId","hintId","filter","Boolean","join","bar","required","state","components"],"sources":["../../../src/components/ProgressBar/useProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useFieldContext_unstable } from '@fluentui/react-field';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { clampValue, clampMax } from '../../utils/index';\nimport type { ProgressBarProps, ProgressBarState } from './ProgressBar.types';\n\n/**\n * Create the state required to render ProgressBar.\n *\n * The returned state can be modified with hooks such as useProgressBarStyles_unstable,\n * before being passed to renderProgressBar_unstable.\n *\n * @param props - props from this instance of ProgressBar\n * @param ref - reference to root HTMLElement of ProgressBar\n */\nexport const useProgressBar_unstable = (props: ProgressBarProps, ref: React.Ref<HTMLElement>): ProgressBarState => {\n const field = useFieldContext_unstable();\n const fieldState = field?.validationState;\n\n const {\n color = fieldState === 'error' || fieldState === 'warning' || fieldState === 'success' ? fieldState : 'brand',\n shape = 'rounded',\n thickness = 'medium',\n } = props;\n const max = clampMax(props.max ?? 1);\n const value = clampValue(props.value, max);\n\n const root = getNativeElementProps('div', {\n ref,\n role: 'progressbar',\n 'aria-valuemin': value !== undefined ? 0 : undefined,\n 'aria-valuemax': value !== undefined ? max : undefined,\n 'aria-valuenow': value,\n 'aria-labelledby': field?.labelId,\n ...props,\n });\n\n if (field && (field.validationMessageId || field.hintId)) {\n // Prepend the field's validation message and/or hint to the user's aria-describedby\n root['aria-describedby'] = [field?.validationMessageId, field?.hintId, root['aria-describedby']]\n .filter(Boolean)\n .join(' ');\n }\n\n const bar = resolveShorthand(props.bar, {\n required: true,\n });\n\n const state: ProgressBarState = {\n color,\n max,\n shape,\n thickness,\n value,\n components: {\n root: 'div',\n bar: 'div',\n },\n root,\n bar,\n };\n\n return state;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,wBAAwB,QAAQ;AACzC,SAASC,qBAAqB,EAAEC,gBAAgB,QAAQ;AACxD,SAASC,UAAU,EAAEC,QAAQ,QAAQ;AAGrC;;;;;;;;;AASA,OAAO,MAAMC,uBAAA,GAA0BA,CAACC,KAAA,EAAyBC,GAAA,KAAkD;EACjH,MAAMC,KAAA,GAAQR,wBAAA;EACd,MAAMS,UAAA,GAAaD,KAAA,aAAAA,KAAA,uBAAAA,KAAA,CAAOE,eAAe;EAEzC,MAAM;IACJC,KAAA,GAAQF,UAAA,KAAe,WAAWA,UAAA,KAAe,aAAaA,UAAA,KAAe,YAAYA,UAAA,GAAa,OAAO;IAC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8
|
});
|
9
9
|
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
10
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
11
|
+
const _reactField = require("@fluentui/react-field");
|
11
12
|
const _reactUtilities = require("@fluentui/react-utilities");
|
12
13
|
const _index = require("../../utils/index");
|
13
14
|
const useProgressBar_unstable = (props, ref)=>{
|
14
|
-
|
15
|
-
const
|
15
|
+
const field = (0, _reactField.useFieldContext_unstable)();
|
16
|
+
const fieldState = field === null || field === void 0 ? void 0 : field.validationState;
|
17
|
+
const { color =fieldState === 'error' || fieldState === 'warning' || fieldState === 'success' ? fieldState : 'brand' , shape ='rounded' , thickness ='medium' } = props;
|
16
18
|
var _props_max;
|
17
19
|
const max = (0, _index.clampMax)((_props_max = props.max) !== null && _props_max !== void 0 ? _props_max : 1);
|
18
20
|
const value = (0, _index.clampValue)(props.value, max);
|
@@ -22,8 +24,17 @@ const useProgressBar_unstable = (props, ref)=>{
|
|
22
24
|
'aria-valuemin': value !== undefined ? 0 : undefined,
|
23
25
|
'aria-valuemax': value !== undefined ? max : undefined,
|
24
26
|
'aria-valuenow': value,
|
27
|
+
'aria-labelledby': field === null || field === void 0 ? void 0 : field.labelId,
|
25
28
|
...props
|
26
29
|
});
|
30
|
+
if (field && (field.validationMessageId || field.hintId)) {
|
31
|
+
// Prepend the field's validation message and/or hint to the user's aria-describedby
|
32
|
+
root['aria-describedby'] = [
|
33
|
+
field === null || field === void 0 ? void 0 : field.validationMessageId,
|
34
|
+
field === null || field === void 0 ? void 0 : field.hintId,
|
35
|
+
root['aria-describedby']
|
36
|
+
].filter(Boolean).join(' ');
|
37
|
+
}
|
27
38
|
const bar = (0, _reactUtilities.resolveShorthand)(props.bar, {
|
28
39
|
required: true
|
29
40
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/ProgressBar/useProgressBar.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { clampValue, clampMax } from '../../utils/index';\n/**\n * Create the state required to render ProgressBar.\n *\n * The returned state can be modified with hooks such as useProgressBarStyles_unstable,\n * before being passed to renderProgressBar_unstable.\n *\n * @param props - props from this instance of ProgressBar\n * @param ref - reference to root HTMLElement of ProgressBar\n */\nexport const useProgressBar_unstable = (props, ref) => {\n
|
1
|
+
{"version":3,"sources":["../../../lib/components/ProgressBar/useProgressBar.js"],"sourcesContent":["import * as React from 'react';\nimport { useFieldContext_unstable } from '@fluentui/react-field';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { clampValue, clampMax } from '../../utils/index';\n/**\n * Create the state required to render ProgressBar.\n *\n * The returned state can be modified with hooks such as useProgressBarStyles_unstable,\n * before being passed to renderProgressBar_unstable.\n *\n * @param props - props from this instance of ProgressBar\n * @param ref - reference to root HTMLElement of ProgressBar\n */\nexport const useProgressBar_unstable = (props, ref) => {\n const field = useFieldContext_unstable();\n const fieldState = field === null || field === void 0 ? void 0 : field.validationState;\n const {\n color = fieldState === 'error' || fieldState === 'warning' || fieldState === 'success' ? fieldState : 'brand',\n shape = 'rounded',\n thickness = 'medium'\n } = props;\n var _props_max;\n const max = clampMax((_props_max = props.max) !== null && _props_max !== void 0 ? _props_max : 1);\n const value = clampValue(props.value, max);\n const root = getNativeElementProps('div', {\n ref,\n role: 'progressbar',\n 'aria-valuemin': value !== undefined ? 0 : undefined,\n 'aria-valuemax': value !== undefined ? max : undefined,\n 'aria-valuenow': value,\n 'aria-labelledby': field === null || field === void 0 ? void 0 : field.labelId,\n ...props\n });\n if (field && (field.validationMessageId || field.hintId)) {\n // Prepend the field's validation message and/or hint to the user's aria-describedby\n root['aria-describedby'] = [field === null || field === void 0 ? void 0 : field.validationMessageId, field === null || field === void 0 ? void 0 : field.hintId, root['aria-describedby']].filter(Boolean).join(' ');\n }\n const bar = resolveShorthand(props.bar, {\n required: true\n });\n const state = {\n color,\n max,\n shape,\n thickness,\n value,\n components: {\n root: 'div',\n bar: 'div'\n },\n root,\n bar\n };\n return state;\n};\n//# sourceMappingURL=useProgressBar.js.map"],"names":["useProgressBar_unstable","props","ref","field","useFieldContext_unstable","fieldState","validationState","color","shape","thickness","_props_max","max","clampMax","value","clampValue","root","getNativeElementProps","role","undefined","labelId","validationMessageId","hintId","filter","Boolean","join","bar","resolveShorthand","required","state","components"],"mappings":";;;;+BAaaA;;aAAAA;;;6DAbU;4BACkB;gCACe;uBACnB;AAU9B,MAAMA,0BAA0B,CAACC,OAAOC,MAAQ;IACrD,MAAMC,QAAQC,IAAAA,oCAAwB;IACtC,MAAMC,aAAaF,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMG,eAAe;IACtF,MAAM,EACJC,OAAQF,eAAe,WAAWA,eAAe,aAAaA,eAAe,YAAYA,aAAa,OAAO,CAAA,EAC7GG,OAAQ,UAAS,EACjBC,WAAY,SAAQ,EACrB,GAAGR;IACJ,IAAIS;IACJ,MAAMC,MAAMC,IAAAA,eAAQ,EAAC,AAACF,CAAAA,aAAaT,MAAMU,GAAG,AAAD,MAAO,IAAI,IAAID,eAAe,KAAK,IAAIA,aAAa,CAAC;IAChG,MAAMG,QAAQC,IAAAA,iBAAU,EAACb,MAAMY,KAAK,EAAEF;IACtC,MAAMI,OAAOC,IAAAA,qCAAqB,EAAC,OAAO;QACxCd;QACAe,MAAM;QACN,iBAAiBJ,UAAUK,YAAY,IAAIA,SAAS;QACpD,iBAAiBL,UAAUK,YAAYP,MAAMO,SAAS;QACtD,iBAAiBL;QACjB,mBAAmBV,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMgB,OAAO;QAC9E,GAAGlB,KAAK;IACV;IACA,IAAIE,SAAUA,CAAAA,MAAMiB,mBAAmB,IAAIjB,MAAMkB,MAAM,AAAD,GAAI;QACxD,oFAAoF;QACpFN,IAAI,CAAC,mBAAmB,GAAG;YAACZ,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMiB,mBAAmB;YAAEjB,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMkB,MAAM;YAAEN,IAAI,CAAC,mBAAmB;SAAC,CAACO,MAAM,CAACC,SAASC,IAAI,CAAC;IAClN,CAAC;IACD,MAAMC,MAAMC,IAAAA,gCAAgB,EAACzB,MAAMwB,GAAG,EAAE;QACtCE,UAAU,IAAI;IAChB;IACA,MAAMC,QAAQ;QACZrB;QACAI;QACAH;QACAC;QACAI;QACAgB,YAAY;YACVd,MAAM;YACNU,KAAK;QACP;QACAV;QACAU;IACF;IACA,OAAOG;AACT,GACA,0CAA0C"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-progress",
|
3
|
-
"version": "9.1.
|
3
|
+
"version": "9.1.8",
|
4
4
|
"description": "Progress component for FluentUI v9",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -32,7 +32,7 @@
|
|
32
32
|
"@fluentui/scripts-tasks": "*"
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
|
-
"@fluentui/react-field": "9.0.0-
|
35
|
+
"@fluentui/react-field": "9.0.0-beta.1",
|
36
36
|
"@fluentui/react-shared-contexts": "^9.3.3",
|
37
37
|
"@fluentui/react-theme": "^9.1.7",
|
38
38
|
"@fluentui/react-utilities": "^9.7.3",
|