@fluentui/react-progress 9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 → 9.74.3-experimental.esm.20260709-49ee7a20cf.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +113 -10
  2. package/dist/index.d.cts +112 -0
  3. package/dist/index.d.ts +28 -3
  4. package/lib/ProgressBar.js +1 -1
  5. package/lib/ProgressBar.js.map +1 -1
  6. package/lib/components/ProgressBar/ProgressBar.js +5 -5
  7. package/lib/components/ProgressBar/ProgressBar.js.map +1 -1
  8. package/lib/components/ProgressBar/ProgressBar.types.js +1 -1
  9. package/lib/components/ProgressBar/ProgressBar.types.js.map +1 -1
  10. package/lib/components/ProgressBar/index.js +4 -4
  11. package/lib/components/ProgressBar/index.js.map +1 -1
  12. package/lib/components/ProgressBar/progressBarMotions.js +37 -0
  13. package/lib/components/ProgressBar/progressBarMotions.js.map +1 -0
  14. package/lib/components/ProgressBar/renderProgressBar.js +4 -2
  15. package/lib/components/ProgressBar/renderProgressBar.js.map +1 -1
  16. package/lib/components/ProgressBar/useProgressBar.js +35 -11
  17. package/lib/components/ProgressBar/useProgressBar.js.map +1 -1
  18. package/lib/components/ProgressBar/useProgressBarStyles.styles.js +7 -39
  19. package/lib/components/ProgressBar/useProgressBarStyles.styles.js.map +1 -1
  20. package/lib/components/ProgressBar/useProgressBarStyles.styles.raw.js +7 -30
  21. package/lib/components/ProgressBar/useProgressBarStyles.styles.raw.js.map +1 -1
  22. package/lib/index.js +1 -1
  23. package/lib/index.js.map +1 -1
  24. package/lib/utils/index.js +2 -2
  25. package/lib/utils/index.js.map +1 -1
  26. package/lib-commonjs/{ProgressBar.js → ProgressBar.cjs} +4 -1
  27. package/lib-commonjs/ProgressBar.cjs.map +1 -0
  28. package/lib-commonjs/components/ProgressBar/{ProgressBar.js → ProgressBar.cjs} +3 -3
  29. package/lib-commonjs/components/ProgressBar/{ProgressBar.js.map → ProgressBar.cjs.map} +1 -1
  30. package/lib-commonjs/components/ProgressBar/{ProgressBar.types.js → ProgressBar.types.cjs} +1 -1
  31. package/lib-commonjs/components/ProgressBar/ProgressBar.types.cjs.map +1 -0
  32. package/lib-commonjs/components/ProgressBar/{index.js → index.cjs} +7 -4
  33. package/lib-commonjs/components/ProgressBar/index.cjs.map +1 -0
  34. package/lib-commonjs/components/ProgressBar/progressBarMotions.cjs +43 -0
  35. package/lib-commonjs/components/ProgressBar/progressBarMotions.cjs.map +1 -0
  36. package/lib-commonjs/components/ProgressBar/{renderProgressBar.js → renderProgressBar.cjs} +3 -1
  37. package/lib-commonjs/components/ProgressBar/renderProgressBar.cjs.map +1 -0
  38. package/lib-commonjs/components/ProgressBar/{useProgressBar.js → useProgressBar.cjs} +37 -13
  39. package/lib-commonjs/components/ProgressBar/useProgressBar.cjs.map +1 -0
  40. package/lib-commonjs/components/ProgressBar/{useProgressBarStyles.styles.js → useProgressBarStyles.styles.cjs} +4 -59
  41. package/lib-commonjs/components/ProgressBar/useProgressBarStyles.styles.cjs.map +1 -0
  42. package/lib-commonjs/components/ProgressBar/{useProgressBarStyles.styles.raw.js → useProgressBarStyles.styles.raw.cjs} +5 -28
  43. package/lib-commonjs/components/ProgressBar/useProgressBarStyles.styles.raw.cjs.map +1 -0
  44. package/lib-commonjs/{index.js → index.cjs} +4 -1
  45. package/lib-commonjs/index.cjs.map +1 -0
  46. package/lib-commonjs/utils/{index.js → index.cjs} +2 -2
  47. package/lib-commonjs/utils/{index.js.map → index.cjs.map} +1 -1
  48. package/package.json +19 -12
  49. package/lib-commonjs/ProgressBar.js.map +0 -1
  50. package/lib-commonjs/components/ProgressBar/ProgressBar.types.js.map +0 -1
  51. package/lib-commonjs/components/ProgressBar/index.js.map +0 -1
  52. package/lib-commonjs/components/ProgressBar/renderProgressBar.js.map +0 -1
  53. package/lib-commonjs/components/ProgressBar/useProgressBar.js.map +0 -1
  54. package/lib-commonjs/components/ProgressBar/useProgressBarStyles.styles.js.map +0 -1
  55. package/lib-commonjs/components/ProgressBar/useProgressBarStyles.styles.raw.js.map +0 -1
  56. package/lib-commonjs/index.js.map +0 -1
  57. /package/lib-commonjs/utils/{clampMax.js → clampMax.cjs} +0 -0
  58. /package/lib-commonjs/utils/{clampMax.js.map → clampMax.cjs.map} +0 -0
  59. /package/lib-commonjs/utils/{clampValue.js → clampValue.cjs} +0 -0
  60. /package/lib-commonjs/utils/{clampValue.js.map → clampValue.cjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,22 +1,125 @@
1
1
  # Change Log - @fluentui/react-progress
2
2
 
3
- This log was last generated on Thu, 22 Jan 2026 16:12:43 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 09 Jul 2026 17:34:14 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [9.72.9-experimental.component-base-hooks.20260122-49fc330360.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0)
7
+ ## [9.74.3-experimental.esm.20260709-49ee7a20cf.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.74.3-experimental.esm.20260709-49ee7a20cf.0)
8
8
 
9
- Thu, 22 Jan 2026 16:12:43 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.4.12..@fluentui/react-progress_v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0)
9
+ Thu, 09 Jul 2026 17:34:14 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.5.3..@fluentui/react-progress_v9.74.3-experimental.esm.20260709-49ee7a20cf.0)
11
11
 
12
12
  ### Changes
13
13
 
14
- - Release 9.72.9-experimental.component-base-hooks.20260122-49fc330360 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui/react-field to v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 ([commit](https://github.com/microsoft/fluentui/commit/373001c3e19d022ef1fcf745ea96375cf4f3aff1) by beachball)
16
- - Bump @fluentui/react-jsx-runtime to v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 ([commit](https://github.com/microsoft/fluentui/commit/373001c3e19d022ef1fcf745ea96375cf4f3aff1) by beachball)
17
- - Bump @fluentui/react-shared-contexts to v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 ([commit](https://github.com/microsoft/fluentui/commit/373001c3e19d022ef1fcf745ea96375cf4f3aff1) by beachball)
18
- - Bump @fluentui/react-theme to v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 ([commit](https://github.com/microsoft/fluentui/commit/373001c3e19d022ef1fcf745ea96375cf4f3aff1) by beachball)
19
- - Bump @fluentui/react-utilities to v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 ([commit](https://github.com/microsoft/fluentui/commit/373001c3e19d022ef1fcf745ea96375cf4f3aff1) by beachball)
14
+ - Release 9.74.3-experimental.esm.20260709-49ee7a20cf ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
+ - Bump @fluentui/react-motion to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
16
+ - Bump @fluentui/react-field to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
17
+ - Bump @fluentui/react-jsx-runtime to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
18
+ - Bump @fluentui/react-shared-contexts to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
19
+ - Bump @fluentui/react-theme to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
20
+ - Bump @fluentui/react-utilities to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
21
+
22
+ ## [9.5.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.5.3)
23
+
24
+ Wed, 24 Jun 2026 11:09:53 GMT
25
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.5.2..@fluentui/react-progress_v9.5.3)
26
+
27
+ ### Patches
28
+
29
+ - fix: remove redundant use no memo directives, and add justification to valid ones ([PR #36224](https://github.com/microsoft/fluentui/pull/36224) by martinhochel@microsoft.com)
30
+ - Bump @fluentui/react-motion to v9.16.1 ([commit](https://github.com/microsoft/fluentui/commit/a4b871ca80c1f16f35ab4229def4fe02be7f30ea) by beachball)
31
+ - Bump @fluentui/react-field to v9.5.3 ([commit](https://github.com/microsoft/fluentui/commit/a4b871ca80c1f16f35ab4229def4fe02be7f30ea) by beachball)
32
+ - Bump @fluentui/react-jsx-runtime to v9.4.4 ([commit](https://github.com/microsoft/fluentui/commit/a4b871ca80c1f16f35ab4229def4fe02be7f30ea) by beachball)
33
+ - Bump @fluentui/react-utilities to v9.26.5 ([commit](https://github.com/microsoft/fluentui/commit/a4b871ca80c1f16f35ab4229def4fe02be7f30ea) by beachball)
34
+
35
+ ## [9.5.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.5.2)
36
+
37
+ Tue, 26 May 2026 09:39:33 GMT
38
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.5.1..@fluentui/react-progress_v9.5.2)
39
+
40
+ ### Patches
41
+
42
+ - Bump @fluentui/react-motion to v9.16.0 ([PR #36246](https://github.com/microsoft/fluentui/pull/36246) by beachball)
43
+ - Bump @fluentui/react-field to v9.5.2 ([PR #36246](https://github.com/microsoft/fluentui/pull/36246) by beachball)
44
+ - Bump @fluentui/react-jsx-runtime to v9.4.3 ([PR #36246](https://github.com/microsoft/fluentui/pull/36246) by beachball)
45
+ - Bump @fluentui/react-utilities to v9.26.4 ([PR #36246](https://github.com/microsoft/fluentui/pull/36246) by beachball)
46
+
47
+ ## [9.5.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.5.1)
48
+
49
+ Thu, 23 Apr 2026 14:21:10 GMT
50
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.5.0..@fluentui/react-progress_v9.5.1)
51
+
52
+ ### Patches
53
+
54
+ - fix: drop unnecessary dependencies from base hooks ([PR #35972](https://github.com/microsoft/fluentui/pull/35972) by dmytrokirpa@microsoft.com)
55
+ - Bump @fluentui/react-motion to v9.15.0 ([PR #36035](https://github.com/microsoft/fluentui/pull/36035) by beachball)
56
+ - Bump @fluentui/react-field to v9.5.1 ([PR #36035](https://github.com/microsoft/fluentui/pull/36035) by beachball)
57
+ - Bump @fluentui/react-jsx-runtime to v9.4.2 ([PR #36035](https://github.com/microsoft/fluentui/pull/36035) by beachball)
58
+ - Bump @fluentui/react-utilities to v9.26.3 ([PR #36035](https://github.com/microsoft/fluentui/pull/36035) by beachball)
59
+
60
+ ## [9.5.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.5.0)
61
+
62
+ Wed, 01 Apr 2026 15:52:42 GMT
63
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.4.17..@fluentui/react-progress_v9.5.0)
64
+
65
+ ### Minor changes
66
+
67
+ - feat: add base hooks for ProgressBar ([PR #35817](https://github.com/microsoft/fluentui/pull/35817) by dmytrokirpa@microsoft.com)
68
+ - Bump @fluentui/react-field to v9.5.0 ([PR #35912](https://github.com/microsoft/fluentui/pull/35912) by beachball)
69
+
70
+ ## [9.4.17](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.4.17)
71
+
72
+ Mon, 30 Mar 2026 14:37:40 GMT
73
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.4.16..@fluentui/react-progress_v9.4.17)
74
+
75
+ ### Patches
76
+
77
+ - refactor: migrate ProgressBar from CSS to motion components ([PR #35883](https://github.com/microsoft/fluentui/pull/35883) by robertpenner@microsoft.com)
78
+ - Bump @fluentui/react-motion to v9.14.0 ([PR #35907](https://github.com/microsoft/fluentui/pull/35907) by beachball)
79
+
80
+ ## [9.4.16](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.4.16)
81
+
82
+ Wed, 11 Mar 2026 09:22:22 GMT
83
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.4.15..@fluentui/react-progress_v9.4.16)
84
+
85
+ ### Patches
86
+
87
+ - Bump @fluentui/react-field to v9.4.16 ([PR #35859](https://github.com/microsoft/fluentui/pull/35859) by beachball)
88
+
89
+ ## [9.4.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.4.15)
90
+
91
+ Wed, 25 Feb 2026 13:32:28 GMT
92
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.4.14..@fluentui/react-progress_v9.4.15)
93
+
94
+ ### Patches
95
+
96
+ - Bump @fluentui/react-field to v9.4.15 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
97
+ - Bump @fluentui/react-jsx-runtime to v9.4.1 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
98
+ - Bump @fluentui/react-shared-contexts to v9.26.2 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
99
+ - Bump @fluentui/react-utilities to v9.26.2 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
100
+
101
+ ## [9.4.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.4.14)
102
+
103
+ Thu, 12 Feb 2026 10:46:15 GMT
104
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.4.13..@fluentui/react-progress_v9.4.14)
105
+
106
+ ### Patches
107
+
108
+ - Bump @fluentui/react-field to v9.4.14 ([PR #35743](https://github.com/microsoft/fluentui/pull/35743) by beachball)
109
+ - Bump @fluentui/react-jsx-runtime to v9.4.0 ([PR #35743](https://github.com/microsoft/fluentui/pull/35743) by beachball)
110
+
111
+ ## [9.4.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.4.13)
112
+
113
+ Thu, 22 Jan 2026 17:06:37 GMT
114
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-progress_v9.4.12..@fluentui/react-progress_v9.4.13)
115
+
116
+ ### Patches
117
+
118
+ - Bump @fluentui/react-field to v9.4.13 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
119
+ - Bump @fluentui/react-jsx-runtime to v9.3.5 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
120
+ - Bump @fluentui/react-shared-contexts to v9.26.1 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
121
+ - Bump @fluentui/react-theme to v9.2.1 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
122
+ - Bump @fluentui/react-utilities to v9.26.1 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
20
123
 
21
124
  ## [9.4.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-progress_v9.4.12)
22
125
 
@@ -0,0 +1,112 @@
1
+ import type { ComponentProps } from '@fluentui/react-utilities';
2
+ import type { ComponentState } from '@fluentui/react-utilities';
3
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
4
+ import type { JSXElement } from '@fluentui/react-utilities';
5
+ import type { MotionSlotProps } from '@fluentui/react-motion';
6
+ import type * as React_2 from 'react';
7
+ import type { Slot } from '@fluentui/react-utilities';
8
+ import type { SlotClassNames } from '@fluentui/react-utilities';
9
+
10
+ /**
11
+ * A ProgressBar bar shows the progression of a task.
12
+ */
13
+ export declare const ProgressBar: ForwardRefComponent<ProgressBarProps>;
14
+
15
+ /**
16
+ * ProgressBar base props — excludes design props (shape, thickness, color).
17
+ */
18
+ export declare type ProgressBarBaseProps = Omit<ProgressBarProps, 'shape' | 'thickness' | 'color' | 'indeterminateMotion'>;
19
+
20
+ /**
21
+ * ProgressBar base state — excludes design props (shape, thickness, color).
22
+ */
23
+ export declare type ProgressBarBaseState = Omit<ProgressBarState, 'shape' | 'thickness' | 'color' | 'indeterminateMotion'>;
24
+
25
+ export declare const progressBarClassNames: SlotClassNames<Omit<ProgressBarSlots, 'indeterminateMotion'>>;
26
+
27
+ /**
28
+ * ProgressBar Props
29
+ */
30
+ export declare type ProgressBarProps = Omit<ComponentProps<ProgressBarSlots>, 'size'> & {
31
+ /**
32
+ * The shape of the bar and track.
33
+ * @default rounded
34
+ */
35
+ shape?: 'rounded' | 'square';
36
+ /**
37
+ * A decimal number between `0` and `1` (or between `0` and `max` if given),
38
+ * which specifies how much of the task has been completed.
39
+ *
40
+ * If `undefined` (default), the ProgressBar will display an **indeterminate** state.
41
+ */
42
+ value?: number;
43
+ /**
44
+ * The maximum value, which indicates the task is complete.
45
+ * The ProgressBar bar will be full when `value` equals `max`.
46
+ * @default 1
47
+ */
48
+ max?: number;
49
+ /**
50
+ * The thickness of the ProgressBar bar
51
+ * @default medium
52
+ */
53
+ thickness?: 'medium' | 'large';
54
+ /**
55
+ * The status of the ProgressBar bar. Changes the color of the bar.
56
+ * @default brand
57
+ */
58
+ color?: 'brand' | 'success' | 'warning' | 'error';
59
+ };
60
+
61
+ export declare type ProgressBarSlots = {
62
+ /**
63
+ * The track behind the ProgressBar bar
64
+ */
65
+ root: NonNullable<Slot<'div'>>;
66
+ /**
67
+ * The filled portion of the ProgressBar bar. Animated in the indeterminate state, when no value is provided.
68
+ */
69
+ bar?: NonNullable<Slot<'div'>>;
70
+ /**
71
+ * Motion slot for the indeterminate animation. Pass `null` to disable the animation.
72
+ */
73
+ indeterminateMotion?: Slot<MotionSlotProps>;
74
+ };
75
+
76
+ /**
77
+ * State used in rendering ProgressBar
78
+ */
79
+ export declare type ProgressBarState = ComponentState<Required<ProgressBarSlots>> & Required<Pick<ProgressBarProps, 'max' | 'shape' | 'thickness'>> & Pick<ProgressBarProps, 'value' | 'color'>;
80
+
81
+ /**
82
+ * Render the final JSX of ProgressBar
83
+ */
84
+ export declare const renderProgressBar_unstable: (state: ProgressBarBaseState) => JSXElement;
85
+
86
+ /**
87
+ * Create the state required to render ProgressBar.
88
+ *
89
+ * The returned state can be modified with hooks such as useProgressBarStyles_unstable,
90
+ * before being passed to renderProgressBar_unstable.
91
+ *
92
+ * @param props - props from this instance of ProgressBar
93
+ * @param ref - reference to root HTMLElement of ProgressBar
94
+ */
95
+ export declare const useProgressBar_unstable: (props: ProgressBarProps, ref: React_2.Ref<HTMLElement>) => ProgressBarState;
96
+
97
+ /**
98
+ * Base hook for ProgressBar component. Manages state related to ARIA progressbar attributes
99
+ * (role, aria-valuemin, aria-valuemax, aria-valuenow) and field context integration —
100
+ * without design props (shape, thickness, color).
101
+ *
102
+ * @param props - props from this instance of ProgressBar (without shape, thickness, color)
103
+ * @param ref - reference to root HTMLElement of ProgressBar
104
+ */
105
+ export declare const useProgressBarBase_unstable: (props: ProgressBarBaseProps, ref: React_2.Ref<HTMLElement>) => ProgressBarBaseState;
106
+
107
+ /**
108
+ * Apply styling to the ProgressBar slots based on the state
109
+ */
110
+ export declare const useProgressBarStyles_unstable: (state: ProgressBarState) => ProgressBarState;
111
+
112
+ export { }
package/dist/index.d.ts CHANGED
@@ -2,7 +2,8 @@ import type { ComponentProps } from '@fluentui/react-utilities';
2
2
  import type { ComponentState } from '@fluentui/react-utilities';
3
3
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
4
4
  import type { JSXElement } from '@fluentui/react-utilities';
5
- import * as React_2 from 'react';
5
+ import type { MotionSlotProps } from '@fluentui/react-motion';
6
+ import type * as React_2 from 'react';
6
7
  import type { Slot } from '@fluentui/react-utilities';
7
8
  import type { SlotClassNames } from '@fluentui/react-utilities';
8
9
 
@@ -11,7 +12,17 @@ import type { SlotClassNames } from '@fluentui/react-utilities';
11
12
  */
12
13
  export declare const ProgressBar: ForwardRefComponent<ProgressBarProps>;
13
14
 
14
- export declare const progressBarClassNames: SlotClassNames<ProgressBarSlots>;
15
+ /**
16
+ * ProgressBar base props — excludes design props (shape, thickness, color).
17
+ */
18
+ export declare type ProgressBarBaseProps = Omit<ProgressBarProps, 'shape' | 'thickness' | 'color' | 'indeterminateMotion'>;
19
+
20
+ /**
21
+ * ProgressBar base state — excludes design props (shape, thickness, color).
22
+ */
23
+ export declare type ProgressBarBaseState = Omit<ProgressBarState, 'shape' | 'thickness' | 'color' | 'indeterminateMotion'>;
24
+
25
+ export declare const progressBarClassNames: SlotClassNames<Omit<ProgressBarSlots, 'indeterminateMotion'>>;
15
26
 
16
27
  /**
17
28
  * ProgressBar Props
@@ -56,6 +67,10 @@ export declare type ProgressBarSlots = {
56
67
  * The filled portion of the ProgressBar bar. Animated in the indeterminate state, when no value is provided.
57
68
  */
58
69
  bar?: NonNullable<Slot<'div'>>;
70
+ /**
71
+ * Motion slot for the indeterminate animation. Pass `null` to disable the animation.
72
+ */
73
+ indeterminateMotion?: Slot<MotionSlotProps>;
59
74
  };
60
75
 
61
76
  /**
@@ -66,7 +81,7 @@ export declare type ProgressBarState = ComponentState<Required<ProgressBarSlots>
66
81
  /**
67
82
  * Render the final JSX of ProgressBar
68
83
  */
69
- export declare const renderProgressBar_unstable: (state: ProgressBarState) => JSXElement;
84
+ export declare const renderProgressBar_unstable: (state: ProgressBarBaseState) => JSXElement;
70
85
 
71
86
  /**
72
87
  * Create the state required to render ProgressBar.
@@ -79,6 +94,16 @@ export declare const renderProgressBar_unstable: (state: ProgressBarState) => JS
79
94
  */
80
95
  export declare const useProgressBar_unstable: (props: ProgressBarProps, ref: React_2.Ref<HTMLElement>) => ProgressBarState;
81
96
 
97
+ /**
98
+ * Base hook for ProgressBar component. Manages state related to ARIA progressbar attributes
99
+ * (role, aria-valuemin, aria-valuemax, aria-valuenow) and field context integration —
100
+ * without design props (shape, thickness, color).
101
+ *
102
+ * @param props - props from this instance of ProgressBar (without shape, thickness, color)
103
+ * @param ref - reference to root HTMLElement of ProgressBar
104
+ */
105
+ export declare const useProgressBarBase_unstable: (props: ProgressBarBaseProps, ref: React_2.Ref<HTMLElement>) => ProgressBarBaseState;
106
+
82
107
  /**
83
108
  * Apply styling to the ProgressBar slots based on the state
84
109
  */
@@ -1 +1 @@
1
- export { ProgressBar, progressBarClassNames, renderProgressBar_unstable, useProgressBarStyles_unstable, useProgressBar_unstable } from './components/ProgressBar/index';
1
+ export { ProgressBar, progressBarClassNames, renderProgressBar_unstable, useProgressBarStyles_unstable, useProgressBar_unstable, useProgressBarBase_unstable } from "./components/ProgressBar/index.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ProgressBar.ts"],"sourcesContent":["export type { ProgressBarProps, ProgressBarSlots, ProgressBarState } from './components/ProgressBar/index';\nexport {\n ProgressBar,\n progressBarClassNames,\n renderProgressBar_unstable,\n useProgressBarStyles_unstable,\n useProgressBar_unstable,\n} from './components/ProgressBar/index';\n"],"names":["ProgressBar","progressBarClassNames","renderProgressBar_unstable","useProgressBarStyles_unstable","useProgressBar_unstable"],"mappings":"AACA,SACEA,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uBAAuB,QAClB,iCAAiC"}
1
+ {"version":3,"sources":["../src/ProgressBar.ts"],"sourcesContent":["export type {\n ProgressBarProps,\n ProgressBarBaseProps,\n ProgressBarSlots,\n ProgressBarState,\n ProgressBarBaseState,\n} from './components/ProgressBar/index';\nexport {\n ProgressBar,\n progressBarClassNames,\n renderProgressBar_unstable,\n useProgressBarStyles_unstable,\n useProgressBar_unstable,\n useProgressBarBase_unstable,\n} from './components/ProgressBar/index';\n"],"names":["ProgressBar","progressBarClassNames","renderProgressBar_unstable","useProgressBarStyles_unstable","useProgressBar_unstable","useProgressBarBase_unstable"],"mappings":"AAOA,SACEA,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uBAAuB,EACvBC,2BAA2B,QACtB,oCAAiC"}
@@ -1,9 +1,9 @@
1
1
  'use client';
2
- import * as React from 'react';
3
- import { useProgressBar_unstable } from './useProgressBar';
4
- import { renderProgressBar_unstable } from './renderProgressBar';
5
- import { useProgressBarStyles_unstable } from './useProgressBarStyles.styles';
6
- import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
2
+ import * as React from "react";
3
+ import { useProgressBar_unstable } from "./useProgressBar.js";
4
+ import { renderProgressBar_unstable } from "./renderProgressBar.js";
5
+ import { useProgressBarStyles_unstable } from "./useProgressBarStyles.styles.js";
6
+ import { useCustomStyleHook_unstable } from "@fluentui/react-shared-contexts";
7
7
  /**
8
8
  * A ProgressBar bar shows the progression of a task.
9
9
  */ export const ProgressBar = /*#__PURE__*/ React.forwardRef((props, ref)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ProgressBar/ProgressBar.tsx"],"sourcesContent":["'use client';\n\nimport * 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"],"mappings":"AAAA;AAEA,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":["'use client';\n\nimport * 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"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,uBAAuB,QAAQ,sBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,6BAA6B,QAAQ,mCAAgC;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,3 +1,3 @@
1
1
  /**
2
- * State used in rendering ProgressBar
2
+ * ProgressBar base state excludes design props (shape, thickness, color).
3
3
  */ export { };
@@ -1 +1 @@
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":[],"mappings":"AAgDA;;CAEC,GACD,WAE4C"}
1
+ {"version":3,"sources":["../src/components/ProgressBar/ProgressBar.types.ts"],"sourcesContent":["import type { MotionSlotProps } from '@fluentui/react-motion';\nimport 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 * Motion slot for the indeterminate animation. Pass `null` to disable the animation.\n */\n indeterminateMotion?: Slot<MotionSlotProps>;\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 * ProgressBar base props — excludes design props (shape, thickness, color).\n */\nexport type ProgressBarBaseProps = Omit<ProgressBarProps, 'shape' | 'thickness' | 'color' | 'indeterminateMotion'>;\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\n/**\n * ProgressBar base state — excludes design props (shape, thickness, color).\n */\nexport type ProgressBarBaseState = Omit<ProgressBarState, 'shape' | 'thickness' | 'color' | 'indeterminateMotion'>;\n"],"names":[],"mappings":"AAiEA;;CAEC,GACD,WAAmH"}
@@ -1,4 +1,4 @@
1
- export { ProgressBar } from './ProgressBar';
2
- export { renderProgressBar_unstable } from './renderProgressBar';
3
- export { useProgressBar_unstable } from './useProgressBar';
4
- export { progressBarClassNames, useProgressBarStyles_unstable } from './useProgressBarStyles.styles';
1
+ export { ProgressBar } from "./ProgressBar.js";
2
+ export { renderProgressBar_unstable } from "./renderProgressBar.js";
3
+ export { useProgressBar_unstable, useProgressBarBase_unstable } from "./useProgressBar.js";
4
+ export { progressBarClassNames, useProgressBarStyles_unstable } from "./useProgressBarStyles.styles.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ProgressBar/index.ts"],"sourcesContent":["export { ProgressBar } from './ProgressBar';\nexport type { ProgressBarProps, ProgressBarSlots, ProgressBarState } from './ProgressBar.types';\nexport { renderProgressBar_unstable } from './renderProgressBar';\nexport { useProgressBar_unstable } from './useProgressBar';\nexport { progressBarClassNames, useProgressBarStyles_unstable } from './useProgressBarStyles.styles';\n"],"names":["ProgressBar","renderProgressBar_unstable","useProgressBar_unstable","progressBarClassNames","useProgressBarStyles_unstable"],"mappings":"AAAA,SAASA,WAAW,QAAQ,gBAAgB;AAE5C,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,qBAAqB,EAAEC,6BAA6B,QAAQ,gCAAgC"}
1
+ {"version":3,"sources":["../src/components/ProgressBar/index.ts"],"sourcesContent":["export { ProgressBar } from './ProgressBar';\nexport type {\n ProgressBarProps,\n ProgressBarBaseProps,\n ProgressBarSlots,\n ProgressBarState,\n ProgressBarBaseState,\n} from './ProgressBar.types';\nexport { renderProgressBar_unstable } from './renderProgressBar';\nexport { useProgressBar_unstable, useProgressBarBase_unstable } from './useProgressBar';\nexport { progressBarClassNames, useProgressBarStyles_unstable } from './useProgressBarStyles.styles';\n"],"names":["ProgressBar","renderProgressBar_unstable","useProgressBar_unstable","useProgressBarBase_unstable","progressBarClassNames","useProgressBarStyles_unstable"],"mappings":"AAAA,SAASA,WAAW,QAAQ,mBAAgB;AAQ5C,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,uBAAuB,EAAEC,2BAA2B,QAAQ,sBAAmB;AACxF,SAASC,qBAAqB,EAAEC,6BAA6B,QAAQ,mCAAgC"}
@@ -0,0 +1,37 @@
1
+ import { createMotionComponent, motionTokens } from "@fluentui/react-motion";
2
+ /**
3
+ * Motion component for the indeterminate ProgressBar bar:
4
+ * a horizontal sliding animation that loops indefinitely.
5
+ * In reduced motion mode, the bar pulses opacity instead of sliding.
6
+ */ export const ProgressBarIndeterminateMotion = createMotionComponent({
7
+ // translate percentages are relative to the element's own width, not the container's.
8
+ // The indeterminate bar is ~33% the width of its container, so:
9
+ // translate: '-100%' === left: '-33%' (one bar-width off-screen to the left)
10
+ // translate: '300%' === left: '100%' (3 × bar-width ≈ full container width, off-screen to the right)
11
+ keyframes: [
12
+ {
13
+ translate: '-100%'
14
+ },
15
+ {
16
+ translate: '300%'
17
+ }
18
+ ],
19
+ duration: 3000,
20
+ iterations: Infinity,
21
+ easing: motionTokens.curveLinear,
22
+ reducedMotion: {
23
+ keyframes: [
24
+ {
25
+ opacity: 0.2
26
+ },
27
+ {
28
+ opacity: 1
29
+ },
30
+ {
31
+ opacity: 0.2
32
+ }
33
+ ],
34
+ duration: 3000,
35
+ iterations: Infinity
36
+ }
37
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ProgressBar/progressBarMotions.ts"],"sourcesContent":["import { createMotionComponent, motionTokens } from '@fluentui/react-motion';\n\n/**\n * Motion component for the indeterminate ProgressBar bar:\n * a horizontal sliding animation that loops indefinitely.\n * In reduced motion mode, the bar pulses opacity instead of sliding.\n */\nexport const ProgressBarIndeterminateMotion = createMotionComponent({\n // translate percentages are relative to the element's own width, not the container's.\n // The indeterminate bar is ~33% the width of its container, so:\n // translate: '-100%' === left: '-33%' (one bar-width off-screen to the left)\n // translate: '300%' === left: '100%' (3 × bar-width ≈ full container width, off-screen to the right)\n keyframes: [{ translate: '-100%' }, { translate: '300%' }],\n duration: 3000,\n iterations: Infinity,\n easing: motionTokens.curveLinear,\n\n reducedMotion: {\n keyframes: [{ opacity: 0.2 }, { opacity: 1 }, { opacity: 0.2 }],\n duration: 3000,\n iterations: Infinity,\n },\n});\n"],"names":["createMotionComponent","motionTokens","ProgressBarIndeterminateMotion","keyframes","translate","duration","iterations","Infinity","easing","curveLinear","reducedMotion","opacity"],"mappings":"AAAA,SAASA,qBAAqB,EAAEC,YAAY,QAAQ,yBAAyB;AAE7E;;;;CAIC,GACD,OAAO,MAAMC,iCAAiCF,sBAAsB;IAClE,sFAAsF;IACtF,gEAAgE;IAChE,+EAA+E;IAC/E,wGAAwG;IACxGG,WAAW;QAAC;YAAEC,WAAW;QAAQ;QAAG;YAAEA,WAAW;QAAO;KAAE;IAC1DC,UAAU;IACVC,YAAYC;IACZC,QAAQP,aAAaQ,WAAW;IAEhCC,eAAe;QACbP,WAAW;YAAC;gBAAEQ,SAAS;YAAI;YAAG;gBAAEA,SAAS;YAAE;YAAG;gBAAEA,SAAS;YAAI;SAAE;QAC/DN,UAAU;QACVC,YAAYC;IACd;AACF,GAAG"}
@@ -1,10 +1,12 @@
1
1
  import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
- import { assertSlots } from '@fluentui/react-utilities';
2
+ import { assertSlots } from "@fluentui/react-utilities";
3
3
  /**
4
4
  * Render the final JSX of ProgressBar
5
5
  */ export const renderProgressBar_unstable = (state)=>{
6
6
  assertSlots(state);
7
7
  return /*#__PURE__*/ _jsx(state.root, {
8
- children: state.bar && /*#__PURE__*/ _jsx(state.bar, {})
8
+ children: state.bar && (state.indeterminateMotion ? /*#__PURE__*/ _jsx(state.indeterminateMotion, {
9
+ children: /*#__PURE__*/ _jsx(state.bar, {})
10
+ }) : /*#__PURE__*/ _jsx(state.bar, {}))
9
11
  });
10
12
  };
@@ -1 +1 @@
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 { JSXElement } 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): JSXElement => {\n assertSlots<ProgressBarSlots>(state);\n return <state.root>{state.bar && <state.bar />}</state.root>;\n};\n"],"names":["assertSlots","renderProgressBar_unstable","state","root","bar"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;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 { JSXElement } from '@fluentui/react-utilities';\nimport type { ProgressBarBaseState, ProgressBarSlots } from './ProgressBar.types';\n\n/**\n * Render the final JSX of ProgressBar\n */\nexport const renderProgressBar_unstable = (state: ProgressBarBaseState): JSXElement => {\n assertSlots<ProgressBarSlots>(state);\n return (\n <state.root>\n {state.bar &&\n (state.indeterminateMotion ? (\n <state.indeterminateMotion>\n <state.bar />\n </state.indeterminateMotion>\n ) : (\n <state.bar />\n ))}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderProgressBar_unstable","state","root","bar","indeterminateMotion"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzCF,YAA8BE;IAC9B,qBACE,KAACA,MAAMC,IAAI;kBACRD,MAAME,GAAG,IACPF,CAAAA,MAAMG,mBAAmB,iBACxB,KAACH,MAAMG,mBAAmB;sBACxB,cAAA,KAACH,MAAME,GAAG;2BAGZ,KAACF,MAAME,GAAG,KACZ;;AAGR,EAAE"}
@@ -1,8 +1,9 @@
1
1
  'use client';
2
- import * as React from 'react';
3
- import { useFieldContext_unstable } from '@fluentui/react-field';
4
- import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
5
- import { clampValue, clampMax } from '../../utils/index';
2
+ import { useFieldContext_unstable } from "@fluentui/react-field";
3
+ import { motionSlot } from "@fluentui/react-motion";
4
+ import { getIntrinsicElementProps, slot } from "@fluentui/react-utilities";
5
+ import { clampValue, clampMax } from "../../utils/index.js";
6
+ import { ProgressBarIndeterminateMotion } from "./progressBarMotions.js";
6
7
  /**
7
8
  * Create the state required to render ProgressBar.
8
9
  *
@@ -14,7 +15,33 @@ import { clampValue, clampMax } from '../../utils/index';
14
15
  */ export const useProgressBar_unstable = (props, ref)=>{
15
16
  const field = useFieldContext_unstable();
16
17
  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;
18
+ const { color = fieldState === 'error' || fieldState === 'warning' || fieldState === 'success' ? fieldState : 'brand', shape = 'rounded', thickness = 'medium', indeterminateMotion, ...baseProps } = props;
19
+ const state = useProgressBarBase_unstable(baseProps, ref);
20
+ return {
21
+ ...state,
22
+ components: {
23
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
24
+ ...state.components,
25
+ indeterminateMotion: ProgressBarIndeterminateMotion
26
+ },
27
+ color,
28
+ shape,
29
+ thickness,
30
+ indeterminateMotion: state.value === undefined ? motionSlot(indeterminateMotion, {
31
+ elementType: ProgressBarIndeterminateMotion,
32
+ defaultProps: {}
33
+ }) : undefined
34
+ };
35
+ };
36
+ /**
37
+ * Base hook for ProgressBar component. Manages state related to ARIA progressbar attributes
38
+ * (role, aria-valuemin, aria-valuemax, aria-valuenow) and field context integration —
39
+ * without design props (shape, thickness, color).
40
+ *
41
+ * @param props - props from this instance of ProgressBar (without shape, thickness, color)
42
+ * @param ref - reference to root HTMLElement of ProgressBar
43
+ */ export const useProgressBarBase_unstable = (props, ref)=>{
44
+ const field = useFieldContext_unstable();
18
45
  var _props_max;
19
46
  const max = clampMax((_props_max = props.max) !== null && _props_max !== void 0 ? _props_max : 1);
20
47
  const value = clampValue(props.value, max);
@@ -43,18 +70,15 @@ import { clampValue, clampMax } from '../../utils/index';
43
70
  const bar = slot.always(props.bar, {
44
71
  elementType: 'div'
45
72
  });
46
- const state = {
47
- color,
73
+ return {
48
74
  max,
49
- shape,
50
- thickness,
51
75
  value,
52
76
  components: {
53
77
  root: 'div',
54
- bar: 'div'
78
+ bar: 'div',
79
+ indeterminateMotion: 'div'
55
80
  },
56
81
  root,
57
82
  bar
58
83
  };
59
- return state;
60
84
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ProgressBar/useProgressBar.tsx"],"sourcesContent":["'use client';\n\nimport * 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"],"mappings":"AAAA;AAEA,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":["'use client';\n\nimport type * as React from 'react';\nimport { useFieldContext_unstable } from '@fluentui/react-field';\nimport { motionSlot } from '@fluentui/react-motion';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { clampValue, clampMax } from '../../utils/index';\nimport type {\n ProgressBarProps,\n ProgressBarState,\n ProgressBarBaseProps,\n ProgressBarBaseState,\n} from './ProgressBar.types';\nimport { ProgressBarIndeterminateMotion } from './progressBarMotions';\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 indeterminateMotion,\n ...baseProps\n } = props;\n\n const state = useProgressBarBase_unstable(baseProps, ref);\n\n return {\n ...state,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...state.components,\n indeterminateMotion: ProgressBarIndeterminateMotion,\n },\n color,\n shape,\n thickness,\n indeterminateMotion:\n state.value === undefined\n ? motionSlot(indeterminateMotion, {\n elementType: ProgressBarIndeterminateMotion,\n defaultProps: {},\n })\n : undefined,\n };\n};\n\n/**\n * Base hook for ProgressBar component. Manages state related to ARIA progressbar attributes\n * (role, aria-valuemin, aria-valuemax, aria-valuenow) and field context integration —\n * without design props (shape, thickness, color).\n *\n * @param props - props from this instance of ProgressBar (without shape, thickness, color)\n * @param ref - reference to root HTMLElement of ProgressBar\n */\nexport const useProgressBarBase_unstable = (\n props: ProgressBarBaseProps,\n ref: React.Ref<HTMLElement>,\n): ProgressBarBaseState => {\n const field = useFieldContext_unstable();\n\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\n return {\n max,\n value,\n components: { root: 'div', bar: 'div', indeterminateMotion: 'div' },\n root,\n bar,\n };\n};\n"],"names":["useFieldContext_unstable","motionSlot","getIntrinsicElementProps","slot","clampValue","clampMax","ProgressBarIndeterminateMotion","useProgressBar_unstable","props","ref","field","fieldState","validationState","color","shape","thickness","indeterminateMotion","baseProps","state","useProgressBarBase_unstable","components","value","undefined","elementType","defaultProps","max","root","always","role","labelId","validationMessageId","hintId","filter","Boolean","join","bar"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,QAAQ,wBAAwB;AACjE,SAASC,UAAU,QAAQ,yBAAyB;AACpD,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAC3E,SAASC,UAAU,EAAEC,QAAQ,QAAQ,uBAAoB;AAOzD,SAASC,8BAA8B,QAAQ,0BAAuB;AAEtE;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAA0B,CAACC,OAAyBC;IAC/D,MAAMC,QAAQV;IACd,MAAMW,aAAaD,kBAAAA,4BAAAA,MAAOE,eAAe;IAEzC,MAAM,EACJC,QAAQF,eAAe,WAAWA,eAAe,aAAaA,eAAe,YAAYA,aAAa,OAAO,EAC7GG,QAAQ,SAAS,EACjBC,YAAY,QAAQ,EACpBC,mBAAmB,EACnB,GAAGC,WACJ,GAAGT;IAEJ,MAAMU,QAAQC,4BAA4BF,WAAWR;IAErD,OAAO;QACL,GAAGS,KAAK;QACRE,YAAY;YACV,4DAA4D;YAC5D,GAAGF,MAAME,UAAU;YACnBJ,qBAAqBV;QACvB;QACAO;QACAC;QACAC;QACAC,qBACEE,MAAMG,KAAK,KAAKC,YACZrB,WAAWe,qBAAqB;YAC9BO,aAAajB;YACbkB,cAAc,CAAC;QACjB,KACAF;IACR;AACF,EAAE;AAEF;;;;;;;CAOC,GACD,OAAO,MAAMH,8BAA8B,CACzCX,OACAC;IAEA,MAAMC,QAAQV;QAEOQ;IAArB,MAAMiB,MAAMpB,SAASG,CAAAA,aAAAA,MAAMiB,GAAG,cAATjB,wBAAAA,aAAa;IAClC,MAAMa,QAAQjB,WAAWI,MAAMa,KAAK,EAAEI;IAEtC,MAAMC,OAAOvB,KAAKwB,MAAM,CACtBzB,yBAAyB,OAAO;QAC9B,SAAS;QACT,4EAA4E;QAC5E,4FAA4F;QAC5FO,KAAKA;QACLmB,MAAM;QACN,iBAAiBP,UAAUC,YAAY,IAAIA;QAC3C,iBAAiBD,UAAUC,YAAYG,MAAMH;QAC7C,iBAAiBD;QACjB,iBAAiB,EAAEX,kBAAAA,4BAAAA,MAAOmB,OAAO;QACjC,GAAGrB,KAAK;IACV,IACA;QAAEe,aAAa;IAAM;IAEvB,IAAIb,SAAUA,CAAAA,MAAMoB,mBAAmB,IAAIpB,MAAMqB,MAAM,AAAD,GAAI;QACxD,oFAAoF;QACpFL,IAAI,CAAC,mBAAmB,GAAG;YAAChB,kBAAAA,4BAAAA,MAAOoB,mBAAmB;YAAEpB,kBAAAA,4BAAAA,MAAOqB,MAAM;YAAEL,IAAI,CAAC,mBAAmB;SAAC,CAC7FM,MAAM,CAACC,SACPC,IAAI,CAAC;IACV;IACA,MAAMC,MAAMhC,KAAKwB,MAAM,CAACnB,MAAM2B,GAAG,EAAE;QAAEZ,aAAa;IAAM;IAExD,OAAO;QACLE;QACAJ;QACAD,YAAY;YAAEM,MAAM;YAAOS,KAAK;YAAOnB,qBAAqB;QAAM;QAClEU;QACAS;IACF;AACF,EAAE"}