Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
Copy link

@github-actions github-actions bot Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵🏾‍♀️ visual changes to review in the Visual Change Report

vr-tests-react-components/CalendarCompat 4 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/CalendarCompat.multiDayView.default.chromium.png 495 Changed
vr-tests-react-components/CalendarCompat.multiDayView - High Contrast.default.chromium.png 1236 Changed
vr-tests-react-components/CalendarCompat.multiDayView.default.chromium_1.png 403 Changed
vr-tests-react-components/CalendarCompat.multiDayView - Dark Mode.default.chromium.png 1107 Changed
vr-tests-react-components/Charts-DonutChart 3 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Charts-DonutChart.Dynamic - RTL.default.chromium.png 5570 Changed
vr-tests-react-components/Charts-DonutChart.Dynamic.default.chromium.png 5581 Changed
vr-tests-react-components/Charts-DonutChart.Dynamic - Dark Mode.default.chromium.png 7530 Changed
vr-tests-react-components/Menu Converged - submenuIndicator slotted content 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default.submenus open.chromium.png 413 Changed
vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default - RTL.submenus open.chromium.png 404 Changed
vr-tests-react-components/Positioning 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Positioning.Positioning end.chromium.png 723 Changed
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 607 Changed
vr-tests-react-components/TagPicker 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/TagPicker.disabled - RTL.chromium.png 635 Changed

There were 2 duplicate changes discarded. Check the build logs for more information.

"type": "minor",
"comment": "feat: add base hooks for ProgressBar",
"packageName": "@fluentui/react-progress",
"email": "dmytrokirpa@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
export type { ProgressBarProps, ProgressBarSlots, ProgressBarState } from './components/ProgressBar/index';
export type {
ProgressBarProps,
ProgressBarBaseProps,
ProgressBarSlots,
ProgressBarState,
ProgressBarBaseState,
} from './components/ProgressBar/index';
export {
ProgressBar,
progressBarClassNames,
renderProgressBar_unstable,
useProgressBarStyles_unstable,
useProgressBar_unstable,
useProgressBarBase_unstable,
} from './components/ProgressBar/index';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
import type { ComponentProps, ComponentState, DistributiveOmit, Slot } from '@fluentui/react-utilities';

export type ProgressBarSlots = {
/**
Expand Down Expand Up @@ -46,9 +46,19 @@ export type ProgressBarProps = Omit<ComponentProps<ProgressBarSlots>, 'size'> &
color?: 'brand' | 'success' | 'warning' | 'error';
};

/**
* ProgressBar base props — excludes design props (shape, thickness, color).
*/
export type ProgressBarBaseProps = DistributiveOmit<ProgressBarProps, 'shape' | 'thickness' | 'color'>;

/**
* State used in rendering ProgressBar
*/
export type ProgressBarState = ComponentState<Required<ProgressBarSlots>> &
Required<Pick<ProgressBarProps, 'max' | 'shape' | 'thickness'>> &
Pick<ProgressBarProps, 'value' | 'color'>;

/**
* ProgressBar base state — excludes design props (shape, thickness, color).
*/
export type ProgressBarBaseState = DistributiveOmit<ProgressBarState, 'shape' | 'thickness' | 'color'>;
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
export { ProgressBar } from './ProgressBar';
export type { ProgressBarProps, ProgressBarSlots, ProgressBarState } from './ProgressBar.types';
export type {
ProgressBarProps,
ProgressBarBaseProps,
ProgressBarSlots,
ProgressBarState,
ProgressBarBaseState,
} from './ProgressBar.types';
export { renderProgressBar_unstable } from './renderProgressBar';
export { useProgressBar_unstable } from './useProgressBar';
export { useProgressBar_unstable, useProgressBarBase_unstable } from './useProgressBar';
export { progressBarClassNames, useProgressBarStyles_unstable } from './useProgressBarStyles.styles';
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import * as React from 'react';
import { useFieldContext_unstable } from '@fluentui/react-field';
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
import { clampValue, clampMax } from '../../utils/index';
import type { ProgressBarProps, ProgressBarState } from './ProgressBar.types';
import type {
ProgressBarBaseProps,
ProgressBarBaseState,
ProgressBarProps,
ProgressBarState,
} from './ProgressBar.types';

/**
* Create the state required to render ProgressBar.
Expand All @@ -24,6 +29,31 @@ export const useProgressBar_unstable = (props: ProgressBarProps, ref: React.Ref<
shape = 'rounded',
thickness = 'medium',
} = props;

const state = useProgressBarBase_unstable(props, ref);

return {
...state,
color,
shape,
thickness,
};
};

/**
* Base hook for ProgressBar component. Manages state related to ARIA progressbar attributes
* (role, aria-valuemin, aria-valuemax, aria-valuenow) and field context integration —
* without design props (shape, thickness, color).
*
* @param props - props from this instance of ProgressBar (without shape, thickness, color)
* @param ref - reference to root HTMLElement of ProgressBar
*/
export const useProgressBarBase_unstable = (
props: ProgressBarBaseProps,
ref: React.Ref<HTMLElement>,
): ProgressBarBaseState => {
const field = useFieldContext_unstable();

const max = clampMax(props.max ?? 1);
const value = clampValue(props.value, max);

Expand All @@ -49,16 +79,12 @@ export const useProgressBar_unstable = (props: ProgressBarProps, ref: React.Ref<
.join(' ');
}
const bar = slot.always(props.bar, { elementType: 'div' });
const state: ProgressBarState = {
color,

return {
max,
shape,
thickness,
value,
components: { root: 'div', bar: 'div' },
root,
bar,
};

return state;
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ export {
useProgressBarStyles_unstable,
} from './ProgressBar';
export type { ProgressBarProps, ProgressBarSlots, ProgressBarState } from './ProgressBar';

// Experimental APIs - will be uncommented in the experimental release branch
// export { useProgressBarBase_unstable } from './ProgressBar';
// export type { ProgressBarBaseProps, ProgressBarBaseState } from './ProgressBar';