@fluentui/react-progress 9.1.88 → 9.1.90
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +29 -2
- package/lib/ProgressBar.js.map +1 -1
- package/lib/components/ProgressBar/ProgressBar.js.map +1 -1
- package/lib/components/ProgressBar/ProgressBar.types.js.map +1 -1
- package/lib/components/ProgressBar/index.js.map +1 -1
- package/lib/components/ProgressBar/renderProgressBar.js.map +1 -1
- package/lib/components/ProgressBar/useProgressBar.js.map +1 -1
- package/lib/components/ProgressBar/useProgressBarStyles.styles.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib/utils/clampMax.js.map +1 -1
- package/lib/utils/clampValue.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib-commonjs/ProgressBar.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/ProgressBar.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/ProgressBar.types.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/index.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/renderProgressBar.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/useProgressBar.js.map +1 -1
- package/lib-commonjs/components/ProgressBar/useProgressBarStyles.styles.js +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/clampMax.js.map +1 -1
- package/lib-commonjs/utils/clampValue.js.map +1 -1
- package/lib-commonjs/utils/index.js.map +1 -1
- package/package.json +7 -21
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,39 @@
|
|
1
1
|
# Change Log - @fluentui/react-progress
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Mon, 11 Nov 2024 09:55:16 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.1.90](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.1.90)
|
8
|
+
|
9
|
+
Mon, 11 Nov 2024 09:55:16 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.1.89..@fluentui/react-progress_v9.1.90)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- chore: replace npm-scripts and just-scrtips with nx inferred tasks ([PR #33074](https://github.com/microsoft/fluentui/pull/33074) by martinhochel@microsoft.com)
|
15
|
+
- Bump @fluentui/react-field to v9.1.79 ([PR #31887](https://github.com/microsoft/fluentui/pull/31887) by beachball)
|
16
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.46 ([PR #31887](https://github.com/microsoft/fluentui/pull/31887) by beachball)
|
17
|
+
- Bump @fluentui/react-shared-contexts to v9.21.0 ([PR #31887](https://github.com/microsoft/fluentui/pull/31887) by beachball)
|
18
|
+
- Bump @fluentui/react-theme to v9.1.22 ([PR #31887](https://github.com/microsoft/fluentui/pull/31887) by beachball)
|
19
|
+
- Bump @fluentui/react-utilities to v9.18.17 ([PR #31887](https://github.com/microsoft/fluentui/pull/31887) by beachball)
|
20
|
+
|
21
|
+
## [9.1.89](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.1.89)
|
22
|
+
|
23
|
+
Tue, 15 Oct 2024 17:17:53 GMT
|
24
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.1.88..@fluentui/react-progress_v9.1.89)
|
25
|
+
|
26
|
+
### Patches
|
27
|
+
|
28
|
+
- Bump @fluentui/react-field to v9.1.78 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
|
29
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.45 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
|
30
|
+
- Bump @fluentui/react-shared-contexts to v9.20.2 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
|
31
|
+
- Bump @fluentui/react-theme to v9.1.21 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
|
32
|
+
- Bump @fluentui/react-utilities to v9.18.16 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
|
33
|
+
|
7
34
|
## [9.1.88](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.1.88)
|
8
35
|
|
9
|
-
Tue, 08 Oct 2024 22:
|
36
|
+
Tue, 08 Oct 2024 22:05:59 GMT
|
10
37
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.1.87..@fluentui/react-progress_v9.1.88)
|
11
38
|
|
12
39
|
### Patches
|
package/lib/ProgressBar.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["ProgressBar.ts"],"sourcesContent":["export * from './components/ProgressBar/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,iCAAiC"}
|
1
|
+
{"version":3,"sources":["../src/ProgressBar.ts"],"sourcesContent":["export * from './components/ProgressBar/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,iCAAiC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["ProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useProgressBar_unstable } from './useProgressBar';\nimport { renderProgressBar_unstable } from './renderProgressBar';\nimport { useProgressBarStyles_unstable } from './useProgressBarStyles.styles';\nimport type { ProgressBarProps } from './ProgressBar.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A ProgressBar bar shows the progression of a task.\n */\nexport const ProgressBar: ForwardRefComponent<ProgressBarProps> = React.forwardRef((props, ref) => {\n const state = useProgressBar_unstable(props, ref);\n\n useProgressBarStyles_unstable(state);\n\n useCustomStyleHook_unstable('useProgressBarStyles_unstable')(state);\n\n return renderProgressBar_unstable(state);\n});\n\nProgressBar.displayName = 'ProgressBar';\n"],"names":["React","useProgressBar_unstable","renderProgressBar_unstable","useProgressBarStyles_unstable","useCustomStyleHook_unstable","ProgressBar","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,gCAAgC;AAG9E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,4BAAqDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQR,wBAAwBM,OAAOC;IAE7CL,8BAA8BM;IAE9BL,4BAA4B,iCAAiCK;IAE7D,OAAOP,2BAA2BO;AACpC,GAAG;AAEHJ,YAAYK,WAAW,GAAG"}
|
1
|
+
{"version":3,"sources":["../src/components/ProgressBar/ProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useProgressBar_unstable } from './useProgressBar';\nimport { renderProgressBar_unstable } from './renderProgressBar';\nimport { useProgressBarStyles_unstable } from './useProgressBarStyles.styles';\nimport type { ProgressBarProps } from './ProgressBar.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A ProgressBar bar shows the progression of a task.\n */\nexport const ProgressBar: ForwardRefComponent<ProgressBarProps> = React.forwardRef((props, ref) => {\n const state = useProgressBar_unstable(props, ref);\n\n useProgressBarStyles_unstable(state);\n\n useCustomStyleHook_unstable('useProgressBarStyles_unstable')(state);\n\n return renderProgressBar_unstable(state);\n});\n\nProgressBar.displayName = 'ProgressBar';\n"],"names":["React","useProgressBar_unstable","renderProgressBar_unstable","useProgressBarStyles_unstable","useCustomStyleHook_unstable","ProgressBar","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,gCAAgC;AAG9E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,4BAAqDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQR,wBAAwBM,OAAOC;IAE7CL,8BAA8BM;IAE9BL,4BAA4B,iCAAiCK;IAE7D,OAAOP,2BAA2BO;AACpC,GAAG;AAEHJ,YAAYK,WAAW,GAAG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["ProgressBar.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type ProgressBarSlots = {\n /**\n * The track behind the ProgressBar bar\n */\n root: NonNullable<Slot<'div'>>;\n /**\n * The filled portion of the ProgressBar bar. Animated in the indeterminate state, when no value is provided.\n */\n bar?: NonNullable<Slot<'div'>>;\n};\n\n/**\n * ProgressBar Props\n */\nexport type ProgressBarProps = Omit<ComponentProps<ProgressBarSlots>, 'size'> & {\n /**\n * The shape of the bar and track.\n * @default rounded\n */\n shape?: 'rounded' | 'square';\n /**\n * A decimal number between `0` and `1` (or between `0` and `max` if given),\n * which specifies how much of the task has been completed.\n *\n * If `undefined` (default), the ProgressBar will display an **indeterminate** state.\n */\n value?: number;\n /**\n * The maximum value, which indicates the task is complete.\n * The ProgressBar bar will be full when `value` equals `max`.\n * @default 1\n */\n max?: number;\n /**\n * The thickness of the ProgressBar bar\n * @default medium\n */\n thickness?: 'medium' | 'large';\n\n /**\n * The status of the ProgressBar bar. Changes the color of the bar.\n * @default brand\n */\n color?: 'brand' | 'success' | 'warning' | 'error';\n};\n\n/**\n * State used in rendering ProgressBar\n */\nexport type ProgressBarState = ComponentState<Required<ProgressBarSlots>> &\n Required<Pick<ProgressBarProps, 'max' | 'shape' | 'thickness'>> &\n Pick<ProgressBarProps, 'value' | 'color'>;\n"],"names":[],"rangeMappings":";;","mappings":"AAgDA;;CAEC,GACD,WAE4C"}
|
1
|
+
{"version":3,"sources":["../src/components/ProgressBar/ProgressBar.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type ProgressBarSlots = {\n /**\n * The track behind the ProgressBar bar\n */\n root: NonNullable<Slot<'div'>>;\n /**\n * The filled portion of the ProgressBar bar. Animated in the indeterminate state, when no value is provided.\n */\n bar?: NonNullable<Slot<'div'>>;\n};\n\n/**\n * ProgressBar Props\n */\nexport type ProgressBarProps = Omit<ComponentProps<ProgressBarSlots>, 'size'> & {\n /**\n * The shape of the bar and track.\n * @default rounded\n */\n shape?: 'rounded' | 'square';\n /**\n * A decimal number between `0` and `1` (or between `0` and `max` if given),\n * which specifies how much of the task has been completed.\n *\n * If `undefined` (default), the ProgressBar will display an **indeterminate** state.\n */\n value?: number;\n /**\n * The maximum value, which indicates the task is complete.\n * The ProgressBar bar will be full when `value` equals `max`.\n * @default 1\n */\n max?: number;\n /**\n * The thickness of the ProgressBar bar\n * @default medium\n */\n thickness?: 'medium' | 'large';\n\n /**\n * The status of the ProgressBar bar. Changes the color of the bar.\n * @default brand\n */\n color?: 'brand' | 'success' | 'warning' | 'error';\n};\n\n/**\n * State used in rendering ProgressBar\n */\nexport type ProgressBarState = ComponentState<Required<ProgressBarSlots>> &\n Required<Pick<ProgressBarProps, 'max' | 'shape' | 'thickness'>> &\n Pick<ProgressBarProps, 'value' | 'color'>;\n"],"names":[],"rangeMappings":";;","mappings":"AAgDA;;CAEC,GACD,WAE4C"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ProgressBar';\nexport * from './ProgressBar.types';\nexport * from './renderProgressBar';\nexport * from './useProgressBar';\nexport * from './useProgressBarStyles.styles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,gBAAgB;AAC9B,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,mBAAmB;AACjC,cAAc,gCAAgC"}
|
1
|
+
{"version":3,"sources":["../src/components/ProgressBar/index.ts"],"sourcesContent":["export * from './ProgressBar';\nexport * from './ProgressBar.types';\nexport * from './renderProgressBar';\nexport * from './useProgressBar';\nexport * from './useProgressBarStyles.styles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,gBAAgB;AAC9B,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,mBAAmB;AACjC,cAAc,gCAAgC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["renderProgressBar.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { ProgressBarState, ProgressBarSlots } from './ProgressBar.types';\n\n/**\n * Render the final JSX of ProgressBar\n */\nexport const renderProgressBar_unstable = (state: ProgressBarState) => {\n assertSlots<ProgressBarSlots>(state);\n return <state.root>{state.bar && <state.bar />}</state.root>;\n};\n"],"names":["assertSlots","renderProgressBar_unstable","state","root","bar"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzCF,YAA8BE;IAC9B,qBAAO,KAACA,MAAMC,IAAI;kBAAED,MAAME,GAAG,kBAAI,KAACF,MAAME,GAAG;;AAC7C,EAAE"}
|
1
|
+
{"version":3,"sources":["../src/components/ProgressBar/renderProgressBar.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { ProgressBarState, ProgressBarSlots } from './ProgressBar.types';\n\n/**\n * Render the final JSX of ProgressBar\n */\nexport const renderProgressBar_unstable = (state: ProgressBarState) => {\n assertSlots<ProgressBarSlots>(state);\n return <state.root>{state.bar && <state.bar />}</state.root>;\n};\n"],"names":["assertSlots","renderProgressBar_unstable","state","root","bar"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzCF,YAA8BE;IAC9B,qBAAO,KAACA,MAAMC,IAAI;kBAAED,MAAME,GAAG,kBAAI,KAACF,MAAME,GAAG;;AAC7C,EAAE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useFieldContext_unstable } from '@fluentui/react-field';\nimport { getIntrinsicElementProps, slot } 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 = slot.always(\n 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 as React.Ref<HTMLDivElement>,\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 { elementType: 'div' },\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 const bar = slot.always(props.bar, { elementType: 'div' });\n const state: ProgressBarState = {\n color,\n max,\n shape,\n thickness,\n value,\n components: { root: 'div', bar: 'div' },\n root,\n bar,\n };\n\n return state;\n};\n"],"names":["React","useFieldContext_unstable","getIntrinsicElementProps","slot","clampValue","clampMax","useProgressBar_unstable","props","ref","field","fieldState","validationState","color","shape","thickness","max","value","root","always","role","undefined","labelId","elementType","validationMessageId","hintId","filter","Boolean","join","bar","state","components"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,QAAQ,wBAAwB;AACjE,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAC3E,SAASC,UAAU,EAAEC,QAAQ,QAAQ,oBAAoB;AAGzD;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAA0B,CAACC,OAAyBC;IAC/D,MAAMC,QAAQR;IACd,MAAMS,aAAaD,kBAAAA,4BAAAA,MAAOE,eAAe;IAEzC,MAAM,EACJC,QAAQF,eAAe,WAAWA,eAAe,aAAaA,eAAe,YAAYA,aAAa,OAAO,EAC7GG,QAAQ,SAAS,EACjBC,YAAY,QAAQ,EACrB,GAAGP;QACiBA;IAArB,MAAMQ,MAAMV,SAASE,CAAAA,aAAAA,MAAMQ,GAAG,cAATR,wBAAAA,aAAa;IAClC,MAAMS,QAAQZ,WAAWG,MAAMS,KAAK,EAAED;IAEtC,MAAME,OAAOd,KAAKe,MAAM,CACtBhB,yBAAyB,OAAO;QAC9B,SAAS;QACT,4EAA4E;QAC5E,4FAA4F;QAC5FM,KAAKA;QACLW,MAAM;QACN,iBAAiBH,UAAUI,YAAY,IAAIA;QAC3C,iBAAiBJ,UAAUI,YAAYL,MAAMK;QAC7C,iBAAiBJ;QACjB,iBAAiB,EAAEP,kBAAAA,4BAAAA,MAAOY,OAAO;QACjC,GAAGd,KAAK;IACV,IACA;QAAEe,aAAa;IAAM;IAEvB,IAAIb,SAAUA,CAAAA,MAAMc,mBAAmB,IAAId,MAAMe,MAAM,AAAD,GAAI;QACxD,oFAAoF;QACpFP,IAAI,CAAC,mBAAmB,GAAG;YAACR,kBAAAA,4BAAAA,MAAOc,mBAAmB;YAAEd,kBAAAA,4BAAAA,MAAOe,MAAM;YAAEP,IAAI,CAAC,mBAAmB;SAAC,CAC7FQ,MAAM,CAACC,SACPC,IAAI,CAAC;IACV;IACA,MAAMC,MAAMzB,KAAKe,MAAM,CAACX,MAAMqB,GAAG,EAAE;QAAEN,aAAa;IAAM;IACxD,MAAMO,QAA0B;QAC9BjB;QACAG;QACAF;QACAC;QACAE;QACAc,YAAY;YAAEb,MAAM;YAAOW,KAAK;QAAM;QACtCX;QACAW;IACF;IAEA,OAAOC;AACT,EAAE"}
|
1
|
+
{"version":3,"sources":["../src/components/ProgressBar/useProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useFieldContext_unstable } from '@fluentui/react-field';\nimport { getIntrinsicElementProps, slot } 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 = slot.always(\n 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 as React.Ref<HTMLDivElement>,\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 { elementType: 'div' },\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 const bar = slot.always(props.bar, { elementType: 'div' });\n const state: ProgressBarState = {\n color,\n max,\n shape,\n thickness,\n value,\n components: { root: 'div', bar: 'div' },\n root,\n bar,\n };\n\n return state;\n};\n"],"names":["React","useFieldContext_unstable","getIntrinsicElementProps","slot","clampValue","clampMax","useProgressBar_unstable","props","ref","field","fieldState","validationState","color","shape","thickness","max","value","root","always","role","undefined","labelId","elementType","validationMessageId","hintId","filter","Boolean","join","bar","state","components"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,QAAQ,wBAAwB;AACjE,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAC3E,SAASC,UAAU,EAAEC,QAAQ,QAAQ,oBAAoB;AAGzD;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAA0B,CAACC,OAAyBC;IAC/D,MAAMC,QAAQR;IACd,MAAMS,aAAaD,kBAAAA,4BAAAA,MAAOE,eAAe;IAEzC,MAAM,EACJC,QAAQF,eAAe,WAAWA,eAAe,aAAaA,eAAe,YAAYA,aAAa,OAAO,EAC7GG,QAAQ,SAAS,EACjBC,YAAY,QAAQ,EACrB,GAAGP;QACiBA;IAArB,MAAMQ,MAAMV,SAASE,CAAAA,aAAAA,MAAMQ,GAAG,cAATR,wBAAAA,aAAa;IAClC,MAAMS,QAAQZ,WAAWG,MAAMS,KAAK,EAAED;IAEtC,MAAME,OAAOd,KAAKe,MAAM,CACtBhB,yBAAyB,OAAO;QAC9B,SAAS;QACT,4EAA4E;QAC5E,4FAA4F;QAC5FM,KAAKA;QACLW,MAAM;QACN,iBAAiBH,UAAUI,YAAY,IAAIA;QAC3C,iBAAiBJ,UAAUI,YAAYL,MAAMK;QAC7C,iBAAiBJ;QACjB,iBAAiB,EAAEP,kBAAAA,4BAAAA,MAAOY,OAAO;QACjC,GAAGd,KAAK;IACV,IACA;QAAEe,aAAa;IAAM;IAEvB,IAAIb,SAAUA,CAAAA,MAAMc,mBAAmB,IAAId,MAAMe,MAAM,AAAD,GAAI;QACxD,oFAAoF;QACpFP,IAAI,CAAC,mBAAmB,GAAG;YAACR,kBAAAA,4BAAAA,MAAOc,mBAAmB;YAAEd,kBAAAA,4BAAAA,MAAOe,MAAM;YAAEP,IAAI,CAAC,mBAAmB;SAAC,CAC7FQ,MAAM,CAACC,SACPC,IAAI,CAAC;IACV;IACA,MAAMC,MAAMzB,KAAKe,MAAM,CAACX,MAAMqB,GAAG,EAAE;QAAEN,aAAa;IAAM;IACxD,MAAMO,QAA0B;QAC9BjB;QACAG;QACAF;QACAC;QACAE;QACAc,YAAY;YAAEb,MAAM;YAAOW,KAAK;QAAM;QACtCX;QACAW;IACF;IAEA,OAAOC;AACT,EAAE"}
|
package/lib/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export {\n ProgressBar,\n progressBarClassNames,\n renderProgressBar_unstable,\n useProgressBar_unstable,\n useProgressBarStyles_unstable,\n} from './ProgressBar';\nexport type { ProgressBarProps, ProgressBarSlots, ProgressBarState } from './ProgressBar';\n"],"names":["ProgressBar","progressBarClassNames","renderProgressBar_unstable","useProgressBar_unstable","useProgressBarStyles_unstable"],"rangeMappings":"","mappings":"AAAA,SACEA,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,uBAAuB,EACvBC,6BAA6B,QACxB,gBAAgB"}
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n ProgressBar,\n progressBarClassNames,\n renderProgressBar_unstable,\n useProgressBar_unstable,\n useProgressBarStyles_unstable,\n} from './ProgressBar';\nexport type { ProgressBarProps, ProgressBarSlots, ProgressBarState } from './ProgressBar';\n"],"names":["ProgressBar","progressBarClassNames","renderProgressBar_unstable","useProgressBar_unstable","useProgressBarStyles_unstable"],"rangeMappings":"","mappings":"AAAA,SACEA,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,uBAAuB,EACvBC,6BAA6B,QACxB,gBAAgB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["clampMax.ts"],"sourcesContent":["export const clampMax = (max: number): number => {\n const internalMax = max <= 0 ? 1 : max;\n\n if (process.env.NODE_ENV !== 'production') {\n if (max <= 0) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'max' must be greater than 0. Received max: ${max}`);\n }\n }\n return internalMax;\n};\n"],"names":["clampMax","max","internalMax","process","env","NODE_ENV","console","error"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,OAAO,MAAMA,WAAW,CAACC;IACvB,MAAMC,cAAcD,OAAO,IAAI,IAAIA;IAEnC,IAAIE,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIJ,OAAO,GAAG;YACZ,sCAAsC;YACtCK,QAAQC,KAAK,CAAC,CAAC,qDAAqD,EAAEN,IAAI,CAAC;QAC7E;IACF;IACA,OAAOC;AACT,EAAE"}
|
1
|
+
{"version":3,"sources":["../src/utils/clampMax.ts"],"sourcesContent":["export const clampMax = (max: number): number => {\n const internalMax = max <= 0 ? 1 : max;\n\n if (process.env.NODE_ENV !== 'production') {\n if (max <= 0) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'max' must be greater than 0. Received max: ${max}`);\n }\n }\n return internalMax;\n};\n"],"names":["clampMax","max","internalMax","process","env","NODE_ENV","console","error"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,OAAO,MAAMA,WAAW,CAACC;IACvB,MAAMC,cAAcD,OAAO,IAAI,IAAIA;IAEnC,IAAIE,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIJ,OAAO,GAAG;YACZ,sCAAsC;YACtCK,QAAQC,KAAK,CAAC,CAAC,qDAAqD,EAAEN,IAAI,CAAC;QAC7E;IACF;IACA,OAAOC;AACT,EAAE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["clampValue.ts"],"sourcesContent":["export const clampValue = (value: number | undefined, max: number): number | undefined => {\n if (value === undefined) {\n return value;\n }\n const internalValue = value < 0 ? 0 : value > max ? max : value;\n\n if (process.env.NODE_ENV !== 'production') {\n if (value < 0) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'value' must be greater than or equal to zero. Received value: ${value}`);\n }\n if (value > max) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'value' must be less than or equal to 'max'. Received value: ${value}, max: ${max}`);\n }\n }\n return internalValue;\n};\n"],"names":["clampValue","value","max","undefined","internalValue","process","env","NODE_ENV","console","error"],"rangeMappings":";;;;;;;;;;;;;;;;","mappings":"AAAA,OAAO,MAAMA,aAAa,CAACC,OAA2BC;IACpD,IAAID,UAAUE,WAAW;QACvB,OAAOF;IACT;IACA,MAAMG,gBAAgBH,QAAQ,IAAI,IAAIA,QAAQC,MAAMA,MAAMD;IAE1D,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIN,QAAQ,GAAG;YACb,sCAAsC;YACtCO,QAAQC,KAAK,CAAC,CAAC,wEAAwE,EAAER,MAAM,CAAC;QAClG;QACA,IAAIA,QAAQC,KAAK;YACf,sCAAsC;YACtCM,QAAQC,KAAK,CAAC,CAAC,sEAAsE,EAAER,MAAM,OAAO,EAAEC,IAAI,CAAC;QAC7G;IACF;IACA,OAAOE;AACT,EAAE"}
|
1
|
+
{"version":3,"sources":["../src/utils/clampValue.ts"],"sourcesContent":["export const clampValue = (value: number | undefined, max: number): number | undefined => {\n if (value === undefined) {\n return value;\n }\n const internalValue = value < 0 ? 0 : value > max ? max : value;\n\n if (process.env.NODE_ENV !== 'production') {\n if (value < 0) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'value' must be greater than or equal to zero. Received value: ${value}`);\n }\n if (value > max) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'value' must be less than or equal to 'max'. Received value: ${value}, max: ${max}`);\n }\n }\n return internalValue;\n};\n"],"names":["clampValue","value","max","undefined","internalValue","process","env","NODE_ENV","console","error"],"rangeMappings":";;;;;;;;;;;;;;;;","mappings":"AAAA,OAAO,MAAMA,aAAa,CAACC,OAA2BC;IACpD,IAAID,UAAUE,WAAW;QACvB,OAAOF;IACT;IACA,MAAMG,gBAAgBH,QAAQ,IAAI,IAAIA,QAAQC,MAAMA,MAAMD;IAE1D,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIN,QAAQ,GAAG;YACb,sCAAsC;YACtCO,QAAQC,KAAK,CAAC,CAAC,wEAAwE,EAAER,MAAM,CAAC;QAClG;QACA,IAAIA,QAAQC,KAAK;YACf,sCAAsC;YACtCM,QAAQC,KAAK,CAAC,CAAC,sEAAsE,EAAER,MAAM,OAAO,EAAEC,IAAI,CAAC;QAC7G;IACF;IACA,OAAOE;AACT,EAAE"}
|
package/lib/utils/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './clampMax';\nexport * from './clampValue';\n"],"names":[],"rangeMappings":";","mappings":"AAAA,cAAc,aAAa;AAC3B,cAAc,eAAe"}
|
1
|
+
{"version":3,"sources":["../src/utils/index.ts"],"sourcesContent":["export * from './clampMax';\nexport * from './clampValue';\n"],"names":[],"rangeMappings":";","mappings":"AAAA,cAAc,aAAa;AAC3B,cAAc,eAAe"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["ProgressBar.ts"],"sourcesContent":["export * from './components/ProgressBar/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
1
|
+
{"version":3,"sources":["../src/ProgressBar.ts"],"sourcesContent":["export * from './components/ProgressBar/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["ProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useProgressBar_unstable } from './useProgressBar';\nimport { renderProgressBar_unstable } from './renderProgressBar';\nimport { useProgressBarStyles_unstable } from './useProgressBarStyles.styles';\nimport type { ProgressBarProps } from './ProgressBar.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A ProgressBar bar shows the progression of a task.\n */\nexport const ProgressBar: ForwardRefComponent<ProgressBarProps> = React.forwardRef((props, ref) => {\n const state = useProgressBar_unstable(props, ref);\n\n useProgressBarStyles_unstable(state);\n\n useCustomStyleHook_unstable('useProgressBarStyles_unstable')(state);\n\n return renderProgressBar_unstable(state);\n});\n\nProgressBar.displayName = 'ProgressBar';\n"],"names":["ProgressBar","React","forwardRef","props","ref","state","useProgressBar_unstable","useProgressBarStyles_unstable","useCustomStyleHook_unstable","renderProgressBar_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;gCACiB;mCACG;4CACG;qCAGF;AAKrC,MAAMA,cAAAA,WAAAA,GAAqDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQC,IAAAA,uCAAAA,EAAwBH,OAAOC;IAE7CG,IAAAA,yDAAAA,EAA8BF;IAE9BG,IAAAA,gDAAAA,EAA4B,iCAAiCH;IAE7D,OAAOI,IAAAA,6CAAAA,EAA2BJ;AACpC;AAEAL,YAAYU,WAAW,GAAG"}
|
1
|
+
{"version":3,"sources":["../src/components/ProgressBar/ProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useProgressBar_unstable } from './useProgressBar';\nimport { renderProgressBar_unstable } from './renderProgressBar';\nimport { useProgressBarStyles_unstable } from './useProgressBarStyles.styles';\nimport type { ProgressBarProps } from './ProgressBar.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A ProgressBar bar shows the progression of a task.\n */\nexport const ProgressBar: ForwardRefComponent<ProgressBarProps> = React.forwardRef((props, ref) => {\n const state = useProgressBar_unstable(props, ref);\n\n useProgressBarStyles_unstable(state);\n\n useCustomStyleHook_unstable('useProgressBarStyles_unstable')(state);\n\n return renderProgressBar_unstable(state);\n});\n\nProgressBar.displayName = 'ProgressBar';\n"],"names":["ProgressBar","React","forwardRef","props","ref","state","useProgressBar_unstable","useProgressBarStyles_unstable","useCustomStyleHook_unstable","renderProgressBar_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;gCACiB;mCACG;4CACG;qCAGF;AAKrC,MAAMA,cAAAA,WAAAA,GAAqDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQC,IAAAA,uCAAAA,EAAwBH,OAAOC;IAE7CG,IAAAA,yDAAAA,EAA8BF;IAE9BG,IAAAA,gDAAAA,EAA4B,iCAAiCH;IAE7D,OAAOI,IAAAA,6CAAAA,EAA2BJ;AACpC;AAEAL,YAAYU,WAAW,GAAG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["ProgressBar.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type ProgressBarSlots = {\n /**\n * The track behind the ProgressBar bar\n */\n root: NonNullable<Slot<'div'>>;\n /**\n * The filled portion of the ProgressBar bar. Animated in the indeterminate state, when no value is provided.\n */\n bar?: NonNullable<Slot<'div'>>;\n};\n\n/**\n * ProgressBar Props\n */\nexport type ProgressBarProps = Omit<ComponentProps<ProgressBarSlots>, 'size'> & {\n /**\n * The shape of the bar and track.\n * @default rounded\n */\n shape?: 'rounded' | 'square';\n /**\n * A decimal number between `0` and `1` (or between `0` and `max` if given),\n * which specifies how much of the task has been completed.\n *\n * If `undefined` (default), the ProgressBar will display an **indeterminate** state.\n */\n value?: number;\n /**\n * The maximum value, which indicates the task is complete.\n * The ProgressBar bar will be full when `value` equals `max`.\n * @default 1\n */\n max?: number;\n /**\n * The thickness of the ProgressBar bar\n * @default medium\n */\n thickness?: 'medium' | 'large';\n\n /**\n * The status of the ProgressBar bar. Changes the color of the bar.\n * @default brand\n */\n color?: 'brand' | 'success' | 'warning' | 'error';\n};\n\n/**\n * State used in rendering ProgressBar\n */\nexport type ProgressBarState = ComponentState<Required<ProgressBarSlots>> &\n Required<Pick<ProgressBarProps, 'max' | 'shape' | 'thickness'>> &\n Pick<ProgressBarProps, 'value' | 'color'>;\n"],"names":[],"rangeMappings":";;","mappings":"AAgDA;;CAEC"}
|
1
|
+
{"version":3,"sources":["../src/components/ProgressBar/ProgressBar.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type ProgressBarSlots = {\n /**\n * The track behind the ProgressBar bar\n */\n root: NonNullable<Slot<'div'>>;\n /**\n * The filled portion of the ProgressBar bar. Animated in the indeterminate state, when no value is provided.\n */\n bar?: NonNullable<Slot<'div'>>;\n};\n\n/**\n * ProgressBar Props\n */\nexport type ProgressBarProps = Omit<ComponentProps<ProgressBarSlots>, 'size'> & {\n /**\n * The shape of the bar and track.\n * @default rounded\n */\n shape?: 'rounded' | 'square';\n /**\n * A decimal number between `0` and `1` (or between `0` and `max` if given),\n * which specifies how much of the task has been completed.\n *\n * If `undefined` (default), the ProgressBar will display an **indeterminate** state.\n */\n value?: number;\n /**\n * The maximum value, which indicates the task is complete.\n * The ProgressBar bar will be full when `value` equals `max`.\n * @default 1\n */\n max?: number;\n /**\n * The thickness of the ProgressBar bar\n * @default medium\n */\n thickness?: 'medium' | 'large';\n\n /**\n * The status of the ProgressBar bar. Changes the color of the bar.\n * @default brand\n */\n color?: 'brand' | 'success' | 'warning' | 'error';\n};\n\n/**\n * State used in rendering ProgressBar\n */\nexport type ProgressBarState = ComponentState<Required<ProgressBarSlots>> &\n Required<Pick<ProgressBarProps, 'max' | 'shape' | 'thickness'>> &\n Pick<ProgressBarProps, 'value' | 'color'>;\n"],"names":[],"rangeMappings":";;","mappings":"AAgDA;;CAEC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ProgressBar';\nexport * from './ProgressBar.types';\nexport * from './renderProgressBar';\nexport * from './useProgressBar';\nexport * from './useProgressBarStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
|
1
|
+
{"version":3,"sources":["../src/components/ProgressBar/index.ts"],"sourcesContent":["export * from './ProgressBar';\nexport * from './ProgressBar.types';\nexport * from './renderProgressBar';\nexport * from './useProgressBar';\nexport * from './useProgressBarStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["renderProgressBar.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { ProgressBarState, ProgressBarSlots } from './ProgressBar.types';\n\n/**\n * Render the final JSX of ProgressBar\n */\nexport const renderProgressBar_unstable = (state: ProgressBarState) => {\n assertSlots<ProgressBarSlots>(state);\n return <state.root>{state.bar && <state.bar />}</state.root>;\n};\n"],"names":["renderProgressBar_unstable","state","assertSlots","_jsx","root","bar"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,6BAA6B,CAACC;IACzCC,IAAAA,2BAAAA,EAA8BD;IAC9B,OAAA,WAAA,GAAOE,IAAAA,eAAA,EAACF,MAAMG,IAAI,EAAA;kBAAEH,MAAMI,GAAG,IAAA,WAAA,GAAIF,IAAAA,eAAA,EAACF,MAAMI,GAAG,EAAA,CAAA;;AAC7C"}
|
1
|
+
{"version":3,"sources":["../src/components/ProgressBar/renderProgressBar.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { ProgressBarState, ProgressBarSlots } from './ProgressBar.types';\n\n/**\n * Render the final JSX of ProgressBar\n */\nexport const renderProgressBar_unstable = (state: ProgressBarState) => {\n assertSlots<ProgressBarSlots>(state);\n return <state.root>{state.bar && <state.bar />}</state.root>;\n};\n"],"names":["renderProgressBar_unstable","state","assertSlots","_jsx","root","bar"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,6BAA6B,CAACC;IACzCC,IAAAA,2BAAAA,EAA8BD;IAC9B,OAAA,WAAA,GAAOE,IAAAA,eAAA,EAACF,MAAMG,IAAI,EAAA;kBAAEH,MAAMI,GAAG,IAAA,WAAA,GAAIF,IAAAA,eAAA,EAACF,MAAMI,GAAG,EAAA,CAAA;;AAC7C"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useFieldContext_unstable } from '@fluentui/react-field';\nimport { getIntrinsicElementProps, slot } 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 = slot.always(\n 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 as React.Ref<HTMLDivElement>,\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 { elementType: 'div' },\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 const bar = slot.always(props.bar, { elementType: 'div' });\n const state: ProgressBarState = {\n color,\n max,\n shape,\n thickness,\n value,\n components: { root: 'div', bar: 'div' },\n root,\n bar,\n };\n\n return state;\n};\n"],"names":["useProgressBar_unstable","props","ref","field","useFieldContext_unstable","fieldState","validationState","color","shape","thickness","max","clampMax","value","clampValue","root","slot","always","getIntrinsicElementProps","role","undefined","labelId","elementType","validationMessageId","hintId","filter","Boolean","join","bar","state","components"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAeaA;;;eAAAA;;;;iEAfU;4BACkB;gCACM;uBACV;AAY9B,MAAMA,0BAA0B,CAACC,OAAyBC;IAC/D,MAAMC,QAAQC,IAAAA,oCAAAA;IACd,MAAMC,aAAaF,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOG,eAAe;IAEzC,MAAM,EACJC,QAAQF,eAAe,WAAWA,eAAe,aAAaA,eAAe,YAAYA,aAAa,OAAO,EAC7GG,QAAQ,SAAS,EACjBC,YAAY,QAAQ,EACrB,GAAGR;QACiBA;IAArB,MAAMS,MAAMC,IAAAA,eAAAA,EAASV,CAAAA,aAAAA,MAAMS,GAAG,AAAHA,MAAG,QAATT,eAAAA,KAAAA,IAAAA,aAAa;IAClC,MAAMW,QAAQC,IAAAA,iBAAAA,EAAWZ,MAAMW,KAAK,EAAEF;IAEtC,MAAMI,OAAOC,oBAAAA,CAAKC,MAAM,CACtBC,IAAAA,wCAAAA,EAAyB,OAAO;QAC9B,SAAS;QACT,4EAA4E;QAC5E,4FAA4F;QAC5Ff,KAAKA;QACLgB,MAAM;QACN,iBAAiBN,UAAUO,YAAY,IAAIA;QAC3C,iBAAiBP,UAAUO,YAAYT,MAAMS;QAC7C,iBAAiBP;QACjB,mBAAmBT,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOiB,OAAO;QACjC,GAAGnB,KAAK;IACV,IACA;QAAEoB,aAAa;IAAM;IAEvB,IAAIlB,SAAUA,CAAAA,MAAMmB,mBAAmB,IAAInB,MAAMoB,MAAM,AAANA,GAAS;QACxD,oFAAoF;QACpFT,IAAI,CAAC,mBAAmB,GAAG;YAACX,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOmB,mBAAmB;YAAEnB,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOoB,MAAM;YAAET,IAAI,CAAC,mBAAmB;SAAC,CAC7FU,MAAM,CAACC,SACPC,IAAI,CAAC;IACV;IACA,MAAMC,MAAMZ,oBAAAA,CAAKC,MAAM,CAACf,MAAM0B,GAAG,EAAE;QAAEN,aAAa;IAAM;IACxD,MAAMO,QAA0B;QAC9BrB;QACAG;QACAF;QACAC;QACAG;QACAiB,YAAY;YAAEf,MAAM;YAAOa,KAAK;QAAM;QACtCb;QACAa;IACF;IAEA,OAAOC;AACT"}
|
1
|
+
{"version":3,"sources":["../src/components/ProgressBar/useProgressBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useFieldContext_unstable } from '@fluentui/react-field';\nimport { getIntrinsicElementProps, slot } 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 = slot.always(\n 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 as React.Ref<HTMLDivElement>,\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 { elementType: 'div' },\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 const bar = slot.always(props.bar, { elementType: 'div' });\n const state: ProgressBarState = {\n color,\n max,\n shape,\n thickness,\n value,\n components: { root: 'div', bar: 'div' },\n root,\n bar,\n };\n\n return state;\n};\n"],"names":["useProgressBar_unstable","props","ref","field","useFieldContext_unstable","fieldState","validationState","color","shape","thickness","max","clampMax","value","clampValue","root","slot","always","getIntrinsicElementProps","role","undefined","labelId","elementType","validationMessageId","hintId","filter","Boolean","join","bar","state","components"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAeaA;;;eAAAA;;;;iEAfU;4BACkB;gCACM;uBACV;AAY9B,MAAMA,0BAA0B,CAACC,OAAyBC;IAC/D,MAAMC,QAAQC,IAAAA,oCAAAA;IACd,MAAMC,aAAaF,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOG,eAAe;IAEzC,MAAM,EACJC,QAAQF,eAAe,WAAWA,eAAe,aAAaA,eAAe,YAAYA,aAAa,OAAO,EAC7GG,QAAQ,SAAS,EACjBC,YAAY,QAAQ,EACrB,GAAGR;QACiBA;IAArB,MAAMS,MAAMC,IAAAA,eAAAA,EAASV,CAAAA,aAAAA,MAAMS,GAAG,AAAHA,MAAG,QAATT,eAAAA,KAAAA,IAAAA,aAAa;IAClC,MAAMW,QAAQC,IAAAA,iBAAAA,EAAWZ,MAAMW,KAAK,EAAEF;IAEtC,MAAMI,OAAOC,oBAAAA,CAAKC,MAAM,CACtBC,IAAAA,wCAAAA,EAAyB,OAAO;QAC9B,SAAS;QACT,4EAA4E;QAC5E,4FAA4F;QAC5Ff,KAAKA;QACLgB,MAAM;QACN,iBAAiBN,UAAUO,YAAY,IAAIA;QAC3C,iBAAiBP,UAAUO,YAAYT,MAAMS;QAC7C,iBAAiBP;QACjB,mBAAmBT,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOiB,OAAO;QACjC,GAAGnB,KAAK;IACV,IACA;QAAEoB,aAAa;IAAM;IAEvB,IAAIlB,SAAUA,CAAAA,MAAMmB,mBAAmB,IAAInB,MAAMoB,MAAM,AAANA,GAAS;QACxD,oFAAoF;QACpFT,IAAI,CAAC,mBAAmB,GAAG;YAACX,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOmB,mBAAmB;YAAEnB,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOoB,MAAM;YAAET,IAAI,CAAC,mBAAmB;SAAC,CAC7FU,MAAM,CAACC,SACPC,IAAI,CAAC;IACV;IACA,MAAMC,MAAMZ,oBAAAA,CAAKC,MAAM,CAACf,MAAM0B,GAAG,EAAE;QAAEN,aAAa;IAAM;IACxD,MAAMO,QAA0B;QAC9BrB;QACAG;QACAF;QACAC;QACAG;QACAiB,YAAY;YAAEf,MAAM;YAAOa,KAAK;QAAM;QACtCb;QACAa;IACF;IAEA,OAAOC;AACT"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export {\n ProgressBar,\n progressBarClassNames,\n renderProgressBar_unstable,\n useProgressBar_unstable,\n useProgressBarStyles_unstable,\n} from './ProgressBar';\nexport type { ProgressBarProps, ProgressBarSlots, ProgressBarState } from './ProgressBar';\n"],"names":["ProgressBar","progressBarClassNames","renderProgressBar_unstable","useProgressBarStyles_unstable","useProgressBar_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,WAAW;eAAXA,wBAAW;;IACXC,qBAAqB;eAArBA,kCAAqB;;IACrBC,0BAA0B;eAA1BA,uCAA0B;;IAE1BC,6BAA6B;eAA7BA,0CAA6B;;IAD7BC,uBAAuB;eAAvBA,oCAAuB;;;6BAElB"}
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n ProgressBar,\n progressBarClassNames,\n renderProgressBar_unstable,\n useProgressBar_unstable,\n useProgressBarStyles_unstable,\n} from './ProgressBar';\nexport type { ProgressBarProps, ProgressBarSlots, ProgressBarState } from './ProgressBar';\n"],"names":["ProgressBar","progressBarClassNames","renderProgressBar_unstable","useProgressBarStyles_unstable","useProgressBar_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,WAAW;eAAXA,wBAAW;;IACXC,qBAAqB;eAArBA,kCAAqB;;IACrBC,0BAA0B;eAA1BA,uCAA0B;;IAE1BC,6BAA6B;eAA7BA,0CAA6B;;IAD7BC,uBAAuB;eAAvBA,oCAAuB;;;6BAElB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["clampMax.ts"],"sourcesContent":["export const clampMax = (max: number): number => {\n const internalMax = max <= 0 ? 1 : max;\n\n if (process.env.NODE_ENV !== 'production') {\n if (max <= 0) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'max' must be greater than 0. Received max: ${max}`);\n }\n }\n return internalMax;\n};\n"],"names":["clampMax","max","internalMax","process","env","NODE_ENV","console","error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,WAAW,CAACC;IACvB,MAAMC,cAAcD,OAAO,IAAI,IAAIA;IAEnC,IAAIE,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIJ,OAAO,GAAG;YACZ,sCAAsC;YACtCK,QAAQC,KAAK,CAAC,CAAC,qDAAqD,EAAEN,IAAI,CAAC;QAC7E;IACF;IACA,OAAOC;AACT"}
|
1
|
+
{"version":3,"sources":["../src/utils/clampMax.ts"],"sourcesContent":["export const clampMax = (max: number): number => {\n const internalMax = max <= 0 ? 1 : max;\n\n if (process.env.NODE_ENV !== 'production') {\n if (max <= 0) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'max' must be greater than 0. Received max: ${max}`);\n }\n }\n return internalMax;\n};\n"],"names":["clampMax","max","internalMax","process","env","NODE_ENV","console","error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,WAAW,CAACC;IACvB,MAAMC,cAAcD,OAAO,IAAI,IAAIA;IAEnC,IAAIE,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIJ,OAAO,GAAG;YACZ,sCAAsC;YACtCK,QAAQC,KAAK,CAAC,CAAC,qDAAqD,EAAEN,IAAI,CAAC;QAC7E;IACF;IACA,OAAOC;AACT"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["clampValue.ts"],"sourcesContent":["export const clampValue = (value: number | undefined, max: number): number | undefined => {\n if (value === undefined) {\n return value;\n }\n const internalValue = value < 0 ? 0 : value > max ? max : value;\n\n if (process.env.NODE_ENV !== 'production') {\n if (value < 0) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'value' must be greater than or equal to zero. Received value: ${value}`);\n }\n if (value > max) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'value' must be less than or equal to 'max'. Received value: ${value}, max: ${max}`);\n }\n }\n return internalValue;\n};\n"],"names":["clampValue","value","max","undefined","internalValue","process","env","NODE_ENV","console","error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,aAAa,CAACC,OAA2BC;IACpD,IAAID,UAAUE,WAAW;QACvB,OAAOF;IACT;IACA,MAAMG,gBAAgBH,QAAQ,IAAI,IAAIA,QAAQC,MAAMA,MAAMD;IAE1D,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIN,QAAQ,GAAG;YACb,sCAAsC;YACtCO,QAAQC,KAAK,CAAC,CAAC,wEAAwE,EAAER,MAAM,CAAC;QAClG;QACA,IAAIA,QAAQC,KAAK;YACf,sCAAsC;YACtCM,QAAQC,KAAK,CAAC,CAAC,sEAAsE,EAAER,MAAM,OAAO,EAAEC,IAAI,CAAC;QAC7G;IACF;IACA,OAAOE;AACT"}
|
1
|
+
{"version":3,"sources":["../src/utils/clampValue.ts"],"sourcesContent":["export const clampValue = (value: number | undefined, max: number): number | undefined => {\n if (value === undefined) {\n return value;\n }\n const internalValue = value < 0 ? 0 : value > max ? max : value;\n\n if (process.env.NODE_ENV !== 'production') {\n if (value < 0) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'value' must be greater than or equal to zero. Received value: ${value}`);\n }\n if (value > max) {\n // eslint-disable-next-line no-console\n console.error(`The prop 'value' must be less than or equal to 'max'. Received value: ${value}, max: ${max}`);\n }\n }\n return internalValue;\n};\n"],"names":["clampValue","value","max","undefined","internalValue","process","env","NODE_ENV","console","error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,aAAa,CAACC,OAA2BC;IACpD,IAAID,UAAUE,WAAW;QACvB,OAAOF;IACT;IACA,MAAMG,gBAAgBH,QAAQ,IAAI,IAAIA,QAAQC,MAAMA,MAAMD;IAE1D,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIN,QAAQ,GAAG;YACb,sCAAsC;YACtCO,QAAQC,KAAK,CAAC,CAAC,wEAAwE,EAAER,MAAM,CAAC;QAClG;QACA,IAAIA,QAAQC,KAAK;YACf,sCAAsC;YACtCM,QAAQC,KAAK,CAAC,CAAC,sEAAsE,EAAER,MAAM,OAAO,EAAEC,IAAI,CAAC;QAC7G;IACF;IACA,OAAOE;AACT"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './clampMax';\nexport * from './clampValue';\n"],"names":[],"rangeMappings":";;;;;;","mappings":";;;;;uBAAc;uBACA"}
|
1
|
+
{"version":3,"sources":["../src/utils/index.ts"],"sourcesContent":["export * from './clampMax';\nexport * from './clampValue';\n"],"names":[],"rangeMappings":";;;;;;","mappings":";;;;;uBAAc;uBACA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-progress",
|
3
|
-
"version": "9.1.
|
3
|
+
"version": "9.1.90",
|
4
4
|
"description": "Progress component for FluentUI v9",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -11,32 +11,18 @@
|
|
11
11
|
"url": "https://github.com/microsoft/fluentui"
|
12
12
|
},
|
13
13
|
"license": "MIT",
|
14
|
-
"scripts": {
|
15
|
-
"build": "just-scripts build",
|
16
|
-
"bundle-size": "monosize measure",
|
17
|
-
"clean": "just-scripts clean",
|
18
|
-
"code-style": "just-scripts code-style",
|
19
|
-
"just": "just-scripts",
|
20
|
-
"lint": "just-scripts lint",
|
21
|
-
"test": "jest --passWithNoTests",
|
22
|
-
"type-check": "just-scripts type-check",
|
23
|
-
"storybook": "yarn --cwd ../stories storybook",
|
24
|
-
"start": "yarn storybook",
|
25
|
-
"generate-api": "just-scripts generate-api"
|
26
|
-
},
|
27
14
|
"devDependencies": {
|
28
15
|
"@fluentui/eslint-plugin": "*",
|
29
16
|
"@fluentui/react-conformance": "*",
|
30
17
|
"@fluentui/react-conformance-griffel": "*",
|
31
|
-
"@fluentui/scripts-api-extractor": "*"
|
32
|
-
"@fluentui/scripts-tasks": "*"
|
18
|
+
"@fluentui/scripts-api-extractor": "*"
|
33
19
|
},
|
34
20
|
"dependencies": {
|
35
|
-
"@fluentui/react-field": "^9.1.
|
36
|
-
"@fluentui/react-jsx-runtime": "^9.0.
|
37
|
-
"@fluentui/react-shared-contexts": "^9.
|
38
|
-
"@fluentui/react-theme": "^9.1.
|
39
|
-
"@fluentui/react-utilities": "^9.18.
|
21
|
+
"@fluentui/react-field": "^9.1.79",
|
22
|
+
"@fluentui/react-jsx-runtime": "^9.0.46",
|
23
|
+
"@fluentui/react-shared-contexts": "^9.21.0",
|
24
|
+
"@fluentui/react-theme": "^9.1.22",
|
25
|
+
"@fluentui/react-utilities": "^9.18.17",
|
40
26
|
"@griffel/react": "^1.5.22",
|
41
27
|
"@swc/helpers": "^0.5.1"
|
42
28
|
},
|