@fluentui/react-progress 0.0.0-nightly-20230403-0420.1 → 0.0.0-nightly-20230405-0421.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-progress",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 03 Apr 2023 04:26:39 GMT",
6
- "tag": "@fluentui/react-progress_v0.0.0-nightly-20230403-0420.1",
7
- "version": "0.0.0-nightly-20230403-0420.1",
5
+ "date": "Wed, 05 Apr 2023 04:27:58 GMT",
6
+ "tag": "@fluentui/react-progress_v0.0.0-nightly-20230405-0421.1",
7
+ "version": "0.0.0-nightly-20230405-0421.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
@@ -16,32 +16,53 @@
16
16
  {
17
17
  "author": "beachball",
18
18
  "package": "@fluentui/react-progress",
19
- "comment": "Bump @fluentui/react-field to v0.0.0-nightly-20230403-0420.1",
20
- "commit": "bd1390ac04455f62e70e92c4103d286fc362dc72"
19
+ "comment": "Bump @fluentui/react-field to v0.0.0-nightly-20230405-0421.1",
20
+ "commit": "b363f61416aba5861d265582db62040b5dced850"
21
21
  },
22
22
  {
23
23
  "author": "beachball",
24
24
  "package": "@fluentui/react-progress",
25
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230403-0420.1",
26
- "commit": "bd1390ac04455f62e70e92c4103d286fc362dc72"
25
+ "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230405-0421.1",
26
+ "commit": "b363f61416aba5861d265582db62040b5dced850"
27
27
  },
28
28
  {
29
29
  "author": "beachball",
30
30
  "package": "@fluentui/react-progress",
31
- "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230403-0420.1",
32
- "commit": "bd1390ac04455f62e70e92c4103d286fc362dc72"
31
+ "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230405-0421.1",
32
+ "commit": "b363f61416aba5861d265582db62040b5dced850"
33
33
  },
34
34
  {
35
35
  "author": "beachball",
36
36
  "package": "@fluentui/react-progress",
37
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230403-0420.1",
38
- "commit": "bd1390ac04455f62e70e92c4103d286fc362dc72"
37
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230405-0421.1",
38
+ "commit": "b363f61416aba5861d265582db62040b5dced850"
39
39
  },
40
40
  {
41
41
  "author": "beachball",
42
42
  "package": "@fluentui/react-progress",
43
- "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230403-0420.1",
44
- "commit": "bd1390ac04455f62e70e92c4103d286fc362dc72"
43
+ "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230405-0421.1",
44
+ "commit": "b363f61416aba5861d265582db62040b5dced850"
45
+ }
46
+ ]
47
+ }
48
+ },
49
+ {
50
+ "date": "Tue, 04 Apr 2023 18:44:50 GMT",
51
+ "tag": "@fluentui/react-progress_v9.1.7",
52
+ "version": "9.1.7",
53
+ "comments": {
54
+ "patch": [
55
+ {
56
+ "author": "beachball",
57
+ "package": "@fluentui/react-progress",
58
+ "comment": "Bump @fluentui/react-field to v9.0.0-alpha.29",
59
+ "commit": "6778d76bbbad7e1975c151c797f28c2708cde2ce"
60
+ },
61
+ {
62
+ "author": "beachball",
63
+ "package": "@fluentui/react-progress",
64
+ "comment": "Bump @fluentui/react-utilities to v9.7.3",
65
+ "commit": "6778d76bbbad7e1975c151c797f28c2708cde2ce"
45
66
  }
46
67
  ]
47
68
  }
package/CHANGELOG.md CHANGED
@@ -1,22 +1,32 @@
1
1
  # Change Log - @fluentui/react-progress
2
2
 
3
- This log was last generated on Mon, 03 Apr 2023 04:26:39 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 05 Apr 2023 04:27:58 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20230403-0420.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v0.0.0-nightly-20230403-0420.1)
7
+ ## [0.0.0-nightly-20230405-0421.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v0.0.0-nightly-20230405-0421.1)
8
8
 
9
- Mon, 03 Apr 2023 04:26:39 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.1.5..@fluentui/react-progress_v0.0.0-nightly-20230403-0420.1)
9
+ Wed, 05 Apr 2023 04:27:58 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.1.7..@fluentui/react-progress_v0.0.0-nightly-20230405-0421.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-field to v0.0.0-nightly-20230403-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/bd1390ac04455f62e70e92c4103d286fc362dc72) by beachball)
16
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230403-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/bd1390ac04455f62e70e92c4103d286fc362dc72) by beachball)
17
- - Bump @fluentui/react-theme to v0.0.0-nightly-20230403-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/bd1390ac04455f62e70e92c4103d286fc362dc72) by beachball)
18
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20230403-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/bd1390ac04455f62e70e92c4103d286fc362dc72) by beachball)
19
- - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230403-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/bd1390ac04455f62e70e92c4103d286fc362dc72) by beachball)
15
+ - Bump @fluentui/react-field to v0.0.0-nightly-20230405-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/b363f61416aba5861d265582db62040b5dced850) by beachball)
16
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230405-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/b363f61416aba5861d265582db62040b5dced850) by beachball)
17
+ - Bump @fluentui/react-theme to v0.0.0-nightly-20230405-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/b363f61416aba5861d265582db62040b5dced850) by beachball)
18
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20230405-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/b363f61416aba5861d265582db62040b5dced850) by beachball)
19
+ - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230405-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/b363f61416aba5861d265582db62040b5dced850) by beachball)
20
+
21
+ ## [9.1.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.1.7)
22
+
23
+ Tue, 04 Apr 2023 18:44:50 GMT
24
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.1.5..@fluentui/react-progress_v9.1.7)
25
+
26
+ ### Patches
27
+
28
+ - Bump @fluentui/react-field to v9.0.0-alpha.29 ([PR #27434](https://github.com/microsoft/fluentui/pull/27434) by beachball)
29
+ - Bump @fluentui/react-utilities to v9.7.3 ([PR #27434](https://github.com/microsoft/fluentui/pull/27434) by beachball)
20
30
 
21
31
  ## [9.1.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.1.5)
22
32
 
@@ -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
- // Props
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 // Props\n const { color = 'brand', shape = 'rounded', thickness = 'medium' } = 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 ...props,\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,qBAAqB,EAAEC,gBAAgB,QAAQ;AACxD,SAASC,UAAU,EAAEC,QAAQ,QAAQ;AAGrC;;;;;;;;;AASA,OAAO,MAAMC,uBAAA,GAA0BA,CAACC,KAAA,EAAyBC,GAAA,KAAkD;EACjH;EACA,MAAM;IAAEC,KAAA,GAAQ;IAASC,KAAA,GAAQ;IAAWC,SAAA,GAAY;EAAQ,CAAE,GAAGJ,KAAA;MAChDK,UAAA;EAArB,MAAMC,GAAA,GAAMR,QAAA,CAAS,CAAAO,UAAA,GAAAL,KAAA,CAAMM,GAAG,cAATD,UAAA,cAAAA,UAAA,GAAa,CAAC;EACnC,MAAME,KAAA,GAAQV,UAAA,CAAWG,KAAA,CAAMO,KAAK,EAAED,GAAA;EAEtC,MAAME,IAAA,GAAOb,qBAAA,CAAsB,OAAO;IACxCM,GAAA;IACAQ,IAAA,EAAM;IACN,iBAAiBF,KAAA,KAAUG,SAAA,GAAY,IAAIA,SAAS;IACpD,iBAAiBH,KAAA,KAAUG,SAAA,GAAYJ,GAAA,GAAMI,SAAS;IACtD,iBAAiBH,KAAA;IACjB,GAAGP;EACL;EAEA,MAAMW,GAAA,GAAMf,gBAAA,CAAiBI,KAAA,CAAMW,GAAG,EAAE;IACtCC,QAAA,EAAU;EACZ;EAEA,MAAMC,KAAA,GAA0B;IAC9BX,KAAA;IACAI,GAAA;IACAH,KAAA;IACAC,SAAA;IACAG,KAAA;IACAO,UAAA,EAAY;MACVN,IAAA,EAAM;MACNG,GAAA,EAAK;IACP;IACAH,IAAA;IACAG;EACF;EAEA,OAAOE,KAAA;AACT"}
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;IAC7GG,KAAA,GAAQ;IACRC,SAAA,GAAY;EAAQ,CACrB,GAAGP,KAAA;MACiBQ,UAAA;EAArB,MAAMC,GAAA,GAAMX,QAAA,CAAS,CAAAU,UAAA,GAAAR,KAAA,CAAMS,GAAG,cAATD,UAAA,cAAAA,UAAA,GAAa,CAAC;EACnC,MAAME,KAAA,GAAQb,UAAA,CAAWG,KAAA,CAAMU,KAAK,EAAED,GAAA;EAEtC,MAAME,IAAA,GAAOhB,qBAAA,CAAsB,OAAO;IACxCM,GAAA;IACAW,IAAA,EAAM;IACN,iBAAiBF,KAAA,KAAUG,SAAA,GAAY,IAAIA,SAAS;IACpD,iBAAiBH,KAAA,KAAUG,SAAA,GAAYJ,GAAA,GAAMI,SAAS;IACtD,iBAAiBH,KAAA;IACjB,mBAAmBR,KAAA,aAAAA,KAAA,uBAAAA,KAAA,CAAOY,OAAO;IACjC,GAAGd;EACL;EAEA,IAAIE,KAAA,KAAUA,KAAA,CAAMa,mBAAmB,IAAIb,KAAA,CAAMc,MAAM,CAAD,EAAI;IACxD;IACAL,IAAI,CAAC,mBAAmB,GAAG,CAACT,KAAA,aAAAA,KAAA,uBAAAA,KAAA,CAAOa,mBAAmB,EAAEb,KAAA,aAAAA,KAAA,uBAAAA,KAAA,CAAOc,MAAM,EAAEL,IAAI,CAAC,mBAAmB,CAAC,CAC7FM,MAAM,CAACC,OAAA,EACPC,IAAI,CAAC;EACV;EAEA,MAAMC,GAAA,GAAMxB,gBAAA,CAAiBI,KAAA,CAAMoB,GAAG,EAAE;IACtCC,QAAA,EAAU;EACZ;EAEA,MAAMC,KAAA,GAA0B;IAC9BjB,KAAA;IACAI,GAAA;IACAH,KAAA;IACAC,SAAA;IACAG,KAAA;IACAa,UAAA,EAAY;MACVZ,IAAA,EAAM;MACNS,GAAA,EAAK;IACP;IACAT,IAAA;IACAS;EACF;EAEA,OAAOE,KAAA;AACT"}
@@ -8,11 +8,13 @@ Object.defineProperty(exports, "useProgressBar_unstable", {
8
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
- // Props
15
- const { color ='brand' , shape ='rounded' , thickness ='medium' } = props;
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 // Props\n const {\n color = '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 ...props\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","color","shape","thickness","_props_max","max","clampMax","value","clampValue","root","getNativeElementProps","role","undefined","bar","resolveShorthand","required","state","components"],"mappings":";;;;+BAYaA;;aAAAA;;;6DAZU;gCACiC;uBACnB;AAU9B,MAAMA,0BAA0B,CAACC,OAAOC,MAAQ;IACrD,QAAQ;IACR,MAAM,EACJC,OAAQ,QAAO,EACfC,OAAQ,UAAS,EACjBC,WAAY,SAAQ,EACrB,GAAGJ;IACJ,IAAIK;IACJ,MAAMC,MAAMC,IAAAA,eAAQ,EAAC,AAACF,CAAAA,aAAaL,MAAMM,GAAG,AAAD,MAAO,IAAI,IAAID,eAAe,KAAK,IAAIA,aAAa,CAAC;IAChG,MAAMG,QAAQC,IAAAA,iBAAU,EAACT,MAAMQ,KAAK,EAAEF;IACtC,MAAMI,OAAOC,IAAAA,qCAAqB,EAAC,OAAO;QACxCV;QACAW,MAAM;QACN,iBAAiBJ,UAAUK,YAAY,IAAIA,SAAS;QACpD,iBAAiBL,UAAUK,YAAYP,MAAMO,SAAS;QACtD,iBAAiBL;QACjB,GAAGR,KAAK;IACV;IACA,MAAMc,MAAMC,IAAAA,gCAAgB,EAACf,MAAMc,GAAG,EAAE;QACtCE,UAAU,IAAI;IAChB;IACA,MAAMC,QAAQ;QACZf;QACAI;QACAH;QACAC;QACAI;QACAU,YAAY;YACVR,MAAM;YACNI,KAAK;QACP;QACAJ;QACAI;IACF;IACA,OAAOG;AACT,GACA,0CAA0C"}
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": "0.0.0-nightly-20230403-0420.1",
3
+ "version": "0.0.0-nightly-20230405-0421.1",
4
4
  "description": "Progress component for FluentUI v9",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -27,15 +27,15 @@
27
27
  "devDependencies": {
28
28
  "@fluentui/eslint-plugin": "*",
29
29
  "@fluentui/react-conformance": "*",
30
- "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230403-0420.1",
30
+ "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230405-0421.1",
31
31
  "@fluentui/scripts-api-extractor": "*",
32
32
  "@fluentui/scripts-tasks": "*"
33
33
  },
34
34
  "dependencies": {
35
- "@fluentui/react-field": "0.0.0-nightly-20230403-0420.1",
36
- "@fluentui/react-shared-contexts": "0.0.0-nightly-20230403-0420.1",
37
- "@fluentui/react-theme": "0.0.0-nightly-20230403-0420.1",
38
- "@fluentui/react-utilities": "0.0.0-nightly-20230403-0420.1",
35
+ "@fluentui/react-field": "0.0.0-nightly-20230405-0421.1",
36
+ "@fluentui/react-shared-contexts": "0.0.0-nightly-20230405-0421.1",
37
+ "@fluentui/react-theme": "0.0.0-nightly-20230405-0421.1",
38
+ "@fluentui/react-utilities": "0.0.0-nightly-20230405-0421.1",
39
39
  "@griffel/react": "^1.5.2",
40
40
  "@swc/helpers": "^0.4.14"
41
41
  },