Skip to content

feat(react-progress): add useProgressBarBase_unstable hook#35817

Draft
dmytrokirpa wants to merge 3 commits intomasterfrom
feat/react-progress-base-hooks
Draft

feat(react-progress): add useProgressBarBase_unstable hook#35817
dmytrokirpa wants to merge 3 commits intomasterfrom
feat/react-progress-base-hooks

Conversation

@dmytrokirpa
Copy link
Contributor

Summary

  • Adds useProgressBarBase_unstable hook that extracts pure ProgressBar logic: ARIA role=progressbar, aria-valuemin, aria-valuemax, aria-valuenow, field context integration (aria-labelledby, aria-describedby), value clamping
  • Adds ProgressBarBaseProps and ProgressBarBaseState types using DistributiveOmit
  • Refactors useProgressBar_unstable to delegate to the base hook, then add design props
  • Exports new types and hook from both the component index.ts and package index.ts

Design props excluded from base hook

Prop Description
shape 'rounded' or 'square' bar shape
thickness 'medium' or 'large' bar thickness
color 'brand' / 'success' / 'warning' / 'error' status color

Functional props retained in base hook

  • value — current progress value (used for ARIA attributes)
  • max — maximum progress value (used for ARIA attributes, defaults to 1)
  • bar slot — filled portion of the track
  • Field context integration (labelId, validationMessageId, hintId)

Test plan

  • TypeScript compiles without errors (npx tsc -p packages/react-components/react-progress/library/tsconfig.json --noEmit)
  • useProgressBarBase_unstable is exported from the package index
  • Existing ProgressBar behavior is unchanged

🤖 Generated with Claude Code

dmytrokirpa and others added 2 commits March 5, 2026 11:57
Implements useProgressBarBase_unstable hook that extracts the core ARIA progressbar
logic (role=progressbar, aria-valuemin/max/valuenow, field context integration)
without design props (shape, thickness, color). The styled hook useProgressBar_unstable
now delegates to the base hook and adds design-specific state.

Adds ProgressBarBaseProps and ProgressBarBaseState types derived from ProgressBarProps/
ProgressBarState using DistributiveOmit, omitting shape, thickness, and color.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dmytrokirpa dmytrokirpa force-pushed the feat/react-progress-base-hooks branch from 87ed181 to e86cd02 Compare March 5, 2026 10:58
@dmytrokirpa dmytrokirpa changed the base branch from experimental/component-base-hooks to master March 5, 2026 10:58
@github-actions github-actions bot removed the CI label Mar 5, 2026
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: entire library
1.292 MB
323.107 kB
1.292 MB
323.117 kB
44 B
10 B
react-progress
ProgressBar
15.7 kB
6.214 kB
15.751 kB
6.216 kB
51 B
2 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
70.397 kB
19.96 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
236.537 kB
68.697 kB
react-components
react-components: FluentProvider & webLightTheme
43.612 kB
14.022 kB
react-portal-compat
PortalCompatProvider
8.386 kB
2.624 kB
react-timepicker-compat
TimePicker
108.174 kB
35.695 kB
🤖 This report was generated against ace36179073ac4600a3635304a0941bd7dcda21d

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

Pull request demo site: URL

@@ -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.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant